| 1 |
% Copyright (C) 2020 Eduardo C. Lourenço de Lima |
| 2 |
% |
| 3 |
% This work may be distributed and/or modified under the |
| 4 |
% conditions of the LaTeX Project Public License, either |
| 5 |
% version 1.3 of this license or (at your option) any later |
| 6 |
% version. The latest version of this license is in |
| 7 |
% |
| 8 |
% http://www.latex-project.org/lppl.txt |
| 9 |
% |
| 10 |
% and version 1.3 or later is part of all distributions of LaTeX |
| 11 |
% version 2005/12/01 or later. |
| 12 |
\documentclass{ltxdoc} |
| 13 |
|
| 14 |
\newcommand\fileversion{0.1a} |
| 15 |
\newcommand\filedate{February 3, 2020} |
| 16 |
|
| 17 |
\usepackage{color} |
| 18 |
\usepackage{classics} |
| 19 |
|
| 20 |
\newpagination \books {book} {books} { and } |
| 21 |
\newpagination \parts {part} {parts} { and } |
| 22 |
\newpagination \sections {section} {sections} { and } |
| 23 |
\newpagination \lines {line} {lines} { and } |
| 24 |
|
| 25 |
\newclassic[ to ]{Homer} {\books{\classicsRoman{#1}}|, \lines{#1}} |
| 26 |
\newclassic{Plato} {#1|#1|#1} |
| 27 |
\newclassic{Aristotle} {#1|\textit{#1}|#1} |
| 28 |
\newclassic{Stephanus} {#1|\textit{#1}|#1} |
| 29 |
\newclassic{Bekker} {#1|\textit{#1}|#1} |
| 30 |
\newclassic{Hume} {#1|.#1|.#1} |
| 31 |
\newclassic{HumeExample} {\books{#1}|, \parts{#1}|, \sections{#1}} |
| 32 |
\newclassic{HomerExample} {\books{\classicsRoman{#1}}|, \lines{#1}} |
| 33 |
|
| 34 |
\definecolor{myblue}{rgb}{0,0.2,0.6} |
| 35 |
|
| 36 |
\newenvironment {Macros} {\begin{list}{}{\setlength\itemsep{0pt}\setlength\leftmargin{0pt}}}{\end{list}} |
| 37 |
\newcommand\Macro [2] {\item[\llap{\textsf{\color{myblue}\texttt{\char92}#1}}]#2} |
| 38 |
\newcommand\MacroExample [2] {\item[\llap{\textsf{\texttt{\char92}#1}}]#2} |
| 39 |
\newcommand\Note {\par\textbf{Note:} } |
| 40 |
\newcommand\etc {\mbox{etc.}} |
| 41 |
\newcommand\work [1] {\textit{#1}} |
| 42 |
\newcommand\badcite [1] {\begingroup(\frenchspacing #1)\endgroup} |
| 43 |
|
| 44 |
\begin{document} |
| 45 |
\title{The \textsf{\color{myblue} classics} package,\thanks{This document |
| 46 |
corresponds to \textsf{classics}~\fileversion, dated~\filedate. I am grateful |
| 47 |
to Joseph Wright, Scott \mbox{H.}, and Robert Alessi for suggestions.}\\{or the end of |
| 48 |
anachronism}} |
| 49 |
\author{Eduardo C. Louren\c{c}o de Lima \\ \texttt{[email protected]}} |
| 50 |
\maketitle |
| 51 |
|
| 52 |
|
| 53 |
\begin{abstract}\noindent This package provides a basic framework to |
| 54 |
cite classic works in accordance with traditional pagination systems. |
| 55 |
It may be used in conjunction with other citation |
| 56 |
packages.\end{abstract} |
| 57 |
|
| 58 |
\section*{Introduction} |
| 59 |
|
| 60 |
If you feel there is something wrong with ``Plato \badcite{1994: pp. 50--1}'', |
| 61 |
``Aristotle \badcite{\work{Ethics}, 44}'' or ``Hume \badcite{2000: 303}'', this |
| 62 |
package is for you. The |classics| package provides a basic framework to cite |
| 63 |
classic works in compliance with traditional pagination systems. For example: |
| 64 |
\begin{list}{}{\setlength\itemsep{0pt}\setlength\parskip{0pt}} |
| 65 |
\item[]\Stephanus [Theaetetus] {142}[d][4--5] |
| 66 |
\item[]\Bekker* [Nic. Eth.] {1179}[b][14]{1180}[a][29] |
| 67 |
\item[]\Hume[THN]{3}[1][2] |
| 68 |
\end{list} |
| 69 |
Citation commands created by |classics| can also be used in conjunction with |
| 70 |
other citations engines such as standard |\cite|, |biblatex|, |natbib|, \etc |
| 71 |
|
| 72 |
\section{Synopsis} |
| 73 |
|
| 74 |
|
| 75 |
\begin{Macros} |
| 76 |
\Macro{newclassic}{\oarg{range separator} \marg{classic} \marg{list of formatting directives}} |
| 77 |
\Macro{|<|classic|>| }{\oarg{work} \marg{page} \oarg{section}} |
| 78 |
\Macro{|<|classic|>*|}{\oarg{work} \marg{page} \oarg{section} \marg{last page} \oarg{section}} |
| 79 |
\Macro{newpagination}{\marg{pagination} \marg{singular} \marg{plural} \marg{conjunction}} |
| 80 |
\Macro{|<|pagination|>|}{\marg{range}} |
| 81 |
\Macro{DeclareClassicWorkFormat}{\marg{formatting directive}} |
| 82 |
|
| 83 |
\end{Macros} |
| 84 |
|
| 85 |
\newpage |
| 86 |
|
| 87 |
\section{Basic usage} |
| 88 |
|
| 89 |
\setlength\parindent{0pt} |
| 90 |
\setlength\parskip{1ex} |
| 91 |
|
| 92 |
\begin{Macros} |
| 93 |
\Macro{newclassic}{\oarg{range separator} \marg{classic} \marg{list of formatting directives}} |
| 94 |
\end{Macros} |
| 95 |
|
| 96 |
Creates a citation command |\|\meta{classic} based on a \meta{list of |
| 97 |
formatting directives} separated by vertical bars. Each formatting directive |
| 98 |
has its own |#1| and is used to declare the format in which to typeset the |
| 99 |
reference to a subdivision of a classic work. There can be at most six such |
| 100 |
directives. As an example: |
| 101 |
|
| 102 |
\begin{verbatim}\newclassic {Aristotle} {#1|\textit{#1}|#1}\end{verbatim} |
| 103 |
would create a new citation command |\Aristotle|: |
| 104 |
|
| 105 |
\begin{Macros} |
| 106 |
\MacroExample{Aristotle}{\oarg{work} \marg{page} \oarg{column} \oarg{line}} |
| 107 |
\MacroExample{Aristotle*}{\oarg{work} \marg{page} \oarg{column} \oarg{line} \marg{last page} \oarg{column} \oarg{line}} |
| 108 |
\end{Macros} |
| 109 |
to typeset references in which letters for \meta{column} are printed in italic |
| 110 |
type. The starred version |\Aristotle*| is used to cite a range of two pages |
| 111 |
separated by \meta{range separator}. |
| 112 |
|
| 113 |
\Note |\Aristotle*| will not typeset \meta{last page} if \meta{page} and |
| 114 |
\meta{last page} are the same. However, \meta{last page} will be preserved if |
| 115 |
|\Aristotle*| is created by the starred version |\newclassic*|. |
| 116 |
|
| 117 |
\begin{Macros} |
| 118 |
\Macro{newpagination} \marg{pagination} \marg{singular} \marg{plural} \marg{conjunction} |
| 119 |
\end{Macros} |
| 120 |
|
| 121 |
Creates a command \meta{pagination} to typeset \meta{singular} or \meta{plural} |
| 122 |
depending on whether subsequent arguments to \meta{pagination} are |
| 123 |
singular or plural. As an example: |
| 124 |
|
| 125 |
\begin{verbatim}\newpagination {\pages} {page} {pages} { and }\end{verbatim} |
| 126 |
would create the command |\pages|: |
| 127 |
\begin{Macros} |
| 128 |
\MacroExample{pages} \marg{range} |
| 129 |
\end{Macros} |
| 130 |
|
| 131 |
that automatically typesets |page| \meta{range} if \meta{range} is singular, or |
| 132 |
|pages| \meta{range} if \meta{range} is plural, that is, if it contains a |
| 133 |
comma, a hyphen, a dash, or \meta{conjunction}. |
| 134 |
|
| 135 |
{\Note} \meta{conjunction} might need to be enclosed in spaces. |
| 136 |
|
| 137 |
\begin{Macros} |
| 138 |
\Macro{DeclareClassicWorkFormat}{\marg{formatting directive}} |
| 139 |
\end{Macros} |
| 140 |
Defines the format to typeset classic titles in. The default \meta{formatting directive} is |\textit{#1}|. |
| 141 |
|
| 142 |
\newpage |
| 143 |
|
| 144 |
\begin{Macros} |
| 145 |
\Macro{classicsalph}{\marg{integer}} |
| 146 |
\Macro{classicsAlph}{\marg{integer}} |
| 147 |
\Macro{classicsroman}{\marg{integer}} |
| 148 |
\Macro{classicsRoman}{\marg{integer}} |
| 149 |
\end{Macros} |
| 150 |
|
| 151 |
These commands may come in handy if you want to typeset a subdivision as a |
| 152 |
letter or Roman numeral, lowercase or uppercase. |
| 153 |
|
| 154 |
\section{Advanced usage} |
| 155 |
|
| 156 |
\begingroup |
| 157 |
\DeclareClassicWorkFormat{\textit{#1},} |
| 158 |
|
| 159 |
You may combine |\newclassic| and |\newpagination| to create complex |
| 160 |
citation styles. For example: |
| 161 |
\begin{Macros} |
| 162 |
\Macro{Hume}{\oarg{work} \marg{book} \oarg{part} \oarg{section}} |
| 163 |
\end{Macros} |
| 164 |
can be created by: |
| 165 |
\begin{verbatim} |
| 166 |
\DeclareClassicWorkFormat{\textit{#1},} |
| 167 |
\newpagination {\books} {book} {books} { and } |
| 168 |
\newpagination {\parts} {part} {parts} { and } |
| 169 |
\newpagination {\sections} {section} {sections} { and } |
| 170 |
\newclassic {Hume} {\books{#1}|, \parts{#1}|, \sections{#1}} |
| 171 |
\end{verbatim} |
| 172 |
so that: \begin{verbatim}\Hume[Treatise]{3}[1][2]\end{verbatim}would typeset |
| 173 |
``\HumeExample[Treatise]{3}[1][2]''. |
| 174 |
|
| 175 |
\begin{Macros} |
| 176 |
\Macro{Homer}{\oarg{work} \marg{book} \oarg{lines}} |
| 177 |
\end{Macros} |
| 178 |
can be created by: |
| 179 |
|
| 180 |
\begin{verbatim} |
| 181 |
\DeclareClassicWorkFormat{\textit{#1},} |
| 182 |
\newpagination {\books} {book} {books} { and } |
| 183 |
\newpagination {\lines} {line} {lines} { and } |
| 184 |
\newclassic {Homer} {\books{\classicsRoman{#1}}|, \lines{#1}} |
| 185 |
\end{verbatim} |
| 186 |
so that: |
| 187 |
\begin{verbatim}\Homer[Odyssey]{3}[100--2]\end{verbatim} |
| 188 |
will typeset: ``\HomerExample[Odyssey]{3}[100--2]''. |
| 189 |
\endgroup |
| 190 |
|
| 191 |
|
| 192 |
\subsection{Caveat} |
| 193 |
|
| 194 |
Citation styles created by the |classics| package can also be used in |
| 195 |
conjunction with standard |\cite|, |biblatex|, |natbib|, \etc |
| 196 |
|
| 197 |
A simple |classics| pagination command created by |\newpagination| can be used |
| 198 |
directly within the optional argument to |\cite|: |
| 199 |
|
| 200 |
\begin{Macros} |
| 201 |
\Macro{cite} |[\pages|\marg{number}|]| \marg{key} |
| 202 |
\end{Macros} |
| 203 |
|
| 204 |
However, a complex |classics| citation command created by |\newclassic| can be |
| 205 |
used within the optional argument to |\cite| only if it is enclosed in braces. |
| 206 |
|
| 207 |
\begin{Macros} |
| 208 |
\Macro{cite} |[{\Homer|\marg{book}\oarg{line}|}]| \marg{key} |
| 209 |
\end{Macros} |
| 210 |
|
| 211 |
For example: |
| 212 |
\begin{verbatim} |
| 213 |
\documentclass{article} |
| 214 |
\usepackage{classics} |
| 215 |
\newclassic{Homer}{#1|:#1} |
| 216 |
\begin{document} |
| 217 |
|
| 218 |
\cite[{\Homer{3}[100--2]}]{Odyssey} |
| 219 |
|
| 220 |
\begin{thebibliography}{10} |
| 221 |
\bibitem[Od.]{Odyssey} Homer. \textit{Odyssey}. |
| 222 |
\end{thebibliography} |
| 223 |
|
| 224 |
\end{document} |
| 225 |
\end{verbatim} |
| 226 |
|
| 227 |
|
| 228 |
|
| 229 |
\section{Examples} |
| 230 |
|
| 231 |
\begingroup |
| 232 |
\setlength\parindent{0pt} |
| 233 |
\small |
| 234 |
|
| 235 |
\subsection{Plato} |
| 236 |
|
| 237 |
|
| 238 |
\verb=\newclassic{Plato}{#1|#1|#1}= |
| 239 |
|
| 240 |
|\Plato {142}[a] |\Plato {142}[a]\par |
| 241 |
|\Plato {142}[a][3] |\Plato {142}[a][3]\par |
| 242 |
|\Plato {142}[a][3--4] |\Plato {142}[a][3--4]\par |
| 243 |
|\Plato*{142}[a][3]{142}[b] |\Plato* {142}[a][3]{142}[b]\par |
| 244 |
|\Plato*{142}[a][3]{142}[b][4] |\Plato* {142}[a][3]{142}[b][4]\par |
| 245 |
|\Plato*{142}[a][3]{143}[b] |\Plato* {142}[a][3]{143}[b]\par |
| 246 |
|\Plato*{142}[a][3]{143}[b][4] |\Plato* {142}[a][3]{143}[b][4]\par |
| 247 |
|\Plato [Theaet.]{142}[a][3] |\Plato [Theaet.]{142}[a][3]\par |
| 248 |
|\Plato*[Theaet.]{142}[a][3]{143}[b][4] |\Plato* [Theaet.]{142}[a][3]{143}[b][4]\par |
| 249 |
|
| 250 |
\subsection{Aristotle} |
| 251 |
|
| 252 |
\verb=\newclassic {Aristotle} {#1|\textit{#1}|#1}=\par\medskip |
| 253 |
|
| 254 |
|\Aristotle {185} |\Aristotle {185}\par |
| 255 |
|\Aristotle {185}[a] |\Aristotle {185}[a]\par |
| 256 |
|\Aristotle* {185}[a]{185}[b] |\Aristotle* {185}[a]{185}[b]\par |
| 257 |
|\Aristotle* {185}[a]{185}[b][2] |\Aristotle* {185}[a]{185}[b][2]\par |
| 258 |
|\Aristotle* {185}[a]{186} |\Aristotle* {185}[a]{186}\par |
| 259 |
|\Aristotle* {185}[a]{186}[a] |\Aristotle* {185}[a]{186}[a]\par |
| 260 |
|\Aristotle* {185}[a]{186}[a][3] |\Aristotle* {185}[a]{186}[a][3]\par |
| 261 |
|\Aristotle [Phys.]{} |\Aristotle [Phys.]{}\par |
| 262 |
|\Aristotle [Phys.]{185} |\Aristotle [Phys.]{185}\par |
| 263 |
|\Aristotle [Phys.]{185}[a] |\Aristotle [Phys.]{185}[a]\par |
| 264 |
|\Aristotle*[Phys.]{185}[a]{185}[b] |\Aristotle*[Phys.]{185}[a]{185}[b]\par |
| 265 |
|\Aristotle*[Phys.]{185}[a]{185}[b][2] |\Aristotle*[Phys.]{185}[a]{185}[b][2]\par |
| 266 |
|\Aristotle*[Phys.]{185}[a]{186} |\Aristotle*[Phys.]{185}[a]{186}\par |
| 267 |
|\Aristotle*[Phys.]{185}[a]{186}[a] |\Aristotle*[Phys.]{185}[a]{186}[a]\par |
| 268 |
|\Aristotle*[Phys.]{185}[a]{186}[a][3] |\Aristotle*[Phys.]{185}[a]{186}[a][3]\par |
| 269 |
|\Aristotle*[Phys.]{185}[a]{186}[a][3--5] |\Aristotle*[Phys.]{185}[a]{186}[a][3--5]\par |
| 270 |
|\Aristotle [Phys.]{185}[a][10] |\Aristotle [Phys.]{185}[a][10]\par |
| 271 |
|\Aristotle [Phys.]{185}[a][10--2] |\Aristotle [Phys.]{185}[a][10--2]\par |
| 272 |
|\Aristotle*[Phys.]{185}[a][10]{185}[b] |\Aristotle*[Phys.]{185}[a][10]{185}[b]\par |
| 273 |
|\Aristotle*[Phys.]{185}[a][10]{185}[b][2] |\Aristotle*[Phys.]{185}[a][10]{185}[b][2]\par |
| 274 |
|\Aristotle*[Phys.]{185}[a][10]{186} |\Aristotle*[Phys.]{185}[a][10]{186}\par |
| 275 |
|\Aristotle*[Phys.]{185}[a][10]{186}[a] |\Aristotle*[Phys.]{185}[a][10]{186}[a]\par |
| 276 |
|\Aristotle*[Phys.]{185}[a][10]{186}[a][3] |\Aristotle*[Phys.]{185}[a][10]{186}[a][3]\par |
| 277 |
|\Aristotle*[Phys.]{185}[a][10]{186}[a][3--5] |\Aristotle*[Phys.]{185}[a][10]{186}[a][3--5]\par |
| 278 |
|
| 279 |
\subsection{Homer} |
| 280 |
|
| 281 |
\begingroup |
| 282 |
\DeclareClassicWorkFormat{\textbf{#1},} |
| 283 |
|
| 284 |
\verb=\DeclareClassicWorkFormat{\textbf{#1},}=\par |
| 285 |
\verb=\newclassic[ to ]{Homer}{\books{\classicsRoman{#1}}|, \lines{#1}}=\par |
| 286 |
|
| 287 |
|\Homer {2}[100] |\Homer {2}[100]\par |
| 288 |
|\Homer {2}[100--4] |\Homer {2}[100--4]\par |
| 289 |
|\Homer*{2}[100]{3}[80] |\Homer*{2}[100]{3}[80]\par |
| 290 |
|\Homer [Iliad]{2}[100] |\Homer [Iliad]{2}[100]\par |
| 291 |
|\Homer*[Iliad]{2}[100]{3}[80] |\Homer*[Iliad]{2}[100]{3}[80]\par |
| 292 |
\endgroup |
| 293 |
|
| 294 |
\endgroup |
| 295 |
|
| 296 |
\end{document} |