summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/xellipsis
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2018-05-01 17:57:30 +0000
committerKarl Berry <karl@freefriends.org>2018-05-01 17:57:30 +0000
commit247cabc8f66cf4525f2cb58716f64b6358c6d318 (patch)
treeedca0f6889d0800de634244dccbadcc0a236bb29 /Master/texmf-dist/source/latex/xellipsis
parent08ba64265f0add4eebf9496610c9e49d0470734f (diff)
xellipsis (16apr18)
git-svn-id: svn://tug.org/texlive/trunk@47546 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/latex/xellipsis')
-rw-r--r--Master/texmf-dist/source/latex/xellipsis/xellipsis.dtx80
1 files changed, 52 insertions, 28 deletions
diff --git a/Master/texmf-dist/source/latex/xellipsis/xellipsis.dtx b/Master/texmf-dist/source/latex/xellipsis/xellipsis.dtx
index 3098e60946e..27678a6b3fe 100644
--- a/Master/texmf-dist/source/latex/xellipsis/xellipsis.dtx
+++ b/Master/texmf-dist/source/latex/xellipsis/xellipsis.dtx
@@ -26,7 +26,7 @@
% \iffalse
%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
-%<package>\ProvidesPackage{xellipsis}[2015/11/01 v1.2 support for highly configurable ellipses of arbitrary symbol, number, and distance]
+%<package>\ProvidesPackage{xellipsis}[2015/11/01 v2.0 support for highly configurable ellipses of arbitrary symbol, number, and distance]
%<*driver>
\documentclass{ltxdoc}
@@ -67,7 +67,7 @@
\end{document}
%</driver> \fi
%
-% \title{The |xellipsis| Package, v1.2} \author{Donald P.\
+% \title{The |xellipsis| Package, v2.0} \author{Donald P.\
% Goodman III} \date{\today}
%
% \maketitle
@@ -257,6 +257,12 @@
% \textsc{affirmed}.'' \def\xelipchar{.} So this sort of
% thing has some real functionality at times.
%
+% The same effect can be achieved by using the
+% \DescribeMacro{char}|char| package option; e.g., by
+% loading |xellipsis| with |\usepackage[char=*]{xellipsis}|.
+% Indeed, as of version 2.0, all these settings can be made
+% at the time of package loading.
+%
% The \emph{number} of characters in an ellipsis is governed
% by \DescribeMacro{\xelipnum}|\xelipnum|. |\xelipnum| is
% a \emph{counter}, not a macro, so if you change it, do so
@@ -268,7 +274,8 @@
% \vbox{% \xelipnum=6 \xelip } \hfil% } \hfil% } \bigskip
%
% Most likely this would be 3 or 4, but I'm not going to try
-% to limit you. |\xelipnum| defaults to 3.
+% to limit you. |\xelipnum| defaults to 3. The package
+% option is \DescribeMacro{num}|num|.
%
% There are three lengths responsible for controlling the
% spacing of the ellipses. The space \emph{before} the
@@ -278,7 +285,10 @@
% \DescribeMacro{\xelipaft}|\xelipaft|; and the space
% \emph{between} the characters of the ellipses is
% \DescribeMacro{\xelipgap}|\xelipgap|. Each of these
-% default to |3pt|.
+% default to |3pt|. Their package options are
+% \DescribeMacro{before}|before|,
+% \DescribeMacro{after}|after|, and
+% \DescribeMacro{gap}|gap|.
%
% The benefit of having each of these independently
% configurable is that you don't have to worry about
@@ -329,7 +339,9 @@
% \DescribeMacro{\xelipprechar}|\xelipprechar|, while the
% character that is to go \emph{after} the ellipsis is
% \DescribeMacro{\xelippostchar}|\xelippostchar|. Both of
-% these default to be empty.
+% these default to be empty. Their package options are
+% \DescribeMacro{prechar}|prechar| and
+% \DescribeMacro{postchar}|postchar|.
%
% \bigskip
% \hbox to\linewidth{%
@@ -367,6 +379,11 @@
% spacing around these two characters; by default, all four
% are set to |0pt|. They are |dimen|s and can be set in
% either the \TeX\ way or the \LaTeX\ |\setlength| way.
+% Their package options are
+% \DescribeMacro{prebefore}|prebefore|,
+% \DescribeMacro{preafter}|preafter|,
+% \DescribeMacro{postbefore}|postbefore|, and
+% \DescribeMacro{postafter}|postafter|,
%
% \bigskip
% \hbox to\linewidth{%
@@ -419,21 +436,15 @@
% current MLA behavior. These all default to \emph{off},
% and the default |xellipsis| behavior described above is
% \emph{on}. We define the conditions for the options, then
-% process the options themselves.
+% process the options themselves. We use |xkeyval| to get
+% these options, so we can easily give them key-value
+% arguments. We also need to define our default characters.
% \begin{macrocode}
-\newif\ifxel@latex\xel@latexfalse
-\newif\ifxel@chicago\xel@chicagofalse
-\newif\ifxel@oldmla\xel@oldmlafalse
-\newif\ifxel@mla\xel@mlafalse
-\newif\ifxel@bluebook\xel@bluebookfalse
-\DeclareOption{latex}{\xel@latextrue}
-\DeclareOption{chicago}{\xel@chicagotrue}
-\DeclareOption{oldmla}{\xel@oldmlatrue}
-\DeclareOption{mla}{\xel@mlatrue}
-\DeclareOption{bluebook}{\xel@bluebooktrue}
-\ProcessOptions
+\RequirePackage{xkeyval}
+\def\xelipchar{.}
+\def\xelipprechar{}
+\def\xelippostchar{}
% \end{macrocode}
-%
% Proceed to define the dimens that we will need. These are
% mostly self-explanatory; the first is for the gap
% between the characters of the ellipsis, the second is for
@@ -456,17 +467,31 @@
% \begin{macrocode}
\newcount\xelipnum\xelipnum = 3%
% \end{macrocode}
-% Next we devise a command which will hold the characters we
-% use for ellipses. The main ellipsis character defaults to
-% a period; the pre- and post-ellipsis characters default to
-% nothing.
% \begin{macrocode}
-\def\xelipchar{.}
-\def\xelipprechar{}
-\def\xelippostchar{}
+\newif\ifxel@latex\xel@latexfalse
+\newif\ifxel@chicago\xel@chicagofalse
+\newif\ifxel@oldmla\xel@oldmlafalse
+\newif\ifxel@mla\xel@mlafalse
+\newif\ifxel@bluebook\xel@bluebookfalse
+\DeclareOptionX{latex}{\xel@latextrue}
+\DeclareOptionX{chicago}{\xel@chicagotrue}
+\DeclareOptionX{oldmla}{\xel@oldmlatrue}
+\DeclareOptionX{mla}{\xel@mlatrue}
+\DeclareOptionX{bluebook}{\xel@bluebooktrue}
+\DeclareOptionX{char}{\def\xelipchar{#1}}
+\DeclareOptionX{num}{\xelipnum=#1}
+\DeclareOptionX{before}{\xelipbef=#1}
+\DeclareOptionX{after}{\xelipaft=#1}
+\DeclareOptionX{gap}{\xelipgap=#1}
+\DeclareOptionX{prechar}{\def\xelipprechar{#1}}
+\DeclareOptionX{postchar}{\def\xelippostchar{#1}}
+\DeclareOptionX{prebefore}{\xelipprebef=#1}
+\DeclareOptionX{preafter}{\xelippreaft=#1}
+\DeclareOptionX{postbefore}{\xelippostbef=#1}
+\DeclareOptionX{postafter}{\xelippostaft=#1}
+\ProcessOptionsX
% \end{macrocode}
-% Finally, we're ready to define the actual ellipsis code.
-% First, we need to define a counter for the loop.
+% Now we define the loop variable.
% \begin{macrocode}
\newcount\xel@loopi\xel@loopi = 0%
% \end{macrocode}
@@ -559,7 +584,6 @@
\xelipprebef=\fontdimen2\font%
\xelippostaft=\fontdimen2\font%
\fi
-% This is\xelip how it's supposed to work, I guess? (|\xelip|)
% }
% \end{macrocode}
% And there's the |xellipsis| package. I hope it proves