summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/epigraph/epigraph.dtx
diff options
context:
space:
mode:
Diffstat (limited to 'macros/latex/contrib/epigraph/epigraph.dtx')
-rw-r--r--macros/latex/contrib/epigraph/epigraph.dtx100
1 files changed, 61 insertions, 39 deletions
diff --git a/macros/latex/contrib/epigraph/epigraph.dtx b/macros/latex/contrib/epigraph/epigraph.dtx
index baec16b14d..046530f5a5 100644
--- a/macros/latex/contrib/epigraph/epigraph.dtx
+++ b/macros/latex/contrib/epigraph/epigraph.dtx
@@ -3,6 +3,7 @@
% Author: Peter Wilson, Herries Press
% Maintainer: Will Robertson (will dot robertson at latex-project dot org)
% Copyright 1998--2004 Peter R. Wilson
+% Copyright 2011 Will Robertson
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
@@ -27,7 +28,7 @@
%
% \fi
%
-% \CheckSum{242}
+% \CheckSum{244}
%
% \DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath}
% \DoNotIndex{\@centercr,\@cite}
@@ -80,12 +81,15 @@
% \changes{v1.5a}{2002/10/22}{Fixed class with ccaption package}
% \changes{v1.5b}{2004/04/22}{Updated license and contact details}
% \changes{v1.5c}{2009/09/02}{New maintainer (Will Robertson)}
+% \changes{v1.5d}{2011/08/07}{Load package `nextpage' for \cs{cleartoevenpage}}
%
% \def\dtxfile{epigraph.dtx}
% \def\fileversion{v1.5} \def\filedate{2000/02/20}
% \def\fileversion{v1.5a} \def\filedate{2002/10/22}
% \def\fileversion{v1.5b} \def\filedate{2004/04/22}
% \def\fileversion{v1.5c} \def\filedate{2009/09/02}
+% \def\fileversion{v1.5d} \def\filedate{2011/08/07}
+% \def\fileversion{v1.5e} \def\filedate{2020/01/02}
% \newcommand*{\Lpack}[1]{\textsf {#1}} ^^A typeset a package
% \newcommand*{\Lopt}[1]{\textsf {#1}} ^^A typeset an option
% \newcommand*{\file}[1]{\texttt {#1}} ^^A typeset a file
@@ -111,7 +115,7 @@
% Maintainer: Will Robertson\\
% \texttt{will dot robertson at latex-project dot org}
% }
-% \date{\filedate}
+% \date{\fileversion\qquad\filedate}
% \maketitle
% \begin{abstract}
% The \Lpack{epigraph} package can be used to typeset a relevant
@@ -151,7 +155,7 @@
% The \Lpack{epigraph} package provides commands for typesetting
% a single epigraph and environments for typesetting a list of epigraphs.
% Epigraphs can be typeset at either the left, the center or the right of
-% the typeblock. A few example eipgraphs are exhibited here, and
+% the typeblock. A few example epigraphs are exhibited here, and
% others can be found in an article by
% Christina Thiele~\cite{TTC199}.
%
@@ -181,7 +185,7 @@
%
% \DescribeMacro{\qitem}
% Each epigraph in the list is specified by a
-% |\qitem{|\meta{text}|}{|\meta{source}|}| command (analagous to the |\item|
+% |\qitem{|\meta{text}|}{|\meta{source}|}| command (analogous to the |\item|
% command in ordinary list environments).
% By default, the \meta{source} is typeset at the bottom right of the
% \meta{text}.
@@ -194,22 +198,30 @@
% {\textit{Letters on a Regicide Peace}\\ \textsc{Edmund Burke}}
%
% The commands described in this section apply to both the |\epigraph|
-% command and the |epigraphs| environment. But first of all, note that an
-% epigraph immediately after a heading will cause the first paragraph
-% of the following text to be indented. If you want the initial paragraph
-% to have no indentation, then start it with the |\noindent| command.
+% command and the |epigraphs| environment.
+%
+% An epigraph immediately after a heading will cause the first paragraph
+% of the following text to be indented.
+% If you want the initial paragraph
+% to have no indentation, then start it with the |\noindent| command, or
+% \DescribeMacro{\epigraphnoindent}
+% add |\epigraphnoindent| to your document preamble.
+% (|\epigraphnoindentfalse| will reverse the setting.)
+% This command only affects the |\epigraph| command; for the |epigraphs| environment
+% the |\noindent| approach must still be used.
%
% \DescribeMacro{\epigraphwidth}
-% \DescribeMacro{\textflush}
% The epigraphs are typeset in a minipage of width |\epigraphwidth|. The default
% value for this can be changed using the |\setlength| command. Typically,
-% epigraphs are typset in a measure much less than the width of the textblock.
+% epigraphs are typeset in a measure much less than the width of the textblock.
+%
+% \DescribeMacro{\textflush}
% In order to avoid bad line breaks, the \meta{text} is normally typeset
-% raggedright.
+% ragged right.
% The |\textflush| command controls the \meta{text} typesetting style,
% and it can be redefined from its default value of
-% \texttt{flushleft} (which produces raggedright). The sensible values
-% are \texttt{center} for centered text, \texttt{flushright} for raggedleft
+% \texttt{flushleft} (which produces ragged right). The sensible values
+% are \texttt{center} for centered text, \texttt{flushright} for ragged left
% text, and \texttt{flushepinormal} for normal justified text.
%
% If by any chance you want the \meta{text} to be typeset in some
@@ -261,7 +273,7 @@
% \DescribeMacro{\afterepigraphskip}
% The two |...skip| commands specify the amount of vertical space inserted
% before and after typeset epigraphs. Again, these can be changed by
-% |\setlength|. It is desireable that the sum of their values should be an
+% |\setlength|. It is desirable that the sum of their values should be an
% integer multiple of the |\baselineskip|.
%
% Note that you can use normal \LaTeX{} commands in the \meta{text} and
@@ -288,8 +300,8 @@
% for printing at \meta{distance} below the header on a page.
% \meta{text} can be ordinary text or, more likely, can be either an
% |\epigraph| command or an |epigraphs| environment. By default, the
-% epigraph will be typeset at the righthand margin.
-% If the command is immediately preceeded by a |\chapter| or |\chapter*|
+% epigraph will be typeset at the right-hand margin.
+% If the command is immediately preceded by a |\chapter| or |\chapter*|
% command, the epigraph is typeset on the chapter title page.
%
% The default value for the optional \meta{distance} argument is set so
@@ -347,12 +359,13 @@
% of a chapter, where the something belongs to the chapter that is about to
% start rather than the chapter that has just ended. In order to do this
% in a document that is going to be printed
-% doublesided, the chapter must start on an odd numbered page and the
-% pre-chapter material put on the immediately preceeding even numbered page.
+% double-sided, the chapter must start on an odd numbered page and the
+% pre-chapter material put on the immediately preceding even numbered page.
% The |\cleartoevenpage| command is like the |\cleardoublepage| except
% that the page following the command will be an even numbered page, and the
% command takes an optional argument, i.e., |\cleartoevenpage{|[arg|]|,
% which is applied to the skipped page (if any).
+% This command is provided by the \texttt{nextpage} package.
%
% Here is an example:
% \begin{verbatim}
@@ -421,7 +434,7 @@
% The value of the optional argument may need changing to vertically adjust
% the position of the epigraph. If there is any |\part| that does not have an
% epigraph then an empty |\epigraphhead| command (i.e., |\epigraphhead{}|)
-% must be placed immediately befor the |\part| command.
+% must be placed immediately before the |\part| command.
%
% \end{itemize}
%
@@ -484,7 +497,8 @@
% \begin{macrocode}
%<*usc>
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{epigraph}[2009/09/02 v1.5c typesetting epigraphs]
+\ProvidesPackage{epigraph}[2020/01/02 v1.5e typesetting epigraphs]
+\RequirePackage{nextpage}
% \end{macrocode}
%
% \begin{macro}{\beforeepigraphskip}
@@ -515,6 +529,16 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\epigraphnoindent}
+% \begin{macro}{\ifepigraphnoindent}
+% Whether to add \cs{noindent} (false by default for backwards compatibility).
+% \begin{macrocode}
+\newif\ifepigraphnoindent
+\newcommand\epigraphnoindent{\epigraphnoindenttrue}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
% \begin{macro}{\epigraphflush}
% \begin{macro}{\textflush}
% \begin{macro}{\sourceflush}
@@ -596,11 +620,21 @@
% for a single epigraph. This is set in a minipage to prevent breaking
% across a page. Position it according to |\epigraphflush|.
% \begin{macrocode}
-\newcommand{\epigraph}[2]{\vspace{\beforeepigraphskip}
- {\epigraphsize\begin{\epigraphflush}\begin{minipage}{\epigraphwidth}
- \@epitext{#1}\\ \@episource{#2}
- \end{minipage}\end{\epigraphflush}
- \vspace{\afterepigraphskip}}}
+\newcommand{\epigraph}[2]{%
+ \vspace{\beforeepigraphskip}
+ \vbox{%
+ \epigraphsize
+ \begin{\epigraphflush}
+ \begin{minipage}{\epigraphwidth}
+ \@epitext{#1}\\
+ \@episource{#2}%
+ \end{minipage}%
+ \end{\epigraphflush}%
+ }%
+ \nointerlineskip
+ \vspace*{\afterepigraphskip}%
+ \ifepigraphnoindent\@afterheading\fi
+}
% \end{macrocode}
% \end{macro}
%
@@ -643,25 +677,13 @@
\leftmargin\z@ \rightmargin\z@
\let\makelabel\qitemlabel}}%
{\endlist\end{minipage}\end{\epigraphflush}
- \vspace{\afterepigraphskip}}
+ \vspace{\afterepigraphskip}%
+}
% \end{macrocode}
% \end{environment}
%
% \subsection{Epigraphs before a chapter title}
%
-% \begin{macro}{\cleartoevenpage}
-% Like |\cleardoublepage| except that it skips pages until an even one, and
-% its optional argument is applied to the skipped page, if any.
-% The code is based on the kernel |\cleardoublepage| in \file{ltoutput.dtx}.
-% \changes{v1.2}{1999/09/12}{Added \cs{cleartoevenpage} command}
-% \changes{v1.5}{2000/02/20}{Added optional arg to \cs{cleartoevenpage}}
-% \begin{macrocode}
-\providecommand{\cleartoevenpage}[1][\@empty]{%
- \clearpage%
- \ifodd\c@page\hbox{}#1\clearpage\fi}
-% \end{macrocode}
-% \end{macro}
-%
% \begin{macro}{\@epichapapp}
% \begin{macro}{\dropchapter}
% \begin{macro}{\undodrop}