aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Alessi <alessi@robertalessi.net>2019-02-24 10:55:09 +0100
committerRobert Alessi <alessi@robertalessi.net>2019-02-24 10:55:09 +0100
commit2c38c4359a6f5653a2fdbfcebe128256f23dfee1 (patch)
tree4303bd7b5bd4edcd7f9e2f0959d44979ac0c64a4
parentc5bea9766e3cd202e8aa1f4c790b8ac53ff81cba (diff)
downloadicite-2c38c4359a6f5653a2fdbfcebe128256f23dfee1.tar.gz
adapted Makefile. first lines of .sty file
-rw-r--r--Makefile41
-rw-r--r--icite.dtx192
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)
7all: $(NAME).pdf 7all: $(NAME).pdf
8 test -e README.txt && mv README.txt README || exit 0 8 test -e README.txt && mv README.txt README || exit 0
9$(NAME).pdf: $(NAME).dtx 9$(NAME).pdf: $(NAME).dtx
10 pdflatex -shell-escape -recorder -interaction=batchmode $(NAME).dtx >/dev/null 10 lualatex --shell-escape --recorder --interaction=batchmode $(NAME).dtx >/dev/null
11 if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi 11 if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi
12 if [ -f $(NAME).idx ]; then makeindex -q -s gind.ist -o $(NAME).ind $(NAME).idx; fi 12 if [ -f $(NAME).idx ]; then makeindex -q -s gind.ist -o $(NAME).ind $(NAME).idx; fi
13 pdflatex --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null 13 lualatex --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null
14 pdflatex --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null 14 lualatex --shell-escape --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null
15clean: 15clean:
16 rm -f $(NAME).{aux,fls,glo,gls,hd,idx,ilg,ind,ins,log,out} 16 rm -f $(NAME).{aux,fls,glo,gls,hd,idx,ilg,ind,ins,log,out,toc,listing}
17distclean: clean 17 rm -f *~
18 rm -rf auto/
19distclean: clean uninst
20 rm -rf _minted-*
18 rm -f $(NAME).{pdf,sty} README 21 rm -f $(NAME).{pdf,sty} README
19inst: all 22 rm -f *.zip *.tar.gz
23inst: uninst all
20 mkdir -p $(UTREE)/{tex,source,doc}/latex/$(NAME) 24 mkdir -p $(UTREE)/{tex,source,doc}/latex/$(NAME)
21 cp $(NAME).dtx $(UTREE)/source/latex/$(NAME) 25 cp $(NAME).dtx $(UTREE)/source/latex/$(NAME)
22 cp $(NAME).sty $(UTREE)/tex/latex/$(NAME) 26 cp $(NAME).sty $(UTREE)/tex/latex/$(NAME)
23 cp $(NAME).pdf $(UTREE)/doc/latex/$(NAME) 27 cp $(NAME).pdf $(UTREE)/doc/latex/$(NAME)
24install: all 28uninst:
25 sudo mkdir -p $(LOCAL)/{tex,source,doc}/latex/$(NAME) 29 rm -rf $(UTREE)/{tex,source,doc}/latex/$(NAME)
26 sudo cp $(NAME).dtx $(LOCAL)/source/latex/$(NAME) 30#install: all
27 sudo cp $(NAME).sty $(LOCAL)/tex/latex/$(NAME) 31# sudo mkdir -p $(LOCAL)/{tex,source,doc}/latex/$(NAME)
28 sudo cp $(NAME).pdf $(LOCAL)/doc/latex/$(NAME) 32# sudo cp $(NAME).dtx $(LOCAL)/source/latex/$(NAME)
33# sudo cp $(NAME).sty $(LOCAL)/tex/latex/$(NAME)
34# sudo cp $(NAME).pdf $(LOCAL)/doc/latex/$(NAME)
29zip: all 35zip: all
30 ln -sf . $(NAME) 36 ln -sf . $(NAME)
31 zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)/{README,$(NAME).{pdf,dtx}} 37 zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)/{README,$(NAME).{pdf,dtx}}
32 rm $(NAME) 38 rm $(NAME)
39package: distclean all
40 mkdir $(NAME)/
41 cp README *.dtx *.pdf $(NAME)/
42 mkdir -p tex/latex/$(NAME)/
43 cp *.sty tex/latex/$(NAME)/
44 mkdir -p doc/latex/$(NAME)/
45 cp *.pdf doc/latex/$(NAME)/
46 mkdir -p source/latex/$(NAME)/
47 cp Makefile *.dtx source/latex/$(NAME)/
48 zip -r $(NAME).tds.zip tex doc source
49 rm -rf tex/ source/ doc/
50 tar czf $(NAME)-$(VERS).tar.gz $(NAME).tds.zip $(NAME)/
51 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 @@
9 icite:| Make Indices locorum citatorum 9 icite:| Make Indices locorum citatorum
10 Author:| Robert Alessi 10 Author:| Robert Alessi
11 E-mail:| alessi@robertalessi.net 11 E-mail:| alessi@robertalessi.net
12License:| Released under the LaTeX Project Public License v1.3c or later 12License:| Released under the GNU General Public License v3 or later
13 See:| http://www.latex-project.org/lppl.txt 13 See:| http://www.gnu.org/licenses/
14 14
15 15
16Short description: 16Short description:
@@ -32,23 +32,30 @@ Some text about the package: probably the same as the abstract.
32 icite:| Make Indices locorum citatorum 32 icite:| Make Indices locorum citatorum
33 Author:| Robert Alessi 33 Author:| Robert Alessi
34 E-mail:| alessi@robertalessi.net 34 E-mail:| alessi@robertalessi.net
35License:| Released under the LaTeX Project Public License v1.3c or later 35License:| Released under the GNU General Public License v3 or later
36 See:| http://www.latex-project.org/lppl.txt 36 See:| http://www.gnu.org/licenses/
37 37
38\endpreamble 38\endpreamble
39\postamble 39\postamble
40 40
41Copyright (C) 2019 by Robert Alessi <alessi@robertalessi.net> 41Copyright (C) 2019 by Robert Alessi <alessi@robertalessi.net>
42 42
43This work may be distributed and/or modified under the 43Please send error reports and suggestions for improvements to Robert
44conditions of the LaTeX Project Public License (LPPL), either 44Alessi <alessi@robertalessi.net>
45version 1.3c of this license or (at your option) any later
46version. The latest version of this license is in the file:
47 45
48http://www.latex-project.org/lppl.txt 46This program is free software: you can redistribute it and/or modify
47it under the terms of the GNU General Public License as published by
48the Free Software Foundation, either version 3 of the License, or
49(at your option) any later version.
49 50
50This work is "maintained" (as per LPPL maintenance status) by 51This program is distributed in the hope that it will be useful, but
51Robert Alessi. 52WITHOUT ANY WARRANTY; without even the implied warranty of
53MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
54General Public License for more details.
55
56You should have received a copy of the GNU General Public License
57along with this program. If not, see
58<http://www.gnu.org/licenses/>.
52 59
53This work consists of the file icite.dtx and a Makefile. 60This work consists of the file icite.dtx and a Makefile.
54Running "make" generates the derived files README, icite.pdf and icite.sty. 61Running "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.
92%</package> 99%</package>
93%<*driver> 100%<*driver>
94\documentclass{ltxdoc} 101\documentclass{ltxdoc}
95\usepackage[a4paper,margin=25mm,left=50mm,nohead]{geometry} 102\usepackage[letterpaper,margin=25mm,left=50mm,nohead]{geometry}
96\usepackage[numbered]{hypdoc}
97\usepackage{\jobname} 103\usepackage{\jobname}
104\usepackage{metalogox}
105\usepackage{hyperxmp}
106\usepackage{uri}
107\usepackage[numbered]{hypdoc}
108\hypersetup{unicode=true, colorlinks, allcolors=blue,
109 linktocpage=true, pdfauthor={Robert Alessi}, pdftitle={The
110 icite package}, pdfcontactemail={alessi@robertalessi.net},
111 pdfcontacturl={http://www.robertalessi.net/ekdosis},
112 pdfcopyright={Copyright (C) 2018 Robert Alessi
113 <alessi@robertalessi.net>. This document is licensed under the
114 Creative Commons Attribution-ShareAlike 4.0 International
115 License. To view a copy of this license, visit
116 http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to
117 Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.},
118 pdflicenseurl={https://creativecommons.org/licenses/by-sa/4.0/legalcode},
119 pdfmetalang={en-US}, pdftype={Text}, pdfkeywords={bibtex, biblatex,
120 indexing}}
121\usepackage[lot]{multitoc}
122\usepackage{fontspec}
123\setmainfont{Old Standard}[RawFeature={+ss05;+ss06}]
124\usepackage{newunicodechar}
125\newunicodechar{ǧ}{ǧ} % Old Standard does not include ǧ/Ǧ
126\newunicodechar{Ǧ}{Ǧ} %
127\usepackage{relsize}
128\usepackage{units}
129\usepackage{minted}
130\usepackage[contents]{colordoc}
131\newcommand{\package}[1]{\textsf{#1}\index{#1=#1 (package)}}
132\usepackage{tikz}
133\usepackage[breakable, skins, xparse, minted]{tcolorbox}
134\tcbset{colback=white, boxrule=.15mm, colframe=red!50!white, left=6mm,
135 breakable}
136\usepackage{etoc}
137\etocsettocdepth{paragraph}
138\newcommand{\icitetableofcontents}{%
139 \begingroup
140 \etocsetstyle{section}{}{}
141 {\etocsavedsectiontocline{%
142 \numberline{\etocnumber}\etocname}{\etocpage}}{}
143 \etocsetstyle{subsection}{}{}
144 {\etocsavedsubsectiontocline{%
145 \numberline{\etocnumber}\etocname}{\etocpage}}{}%
146 \etocsetstyle{subsubsection}{}{}
147 {\etocsavedsubsubsectiontocline{%
148 \numberline{\etocnumber}\etocname}{\etocpage}}{}%
149 \etocsetstyle{paragraph}{}{\leftskip2cm\rightskip 2.2em \parfillskip
150 0pt plus 1fil\relax \nobreak}
151 {\noindent\etocname{} \etocpage{} }{\par}%
152 \etocmulticolstyle[2]{\section*{Contents}}
153 \pdfbookmark[1]{Contents}{toc}
154 \tableofcontents
155 \endgroup}
98\EnableCrossrefs 156\EnableCrossrefs
99\CodelineIndex 157\CodelineIndex
100\RecordChanges 158\RecordChanges
159%\OnlyDescription
101\begin{document} 160\begin{document}
102 \DocInput{\jobname.dtx} 161 \DocInput{\jobname.dtx}
162 \PrintChanges
163 \PrintIndex
103\end{document} 164\end{document}
104%</driver> 165%</driver>
105% \fi 166% \fi
@@ -107,13 +168,22 @@ Running "make install" installs the files in the local TeX tree.
107% \GetFileInfo{\jobname.dtx} 168% \GetFileInfo{\jobname.dtx}
108% \DoNotIndex{\newcommand,\newenvironment} 169% \DoNotIndex{\newcommand,\newenvironment}
109% 170%
110%\title{\textsf{icite} --- Make Indices locorum citatorum\thanks{This file 171% \title{\tcbox[colframe=black, enhanced, tikznode, drop lifted
111% describes version \fileversion, last revised \filedate.} 172% shadow, colback=white, boxrule=.25mm]{%
112%} 173% The \textsf{icite} package\\
113%\author{Robert Alessi\thanks{E-mail: alessi@robertalessi.net}} 174% \emph{Indices locorum citatorum}\\
114%\date{Released \filedate} 175% \fileversion\ --- \filedate}}
176%
177% \author{Robert Alessi \\
178% \href{mailto:alessi@robertalessi.net?Subject=icite package}%
179% {\texttt{alessi@robertalessi.net}}}
180%
181% \date{}
115% 182%
116%\maketitle 183% \maketitle
184% \footnotesize
185% \icitetableofcontents
186% \normalsize
117% 187%
118%\changes{v1.00}{2019/02/22}{First public release} 188%\changes{v1.00}{2019/02/22}{First public release}
119% 189%
@@ -130,54 +200,76 @@ Running "make install" installs the files in the local TeX tree.
130% example. If this were a real macro, you would put a paragraph here 200% example. If this were a real macro, you would put a paragraph here
131% describing what the macro is supposed to do, what its mandatory and 201% describing what the macro is supposed to do, what its mandatory and
132% optional arguments are, and so forth. 202% optional arguments are, and so forth.
133%
134% \DescribeEnv{dummyEnv} 203% \DescribeEnv{dummyEnv}
135% This environment does nothing. It is merely an example. 204% This environment does nothing. It is merely an example.
136% If this were a real environment, you would put a paragraph here 205% If this were a real environment, you would put a paragraph here
137% describing what the environment is supposed to do, what its 206% describing what the environment is supposed to do, what its
138% mandatory and optional arguments are, and so forth. 207% mandatory and optional arguments are, and so forth.
208%\iffalse
209%<*example>
210%\fi
211\begin{tcblisting}{minted options=linenos}
212 \emph{tchic}
213\end{tcblisting}
214%\iffalse
215%</example>
216%\fi
217%\iffalse
218%<*example>
219%\fi
220\begin{tcblisting}{minted options=linenos, listing only}
221\vroum[tchic]{tchic}
222\end{tcblisting}
223%\iffalse
224%</example>
225%\fi
139% 226%
140%\StopEventually{^^A 227%\StopEventually{}
141% \PrintChanges
142% \PrintIndex
143%}
144% 228%
145% \section{Implementation} 229% \section{Implementation}
146% 230%
147% \begin{macrocode} 231% \iffalse
148%<*package> 232%<*package>
149 233% \fi
234% Declare the global options, and define them:
235% \begin{macrocode}
236\RequirePackage{xkeyval}
237\DeclareOptionX{citecmd}[cite]{\def\ic@dfltcit{#1}}
238\ExecuteOptionsX{citecmd}
239\ProcessOptionsX\relax
150% \end{macrocode} 240% \end{macrocode}
151% \begin{macro}{\dummyMacro} 241% The following packages are required by \package{icite}:
152% This is a dummy macro. If it did anything, we'd describe its
153% implementation here.
154% \begin{macrocode} 242% \begin{macrocode}
155\newcommand{\dummyMacro}{} 243\RequirePackage{xparse}
244\RequirePackage{usebib}
156% \end{macrocode} 245% \end{macrocode}
157% \end{macro} 246% Define fields to be used by \package{icite}:
158%
159% \begin{environment}{dummyEnv}
160% This is a dummy environment. If it did anything, we'd describe its
161% implementation here.
162% \begin{macrocode} 247% \begin{macrocode}
163\newenvironment{dummyEnv}{% 248\define@reuse@key{author}
164}{% 249\define@reuse@key{title}
165% \end{macrocode} 250% \end{macrocode}
166% \changes{v1.00a}{2019/02/22}{Added a spurious change log entry to 251% This is the same as \cs{usebibentry} from \package{ebib}, but it
167% show what a change \emph{within} an environment definition looks 252% does not return an error if the entry field is not found:
168% like.}
169% Don't use |%| to introduce a code comment within a |macrocode|
170% environment. Instead, you should typeset all of your comments with
171% LaTeX---doing so gives much prettier results. For comments within a
172% macro/environment body, just do an |\end{macrocode}|, include some
173% commentary, and do another |\begin{macrocode}|. It's that simple.
174% \begin{macrocode} 253% \begin{macrocode}
175} 254\def\get@bibentry#1#2{\@ifundefined{reuse@#1@#2}{}
255 {\@nameuse{reuse@#1@#2}}}
176% \end{macrocode} 256% \end{macrocode}
177% \end{environment} 257% \DescribeMacro{\icite}
178%
179% \begin{macrocode} 258% \begin{macrocode}
180\endinput 259\NewDocumentCommand{\icite}{o o m O{\ic@dfltcit}}{%
181%</package> 260 \IfNoValueTF{#1}
261 {\index{\get@bibentry{#3}{author}!\emph{\get@bibentry{#3}{title}}}%
262 \csname #4\endcsname{#3}}
263 {\IfNoValueTF{#2}
264 {\index{\get@bibentry{#3}{author}!\emph{\get@bibentry{#3}{title}}!#1}%
265 \csname #4\endcsname[{#1}]{#3}}
266 {\index{\get@bibentry{#3}{author}!\emph{\get@bibentry{#3}{title}}!#2}%
267 \csname #4\endcsname[#1][{#2}]{#3}}
268 }
269}
182% \end{macrocode} 270% \end{macrocode}
271% \iffalse
272%</package>
273% \fi
183%\Finale 274%\Finale
275\endinput \ No newline at end of file