summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/finstrut
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/finstrut
Initial commit
Diffstat (limited to 'macros/latex/contrib/finstrut')
-rw-r--r--macros/latex/contrib/finstrut/README39
-rw-r--r--macros/latex/contrib/finstrut/SRCFILEs.txt11
-rw-r--r--macros/latex/contrib/finstrut/docsrc/finstrut.tex84
-rw-r--r--macros/latex/contrib/finstrut/docsrc/fstrutst.tex59
-rw-r--r--macros/latex/contrib/finstrut/docsrc/srcfiles.tex6
-rw-r--r--macros/latex/contrib/finstrut/finstrut.pdfbin0 -> 177558 bytes
-rw-r--r--macros/latex/contrib/finstrut/finstrut.sty188
-rw-r--r--macros/latex/contrib/finstrut/fstrutst.pdfbin0 -> 31806 bytes
8 files changed, 387 insertions, 0 deletions
diff --git a/macros/latex/contrib/finstrut/README b/macros/latex/contrib/finstrut/README
new file mode 100644
index 0000000000..8c8fe9c95e
--- /dev/null
+++ b/macros/latex/contrib/finstrut/README
@@ -0,0 +1,39 @@
+ README for the `finstrut' package
+ \@finalstrut allowing vertical mode
+ (C) Uwe Lueck 2011/02/24
+
+
+`finstrut.sty' changes LaTeX's \@finalstrut (that is
+automatically inserted at the end of footnote text and
+paragraph table columns) so that it does not produce an
+extra empty line in vertical mode, e.g., with \lipsum from
+lipsum.sty for dummy text.
+
+KEYWORDs: footnotes, tables; dummy text, macro programming
+
+The package file `finstrut.sty' and the documentation files
+`finstrut.pdf' and `finstrut.tex' can be redistributed and/or
+modified under the terms of the LaTeX Project Public License;
+either version 1.3c of the License, or any later version, see
+
+ http://www.latex-project.org/lppl.txt
+
+We did our best to help you, but there is NO WARRANTY.
+
+The `finstrut' package is author-maintained in the sense of
+this license.
+
+The latest public version of the package is available at
+
+ http://mirror.ctan.org/macros/latex/contrib/finstrut/
+
+A TDS version `finstrut.tds.zip' is available at
+
+ http://mirror.ctan.org/install/macros/latex/contrib/
+
+Please report bugs, problems, and suggestions via
+
+ http://www.contact-ednotes.sty.de.vu
+
+-- v0.5: more variants of code and suggestions by
+Donald Arseneau (at package options)
diff --git a/macros/latex/contrib/finstrut/SRCFILEs.txt b/macros/latex/contrib/finstrut/SRCFILEs.txt
new file mode 100644
index 0000000000..3a493ab317
--- /dev/null
+++ b/macros/latex/contrib/finstrut/SRCFILEs.txt
@@ -0,0 +1,11 @@
+
+ *File List*
+finstrut.sty 2011/03/14 v0.5 vmode final strut (DA/UL)
+finstrut.tex 2011/03/14 documenting finstrut.sty (UL)
+fstrutst.tex 2011/03/14 test/demo finstrut.sty (DA/UL)
+srcfiles.tex 2011/02/12 collect file infos
+ ***********
+
+ List made at 2011/03/14, 17:19
+ from script file srcfiles.tex
+
diff --git a/macros/latex/contrib/finstrut/docsrc/finstrut.tex b/macros/latex/contrib/finstrut/docsrc/finstrut.tex
new file mode 100644
index 0000000000..3f5f36bc28
--- /dev/null
+++ b/macros/latex/contrib/finstrut/docsrc/finstrut.tex
@@ -0,0 +1,84 @@
+\ProvidesFile{finstrut.tex}[2011/03/14 documenting finstrut.sty (UL)]
+\title{\textsf{finstrut.sty}\\---\\Final Strut Allowing Vertical
+ Mode---The \texttt{\cs{@finalstrut}} Encyclopedia and
+ Toolkit\thanks{This document describes version
+ \textcolor{blue}{\UseVersionOf{finstrut.sty}}
+ of \textsf{finstrut.sty} as of \UseDateOf{finstrut.sty}.
+ This upload is a birthday package for Donald Arseneau---he
+ will be so happy!}}
+% \listfiles %% 2010/12/22
+{ \RequirePackage{makedoc}[2010/12/20] \ProcessLineMessage{}
+ \MakeJobDoc{18}{\SectionLevelTwoParseInput}
+}
+\documentclass{article}%% TODO paper dimensions!?
+\input{makedoc.cfg} %% shared formatting settings
+\newcommand*{\lt}{<} \newcommand*{\gt}{>} %% 2010/12/22
+\providecommand*{\strong}{\textbf} %% 2010/12/15
+\ReadPackageInfos{finstrut}
+\usepackage{color}
+\makeatletter \@beginparpenalty\@lowpenalty \makeatother
+\sloppy
+\begin{document}
+% \author{Uwe L\"uck\thanks{\urlhttpref{http://contact-ednotes.sty.de.vu}}
+% \and
+% Donald Arseneau}
+\maketitle
+\begin{abstract}\noindent
+\LaTeX\ internally inserts `\@finalstrut<strutbox>'
+at the end of footnotes or `p' (paragraph) `tabular' cells.
+When the user's entry ends on a `\par' token---which may
+be issued by some more-general-purpose user macro
+such as the `\lipsum' command from the \ctanpkgref{lipsum}
+package\urlfoot{CtanPkgRef}{lipsum} for dummy text---this
+produces a usually unwanted extra, empty line.
+'finstrut.sty' changes `\@finalstrut' in order to avoid
+this effect.
+ \par
+The first version of the package just had this minimum purpose.
+But then Donald Arseneau has convinced me to consider
+a wide range of cases and to replace my code by his proposals.
+v0.5 again adds an idea of my own ones: %% 2011/03/14:
+instead of testing for `hmode' vs.~`vmode',
+`vmode' may be \emph{forced} by a `\par'---saves tokens!
+In order not to break code that some package writers may have
+used so far, choices by package options are offered.
+v0.4 offered choice among 6 definitions, with v0.5 they are 9---!
+(Not 9!.)
+ \par\smallskip\noindent
+\strong{Keywords:}\quad footnotes; tables, dummy text,
+macro programming
+\end{abstract}
+\tableofcontents
+
+% \newpage
+\section{Remark on 'lipsum'}
+Almost at the same moment that 'finstrut' v0.1 was installed
+(2011-02-09), a new version v1.1 %% v0.4: v1.1
+of 'lipsum' was uploaded that offers a package option
+`[nopar]' %% v0.4
+to avoid a final `\par'.
+
+\section{Installing and Calling}
+The package file 'finstrut.sty' is provided ready,
+installation only requires putting it somewhere where \TeX\ finds it
+(which may need updating the filename data
+ base).\urlfoot{ukfaqref}{inst-wlcf}
+
+Below the `\documentclass' line(s) and above `\begin{document}',
+you load 'finstrut.sty' (as usually) by
+\[`\usepackage{finstrut}'\qquad \mbox{or by}\qquad
+ `\usepackage[<options>]{finstrut}'\]---<options> described below.
+
+\section{The Package File}
+\subsection{Header (Legalize)}
+\input{finstrut.doc}
+\end{document}
+
+VERSION HISTORY
+
+2011/02/09 cut out from `fnlineno.sty' [and corr. date+script]
+2011/02/09c remark on `lipsum' upload same day
+2011/02/11 \subsection
+2011/02/12 for v0.4
+2011/02/16 for v0.5, abstract mentions Donald Arseneau
+2011/03/14 "encyclopedia and toolkit", abstract extended
diff --git a/macros/latex/contrib/finstrut/docsrc/fstrutst.tex b/macros/latex/contrib/finstrut/docsrc/fstrutst.tex
new file mode 100644
index 0000000000..6e6fc1c06d
--- /dev/null
+++ b/macros/latex/contrib/finstrut/docsrc/fstrutst.tex
@@ -0,0 +1,59 @@
+\ProvidesFile{fstrutst.tex}[2011/03/14 test/demo finstrut.sty (DA/UL)]
+\documentclass{article}
+\usepackage{readprov}
+\usepackage{array}
+\usepackage[fullpar,show]{finstrut}[2011/02/18] %% upd. 2011/03/14
+\makeatletter
+ % with array.sty
+ \@ifpackageloaded{array}{%
+ \def\arraytest{%
+ \begin{tabular}{|l|b{2cm}|}\hline
+ b alignment & b alignment\par \\\hline
+ \end{tabular}
+ \nobreak\hfill
+ \begin{tabular}{|l|b{2cm}|}\hline
+ b alignment & b alignment \\\hline
+ \end{tabular}
+ \par\medskip\noindent
+ }%
+ }{\let\arraytest\relax}
+\makeatother
+\textheight=3.5in
+\begin{document}
+ \begin{center}
+ \bfseries
+ Trying \textsf{finstrut}
+ \UseVersionOf{finstrut.sty} as of \UseDateOf{finstrut.sty}
+ \end{center}
+% \edef\latexoutput{\the\output}
+% \output{\tracingonline=1 \showboxbreadth=10 \showboxdepth=1
+% \showbox\footins
+% \latexoutput
+% \global\output\expandafter{\latexoutput}}
+% \makeatletter \let\@finalstrut\@gobble \makeatother %% WITHOUT
+\begin{tabular}{|l|p{2cm}|}\hline
+ deep & $\displaystyle \int_j$\par \\\hline
+\end{tabular}
+ \nobreak\hfill
+\begin{tabular}{|l|p{2cm}|}\hline
+ deep & $\displaystyle \int_j$\\\hline
+\end{tabular}
+ \par\medskip\noindent\nobreak\hfil
+\begin{tabular}{|l|p{2cm}|}\hline
+ bad prevdepth & Hello world\hrule \\\hline
+\end{tabular}
+\nobreak\hfil
+%% irrelevant according to Donald 2011/02/15:
+% \nobreak\hfill
+% \begin{tabular}{|l|p{2cm}|}\hline
+% bad prevdepth & Hello world \\\hline
+% \end{tabular}
+ \par\medskip\noindent
+\arraytest
+O\footnote{\vrule depth22.22pt\par}
+A\footnote{x\par}
+B\footnote{y\par}
+O\footnote{\vrule depth22.22pt}
+A\footnote{x}
+B\footnote{y}
+\end{document}
diff --git a/macros/latex/contrib/finstrut/docsrc/srcfiles.tex b/macros/latex/contrib/finstrut/docsrc/srcfiles.tex
new file mode 100644
index 0000000000..a403521b4c
--- /dev/null
+++ b/macros/latex/contrib/finstrut/docsrc/srcfiles.tex
@@ -0,0 +1,6 @@
+\RequirePackage{myfilist}
+\ProvidesFile{srcfiles.tex}[2011/02/12 collect file infos]
+\EmptyFileList %%% [readprov.sty,myfilist.sty]
+\ReadPackageInfos{finstrut}
+\ReadFileInfos{finstrut,fstrutst,srcfiles}
+\ListInfos[SRCFILEs.txt]
diff --git a/macros/latex/contrib/finstrut/finstrut.pdf b/macros/latex/contrib/finstrut/finstrut.pdf
new file mode 100644
index 0000000000..346f9190b3
--- /dev/null
+++ b/macros/latex/contrib/finstrut/finstrut.pdf
Binary files differ
diff --git a/macros/latex/contrib/finstrut/finstrut.sty b/macros/latex/contrib/finstrut/finstrut.sty
new file mode 100644
index 0000000000..6f261c6181
--- /dev/null
+++ b/macros/latex/contrib/finstrut/finstrut.sty
@@ -0,0 +1,188 @@
+\NeedsTeXFormat{LaTeX2e}[1994/12/01]
+\ProvidesPackage{finstrut}[2011/03/14 v0.5 vmode final strut (DA/UL)]
+
+%% Copyright (C) 2010 2011 Uwe Lueck,
+%% http://www.contact-ednotes.sty.de.vu
+%% -- author-maintained in the sense of LPPL below --
+%%
+%% This file can be redistributed and/or modified under
+%% the terms of the LaTeX Project Public License; either
+%% version 1.3c of the License, or any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% We did our best to help you, but there is NO WARRANTY.
+%%
+%% Please report bugs, problems, and suggestions via
+%%
+%% http://www.contact-ednotes.sty.de.vu
+%%
+%% % *** Another Introduction ***
+%% % This is a variant of LaTeX's `\@finalstrut'
+%% % that doesn't produce a spurious empty line
+%% % in vmode. In general, this deals with a
+%% % closing `\par' from users in footnotes,
+%% % the idea especially came from using the
+%% % 'lipsum' package.
+%% % See `source2e.pdf' (`ltboxes.dtx') for the rationale
+%% % behind the original definition; it may imply
+%% % that the present suggestion is bad with
+%% % `p' columns in `tabular' etc.
+%% %
+%% % With v0.4, the code essentially is Donald Arseneau's.
+%%
+%% === Outline ===
+%% v0.5 considers recommendations by Donald Arseneau.
+%% Some of them may break in applications that we do not
+%% know about, therefore they must be called by package
+%% options. Package Option |[full]| calls all of them.
+%% %% 2011/03/14:
+%% Package Option |[fullpar]| calls a variant of them
+%% where instead of testing for `hmode' vs.~`vmode',
+%% `vmode' is \emph{forced} by a `\par', saving some tokens.
+%%
+%% The choices shall not be checked at each invocation
+%% of `\@finalstrut', instead they are evaluated at the
+%% definition of `\@finalstrut', at the end of the package.
+%% Choices are prepended to this definition by defining
+%% `\@tempe', `\@tempd', `\@tempc', and `\@tempb'.
+%%
+%% === Options ===
+%% According to `ltboxes.dtx', a `vmode' test once
+%% was introduced for \LaTeXe, but in 1994 removed again---it
+%% ``broke" in `p' columns. For this reason, v0.1 and v0.3
+%% used an `hmode' test instead.
+%% `ltboxes.dtx' does not tell exactly what code broke in
+%% exactly which situation. Bad.
+%% Brave users may dare the `vmode' test again by choosing
+%% package option |[v]|. It sets `\@tempe' for
+%% `\edef\@finalstrut'. The #1 argument of `\@tempe' is
+%% applied in `hmode', #2 in `vmode'---assuming we are not
+%% in `math' `mode' ...!? (TODO)%%%
+%% %% <- !?? don't understand 2011/02/16 ->
+%% %---While other conditionals
+%% % are disabled right before the latter,
+%% % we disable the mode test here:
+\AtEndOfPackage{\def\@tempe#1#2{\noexpand\ifhmode#1\else#2\fi}}
+\DeclareOption{v}{%
+ \AtEndOfPackage{%
+ \def\@tempe#1#2{\noexpand\ifvmode#2\else#1\fi}}}
+%% Replacing the `hmode' or `vmode' test by \emph{forcing} `vmode'
+%% (and then applying Donald Arseneau's suggestions for `vmode')
+%% seems just to save a few tokens. With v0.5, option |[par]|
+%% picks this idea.
+\DeclareOption{par}{\AtEndOfPackage{\def\@tempe#1#2{\par#2}}}
+%% |[argdelim]| appends a `\relax' to `\@finalstrut''s argument
+%% in case the box number is given as a string of digits
+%% (whereas `latex.ltx' only has `\strutbox' and
+%% `\@arstrutbox' as arguments).
+%% This does not work when somebody tries (e.g.\@)
+%% `\@finalstrut11 '. I.e., a ``multi-token" argument must
+%% be enclosed in braces indeed.
+\AtEndOfPackage{\let\@tempd\@empty}
+\DeclareOption{argdelim}{%
+ \AtEndOfPackage{\def\@tempd{\relax}}}
+%% %% v0.5 move \@tempc down
+%% |[dptest]| caters for depth exceeeding the depth of the
+%% strut box and for negative depth. The test requires that
+%% a multi-token argument (see above) is enclosed in braces.
+\AtEndOfPackage{\let\@tempc\@secondoftwo}
+\DeclareOption{dptest}{%
+ \AtEndOfPackage{%
+ \def\@tempd{\relax}%
+ \let\@tempc\@firstoftwo}}
+%% |[full]| enables all of Donald Arseneau's suggestions:
+\DeclareOption{full}{%
+ \AtEndOfPackage{%
+ \def\@tempe#1#2{\noexpand\ifvmode#2\else#1\fi}%
+ \def\@tempd{\relax}%
+ \let\@tempc\@firstoftwo
+}}
+%% |[fullpar]| enables all of Donald Arseneau's suggestions
+%% apart from replacing the `vmode' test by \emph{forcing}
+%% `vmode', as with option |[par]|:
+\DeclareOption{fullpar}{%
+ \AtEndOfPackage{%
+ \def\@tempe#1#2{\par#2}%
+ \def\@tempd{\relax}%
+ \let\@tempc\@firstoftwo
+}}
+%% |[show]| displays the definition of `\@finalstrut'
+%% actually resulting:
+\AtEndOfPackage{\let\@tempb\relax}
+\DeclareOption{show}{%
+ \AtEndOfPackage{\def\@tempb{\show\@finalstrut}}}
+%% Appending choices to the end-of-package hook:
+\ProcessOptions
+%%
+%% === Core Code ===
+%% Now we append the `\edef' of `\@finalstrut' to the
+%% end-of-package hook
+%% (we must hurry so that nobody changes `\@tempe' etc.).
+%% |\dp@only| will be an abbreviation for invoking a strut rule;
+%% it will only be enabled after the `\edef':
+\let\dp@only\relax
+\AtEndOfPackage{%
+ \begingroup
+%% Some conditionals are disabled for the `\edef'.
+ \let\ifdim\relax \let\else\relax \let\fi\relax
+%% Actually, they will be restored by `\endgroup';
+%% and in order to get the final `\@finalstrut'
+%% outside the group, we ``emulate" its `\edef'
+%% by `\xdef'ing an alias `\@gtempa' of it etc. ...
+ \xdef\@gtempa#1{%
+ \unskip
+ \@tempe{% %% \ifhmode/\ifvmode
+ \noexpand\nobreak
+ \vrule \dp@only #1\@tempd %% maybe \relax
+ }{%
+%% Whereas v0.1 and v0.3 used `\kern' to get the bottom
+%% distance in `vmode', Donald Arseneau recommends `\hrule'
+%% for the sake of bottom alignment with 'array.sty'
+%% (`b' type columns):
+ \@tempc{% %% depth test or not
+ \ifdim\prevdepth<\dp#1\relax
+ \ifdim\prevdepth>\z@
+ \kern -\prevdepth
+ \fi
+ \hrule \dp@only#1\relax
+ \fi
+ }{\hrule \dp@only #1\@tempd}% %% maybe \relax
+ }%
+ }
+ \endgroup
+ \let\@finalstrut\@gtempa
+ \@tempb %% maybe \show
+%% |\dp@only|
+ \def\dp@only{\@width\z@ \@height\z@ \@depth\dp}
+}
+%%
+%% === Example Result === %% 2011/02/17
+%% Option |[fullpar]| amounts to
+%% \begin{verbatim}
+%% \def\@finalstrut#1{%
+%% \unskip\par
+%% \ifdim\prevdepth<\dp#1\relax
+%% \ifdim\prevdepth>\z@
+%% \kern -\prevdepth
+%% \fi
+%% \hrule \@width\z@ \@height\z@ \@depth\dp#1\relax
+%% \fi
+%% }
+%% \end{verbatim}
+%%
+%% === Leaving ===
+\endinput
+%%
+%% === VERSION HISTORY ===
+
+v0.1 2010/12/20 very first
+v0.2 2011/02/09 redundancies removed -- still bad
+ NOT DISTRIBUTED
+v0.3 2011/02/11 code much reduced again (no \expandafter at all!);
+ wrong comments replaced; \subsection
+v0.4 2011/02/12 Donald Arseneau's full suggestions as options
+v0.5 2011/02/12 first \@tempc line moved down
+ 2011/02/16 options [par] and [fullpar]
+ 2011/02/17 explaining \edef/\xdef
+ 2011/02/18 "emulate" \edef
+ 2011/03/14 some more text on v0.5
diff --git a/macros/latex/contrib/finstrut/fstrutst.pdf b/macros/latex/contrib/finstrut/fstrutst.pdf
new file mode 100644
index 0000000000..5db3a9f7c6
--- /dev/null
+++ b/macros/latex/contrib/finstrut/fstrutst.pdf
Binary files differ