From 2c38c4359a6f5653a2fdbfcebe128256f23dfee1 Mon Sep 17 00:00:00 2001 From: Robert Alessi Date: Sun, 24 Feb 2019 10:55:09 +0100 Subject: adapted Makefile. first lines of .sty file --- Makefile | 41 ++++++++++---- icite.dtx | 192 ++++++++++++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 172 insertions(+), 61 deletions(-) diff --git a/Makefile b/Makefile index 072d5fd..1b4c7c6 100644 --- a/Makefile +++ b/Makefile @@ -7,26 +7,45 @@ UTREE = $(shell kpsewhich --var-value TEXMFHOME) all: $(NAME).pdf test -e README.txt && mv README.txt README || exit 0 $(NAME).pdf: $(NAME).dtx - pdflatex -shell-escape -recorder -interaction=batchmode $(NAME).dtx >/dev/null + lualatex --shell-escape --recorder --interaction=batchmode $(NAME).dtx >/dev/null if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi if [ -f $(NAME).idx ]; then makeindex -q -s gind.ist -o $(NAME).ind $(NAME).idx; fi - pdflatex --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null - pdflatex --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null + lualatex --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null + lualatex --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null clean: - rm -f $(NAME).{aux,fls,glo,gls,hd,idx,ilg,ind,ins,log,out} -distclean: clean + rm -f $(NAME).{aux,fls,glo,gls,hd,idx,ilg,ind,ins,log,out,toc,listing} + rm -f *~ + rm -rf auto/ +distclean: clean uninst + rm -rf _minted-* rm -f $(NAME).{pdf,sty} README -inst: all + rm -f *.zip *.tar.gz +inst: uninst all mkdir -p $(UTREE)/{tex,source,doc}/latex/$(NAME) cp $(NAME).dtx $(UTREE)/source/latex/$(NAME) cp $(NAME).sty $(UTREE)/tex/latex/$(NAME) cp $(NAME).pdf $(UTREE)/doc/latex/$(NAME) -install: all - sudo mkdir -p $(LOCAL)/{tex,source,doc}/latex/$(NAME) - sudo cp $(NAME).dtx $(LOCAL)/source/latex/$(NAME) - sudo cp $(NAME).sty $(LOCAL)/tex/latex/$(NAME) - sudo cp $(NAME).pdf $(LOCAL)/doc/latex/$(NAME) +uninst: + rm -rf $(UTREE)/{tex,source,doc}/latex/$(NAME) +#install: all +# sudo mkdir -p $(LOCAL)/{tex,source,doc}/latex/$(NAME) +# sudo cp $(NAME).dtx $(LOCAL)/source/latex/$(NAME) +# sudo cp $(NAME).sty $(LOCAL)/tex/latex/$(NAME) +# sudo cp $(NAME).pdf $(LOCAL)/doc/latex/$(NAME) zip: all ln -sf . $(NAME) zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)/{README,$(NAME).{pdf,dtx}} rm $(NAME) +package: distclean all + mkdir $(NAME)/ + cp README *.dtx *.pdf $(NAME)/ + mkdir -p tex/latex/$(NAME)/ + cp *.sty tex/latex/$(NAME)/ + mkdir -p doc/latex/$(NAME)/ + cp *.pdf doc/latex/$(NAME)/ + mkdir -p source/latex/$(NAME)/ + cp Makefile *.dtx source/latex/$(NAME)/ + zip -r $(NAME).tds.zip tex doc source + rm -rf tex/ source/ doc/ + tar czf $(NAME)-$(VERS).tar.gz $(NAME).tds.zip $(NAME)/ + rm -rf $(NAME)/ diff --git a/icite.dtx b/icite.dtx index 6bc6db1..adfbde7 100644 --- a/icite.dtx +++ b/icite.dtx @@ -9,8 +9,8 @@ icite:| Make Indices locorum citatorum Author:| Robert Alessi E-mail:| alessi@robertalessi.net -License:| Released under the LaTeX Project Public License v1.3c or later - See:| http://www.latex-project.org/lppl.txt +License:| Released under the GNU General Public License v3 or later + See:| http://www.gnu.org/licenses/ Short description: @@ -32,23 +32,30 @@ Some text about the package: probably the same as the abstract. icite:| Make Indices locorum citatorum Author:| Robert Alessi E-mail:| alessi@robertalessi.net -License:| Released under the LaTeX Project Public License v1.3c or later - See:| http://www.latex-project.org/lppl.txt +License:| Released under the GNU General Public License v3 or later + See:| http://www.gnu.org/licenses/ \endpreamble \postamble Copyright (C) 2019 by Robert Alessi -This work may be distributed and/or modified under the -conditions of the LaTeX Project Public License (LPPL), either -version 1.3c of this license or (at your option) any later -version. The latest version of this license is in the file: +Please send error reports and suggestions for improvements to Robert +Alessi -http://www.latex-project.org/lppl.txt +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. -This work is "maintained" (as per LPPL maintenance status) by -Robert Alessi. +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see +. This work consists of the file icite.dtx and a Makefile. Running "make" generates the derived files README, icite.pdf and icite.sty. @@ -92,14 +99,68 @@ Running "make install" installs the files in the local TeX tree. % %<*driver> \documentclass{ltxdoc} -\usepackage[a4paper,margin=25mm,left=50mm,nohead]{geometry} -\usepackage[numbered]{hypdoc} +\usepackage[letterpaper,margin=25mm,left=50mm,nohead]{geometry} \usepackage{\jobname} +\usepackage{metalogox} +\usepackage{hyperxmp} +\usepackage{uri} +\usepackage[numbered]{hypdoc} +\hypersetup{unicode=true, colorlinks, allcolors=blue, + linktocpage=true, pdfauthor={Robert Alessi}, pdftitle={The + icite package}, pdfcontactemail={alessi@robertalessi.net}, + pdfcontacturl={http://www.robertalessi.net/ekdosis}, + pdfcopyright={Copyright (C) 2018 Robert Alessi + . This document is licensed under the + Creative Commons Attribution-ShareAlike 4.0 International + License. To view a copy of this license, visit + http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to + Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.}, + pdflicenseurl={https://creativecommons.org/licenses/by-sa/4.0/legalcode}, + pdfmetalang={en-US}, pdftype={Text}, pdfkeywords={bibtex, biblatex, + indexing}} +\usepackage[lot]{multitoc} +\usepackage{fontspec} +\setmainfont{Old Standard}[RawFeature={+ss05;+ss06}] +\usepackage{newunicodechar} +\newunicodechar{ǧ}{ǧ} % Old Standard does not include ǧ/Ǧ +\newunicodechar{Ǧ}{Ǧ} % +\usepackage{relsize} +\usepackage{units} +\usepackage{minted} +\usepackage[contents]{colordoc} +\newcommand{\package}[1]{\textsf{#1}\index{#1=#1 (package)}} +\usepackage{tikz} +\usepackage[breakable, skins, xparse, minted]{tcolorbox} +\tcbset{colback=white, boxrule=.15mm, colframe=red!50!white, left=6mm, + breakable} +\usepackage{etoc} +\etocsettocdepth{paragraph} +\newcommand{\icitetableofcontents}{% + \begingroup + \etocsetstyle{section}{}{} + {\etocsavedsectiontocline{% + \numberline{\etocnumber}\etocname}{\etocpage}}{} + \etocsetstyle{subsection}{}{} + {\etocsavedsubsectiontocline{% + \numberline{\etocnumber}\etocname}{\etocpage}}{}% + \etocsetstyle{subsubsection}{}{} + {\etocsavedsubsubsectiontocline{% + \numberline{\etocnumber}\etocname}{\etocpage}}{}% + \etocsetstyle{paragraph}{}{\leftskip2cm\rightskip 2.2em \parfillskip + 0pt plus 1fil\relax \nobreak} + {\noindent\etocname{} \etocpage{} }{\par}% + \etocmulticolstyle[2]{\section*{Contents}} + \pdfbookmark[1]{Contents}{toc} + \tableofcontents + \endgroup} \EnableCrossrefs \CodelineIndex \RecordChanges +%\OnlyDescription \begin{document} \DocInput{\jobname.dtx} + \PrintChanges + \PrintIndex \end{document} % % \fi @@ -107,13 +168,22 @@ Running "make install" installs the files in the local TeX tree. % \GetFileInfo{\jobname.dtx} % \DoNotIndex{\newcommand,\newenvironment} % -%\title{\textsf{icite} --- Make Indices locorum citatorum\thanks{This file -% describes version \fileversion, last revised \filedate.} -%} -%\author{Robert Alessi\thanks{E-mail: alessi@robertalessi.net}} -%\date{Released \filedate} +% \title{\tcbox[colframe=black, enhanced, tikznode, drop lifted +% shadow, colback=white, boxrule=.25mm]{% +% The \textsf{icite} package\\ +% \emph{Indices locorum citatorum}\\ +% \fileversion\ --- \filedate}} +% +% \author{Robert Alessi \\ +% \href{mailto:alessi@robertalessi.net?Subject=icite package}% +% {\texttt{alessi@robertalessi.net}}} +% +% \date{} % -%\maketitle +% \maketitle +% \footnotesize +% \icitetableofcontents +% \normalsize % %\changes{v1.00}{2019/02/22}{First public release} % @@ -130,54 +200,76 @@ Running "make install" installs the files in the local TeX tree. % example. If this were a real macro, you would put a paragraph here % describing what the macro is supposed to do, what its mandatory and % optional arguments are, and so forth. -% % \DescribeEnv{dummyEnv} % This environment does nothing. It is merely an example. % If this were a real environment, you would put a paragraph here % describing what the environment is supposed to do, what its % mandatory and optional arguments are, and so forth. +%\iffalse +%<*example> +%\fi +\begin{tcblisting}{minted options=linenos} + \emph{tchic} +\end{tcblisting} +%\iffalse +% +%\fi +%\iffalse +%<*example> +%\fi +\begin{tcblisting}{minted options=linenos, listing only} +\vroum[tchic]{tchic} +\end{tcblisting} +%\iffalse +% +%\fi % -%\StopEventually{^^A -% \PrintChanges -% \PrintIndex -%} +%\StopEventually{} % % \section{Implementation} % -% \begin{macrocode} +% \iffalse %<*package> - +% \fi +% Declare the global options, and define them: +% \begin{macrocode} +\RequirePackage{xkeyval} +\DeclareOptionX{citecmd}[cite]{\def\ic@dfltcit{#1}} +\ExecuteOptionsX{citecmd} +\ProcessOptionsX\relax % \end{macrocode} -% \begin{macro}{\dummyMacro} -% This is a dummy macro. If it did anything, we'd describe its -% implementation here. +% The following packages are required by \package{icite}: % \begin{macrocode} -\newcommand{\dummyMacro}{} +\RequirePackage{xparse} +\RequirePackage{usebib} % \end{macrocode} -% \end{macro} -% -% \begin{environment}{dummyEnv} -% This is a dummy environment. If it did anything, we'd describe its -% implementation here. +% Define fields to be used by \package{icite}: % \begin{macrocode} -\newenvironment{dummyEnv}{% -}{% +\define@reuse@key{author} +\define@reuse@key{title} % \end{macrocode} -% \changes{v1.00a}{2019/02/22}{Added a spurious change log entry to -% show what a change \emph{within} an environment definition looks -% like.} -% Don't use |%| to introduce a code comment within a |macrocode| -% environment. Instead, you should typeset all of your comments with -% LaTeX---doing so gives much prettier results. For comments within a -% macro/environment body, just do an |\end{macrocode}|, include some -% commentary, and do another |\begin{macrocode}|. It's that simple. +% This is the same as \cs{usebibentry} from \package{ebib}, but it +% does not return an error if the entry field is not found: % \begin{macrocode} -} +\def\get@bibentry#1#2{\@ifundefined{reuse@#1@#2}{} + {\@nameuse{reuse@#1@#2}}} % \end{macrocode} -% \end{environment} -% +% \DescribeMacro{\icite} % \begin{macrocode} -\endinput -% +\NewDocumentCommand{\icite}{o o m O{\ic@dfltcit}}{% + \IfNoValueTF{#1} + {\index{\get@bibentry{#3}{author}!\emph{\get@bibentry{#3}{title}}}% + \csname #4\endcsname{#3}} + {\IfNoValueTF{#2} + {\index{\get@bibentry{#3}{author}!\emph{\get@bibentry{#3}{title}}!#1}% + \csname #4\endcsname[{#1}]{#3}} + {\index{\get@bibentry{#3}{author}!\emph{\get@bibentry{#3}{title}}!#2}% + \csname #4\endcsname[#1][{#2}]{#3}} + } +} % \end{macrocode} +% \iffalse +% +% \fi %\Finale +\endinput \ No newline at end of file -- cgit v1.2.3