| 1 |
\ProvidesFile{monofill.tex}[2012/10/30 documenting monofill.sty] |
| 2 |
\title{\textsf{\huge monofill.sty}\\---\\Alignment with Plain Text\\ |
| 3 |
or Monospaced Characters\thanks{This |
| 4 |
document describes version |
| 5 |
\textcolor{blue}{\UseVersionOf{\jobname.sty}} |
| 6 |
of \textsf{\jobname.sty} as of \UseDateOf{\jobname.sty}.}} |
| 7 |
% \listfiles |
| 8 |
{ \RequirePackage{makedoc} \ProcessLineMessage{} |
| 9 |
\MakeJobDoc{17}%% 2011/11/23 |
| 10 |
{\SectionLevelTwoParseInput} } |
| 11 |
\documentclass[fleqn]{article}%% TODO paper dimensions!? |
| 12 |
\input{makedoc.cfg} |
| 13 |
% \ReadPackageInfos{monofill} |
| 14 |
% \usepackage{monofill} |
| 15 |
\usepackage[fake-undefined]{monofill} |
| 16 |
% \expandafter\show\csname MF@field@undeclared\endcsname |
| 17 |
\sloppy |
| 18 |
\begin{document} |
| 19 |
\maketitle |
| 20 |
\begin{abstract}\noindent |
| 21 |
'monofill.sty' addresses horizontal alignment with plain text |
| 22 |
as in the result of \LaTeX's `\listfiles'. |
| 23 |
%% 2012/10/30: |
| 24 |
In the first instance, it has been developed as the shared |
| 25 |
tool to adjust each column with the \ctanpkgref{nicefilelist} package. |
| 26 |
%% /2012/10/30 |
| 27 |
It may also be useful for alignment in typesetting monospaced |
| 28 |
characters as in figure tables, for simulating a typewriter, |
| 29 |
or for code listings. |
| 30 |
v0.2 in fact provides a tool for use with the %% 2012/10/30 |
| 31 |
\ctanpkgref{hardwrap} package that in turn has been made for console output. |
| 32 |
The implementation also has ``philosophical aspects" |
| 33 |
in avoiding use of a counter register. |
| 34 |
\end{abstract} |
| 35 |
\tableofcontents |
| 36 |
|
| 37 |
% \newpage |
| 38 |
\section{Features and Usage} |
| 39 |
\subsection{Summary of Features} |
| 40 |
A command |\MFfieldtemplate| sets the maximum width of a ``field" |
| 41 |
using a template, |
| 42 |
with an optional argument for the ``filler" token. |
| 43 |
Then |\MFleftinfield| and |\MFrightinfield| types given |
| 44 |
(one-line) text and adds ``filler" tokens to the left or right, |
| 45 |
until the entire number of tokens es the number of characters |
| 46 |
in the associated template. So this is a kind of analogue to |
| 47 |
`\settowidth{\mylength}{<template>}', |
| 48 |
`\makebox[\mylength][l]{<text>}', and |
| 49 |
`\makebox[\mylength][r]{<text>}' |
| 50 |
intended for plain text output, without typesetting. |
| 51 |
See Sec.~\ref{sec:user} for details. |
| 52 |
|
| 53 |
\subsection{``Philosophical aspects"} |
| 54 |
The package also has ``philosophical" aspects: \ |
| 55 |
1.\enspace Apart from the declaration of the width of a ``field", |
| 56 |
everything is \strong{expandable} (thinking of application with 'blog.sty' |
| 57 |
of the \ctanpkgref{morehype} bundle) and thus is a kind of |
| 58 |
\Wikienref{functional programming}. \ |
| 59 |
2.\enspace Actually, \strong{no counter} is used, |
| 60 |
and we seem to \emph{count without} using the \emph{concept of ``number."} |
| 61 |
\ |
| 62 |
Rather, we \ (a)\enspace just generate a new list from a given one such |
| 63 |
that both have the same length and \ |
| 64 |
(b)\enspace compare the lengths of two lists---both (a) and (b) |
| 65 |
without \emph{determining} the length (which would be a \emph{number}) |
| 66 |
of any list. |
| 67 |
|
| 68 |
\subsection{Installing and Calling} |
| 69 |
The file 'monofill.sty' is provided ready, installation only requires |
| 70 |
putting it somewhere where \TeX\ finds it |
| 71 |
(which may need updating the filename data |
| 72 |
base).\urlfoot{ukfaqref}{inst-wlcf} %% corr. 2011/02/08 |
| 73 |
|
| 74 |
%% extended 2011/01/14: |
| 75 |
Below the `\documentclass' line(s) and above `\begin{document}', |
| 76 |
you load 'monofill.sty' (as usually) by |
| 77 |
\begin{verbatim} |
| 78 |
\usepackage{monofill} |
| 79 |
\end{verbatim} |
| 80 |
For certain uses such as with \ctanpkgref{fileinfo}, |
| 81 |
the package is better loaded by |
| 82 |
\begin{verbatim} |
| 83 |
\RequirePackage{monofill} |
| 84 |
\end{verbatim} |
| 85 |
|
| 86 |
\subsection{Examples} |
| 87 |
\subsubsection{Typewriter} |
| 88 |
% \MFfieldtemplate{tt}{leftright} |
| 89 |
% \MFfieldtemplate[\ ]{tt}{leftright} |
| 90 |
% \MFfieldtemplate[~]{tt}{leftright} |
| 91 |
% \MFfieldtemplate[X]{tt}{leftright} |
| 92 |
With both \[`\MFfieldtemplate[\MFspace]{tt}{leftright}' \] |
| 93 |
and \[`\MFfieldtemplate[\MFenspace]{tt}{leftright}'\] |
| 94 |
followed by |
| 95 |
\begin{verbatim} |
| 96 |
\begin{quotation}\tt\noindent |
| 97 |
!leftright!\\ |
| 98 |
!\MFleftinfield{left}{tt}!\\ |
| 99 |
!\MFrightinfield{right}{tt}!\\ |
| 100 |
!\MFrightinfield{rightleft}{tt}! |
| 101 |
\end{quotation} |
| 102 |
\end{verbatim} |
| 103 |
I get |
| 104 |
% \MFfieldtemplate[\MFspace]{tt}{leftright} |
| 105 |
\MFfieldtemplate[\MFenspace]{tt}{leftright} |
| 106 |
% \MFfieldtemplate[\MFotherspace]{tt}{leftright} |
| 107 |
%% <- works to |
| 108 |
% \MFfieldtemplate[\enspace]{tt}{leftright} |
| 109 |
% \MFfieldtemplate[\kern.5em ]{tt}{leftright} |
| 110 |
% \renewcommand*{\MFfillelement}{\kern.5em } |
| 111 |
% \renewcommand*{\MFfillelement}{\hphantom\enspace} |
| 112 |
\begin{quotation}\tt\noindent |
| 113 |
% \enspace leftright\\ |
| 114 |
!leftright!\\ |
| 115 |
!\MFleftinfield{left}{tt}!\\ |
| 116 |
!\MFrightinfield{right}{tt}!\\ |
| 117 |
!\MFrightinfield{rightleft}{tt}! |
| 118 |
% \enspace \MFrightinfield{rightleft}{tt} |
| 119 |
\end{quotation} |
| 120 |
\subsubsection{Figures} |
| 121 |
Similarly, with |
| 122 |
`\MFfieldtemplate[\MFenspace]{figs}{0000}' |
| 123 |
and |
| 124 |
\begin{verbatim} |
| 125 |
\begin{quote}\noindent |
| 126 |
\MFrightinfield{1}{figs} is one,\\ |
| 127 |
\MFrightinfield{10}{figs} is ten,\\ |
| 128 |
\MFrightinfield{100}{figs} is hundred,\\ |
| 129 |
\MFrightinfield{1000}{figs} is thousand. |
| 130 |
\end{quote} |
| 131 |
\end{verbatim} |
| 132 |
I get |
| 133 |
\MFfieldtemplate[\MFenspace]{figs}{0000} |
| 134 |
\begin{quote}\noindent |
| 135 |
\MFrightinfield{1}{figs} is one,\\ |
| 136 |
\MFrightinfield{10}{figs} is ten,\\ |
| 137 |
\MFrightinfield{100}{figs} is hundred,\\ |
| 138 |
\MFrightinfield{1000}{figs} is thousand. |
| 139 |
\end{quote} |
| 140 |
\subsubsection{Screen Output} |
| 141 |
Finally, try |
| 142 |
\begin{verbatim} |
| 143 |
\MFfieldtemplate{screen}{0000} |
| 144 |
\typeout{\MFrightinfield{1}{screen} is one,} |
| 145 |
\typeout{\MFrightinfield{10}{screen} is ten,} |
| 146 |
\typeout{\MFrightinfield{100}{screen} is hundred,} |
| 147 |
\typeout{\MFrightinfield{1000}{screen} is thousand.} |
| 148 |
\typein{OK?} |
| 149 |
\end{verbatim} |
| 150 |
It works, believe me. |
| 151 |
% \MFfieldtemplate{screen}{0000} |
| 152 |
% \typeout{\MFrightinfield{1}{screen} is one,} |
| 153 |
% \typeout{\MFrightinfield{10}{screen} is ten,} |
| 154 |
% \typeout{\MFrightinfield{100}{screen} is hundred,} |
| 155 |
% \typeout{\MFrightinfield{1000}{screen} is thousand.} |
| 156 |
% \typein{OK?} |
| 157 |
|
| 158 |
% \pagebreak |
| 159 |
% \section{Implementation} |
| 160 |
\section{Package File Header (Legalese)} %% was ize 2012/09/30 |
| 161 |
\input{monofill.doc} |
| 162 |
|
| 163 |
\section{Credit} |
| 164 |
The package actually is motivated by good ideas of |
| 165 |
\ctanpkgauref{muench-hm}{Martin M\"unch}'s about |
| 166 |
extending the \ctanpkgref{longnamefilelist} package. |
| 167 |
|
| 168 |
\end{document} |
| 169 |
|
| 170 |
VERSION HISTORY |
| 171 |
|
| 172 |
2012/03/18 for v0.1 started |
| 173 |
2012/03/19 completed |
| 174 |
2012/03/19 for v0.1a enlargened first title line |
| 175 |
2012/09/30 for v0.1b ize -> ese |
| 176 |
2012/10/29 for v0.2 just used example to try \MFotherspace, |
| 177 |
typing M\"unch |
| 178 |
2012/10/30 mention nicefilelist |