diff options
Diffstat (limited to 'Master/texmf-dist/doc/generic/FAQ-en/faq-how-do-i.tex')
-rw-r--r-- | Master/texmf-dist/doc/generic/FAQ-en/faq-how-do-i.tex | 253 |
1 files changed, 158 insertions, 95 deletions
diff --git a/Master/texmf-dist/doc/generic/FAQ-en/faq-how-do-i.tex b/Master/texmf-dist/doc/generic/FAQ-en/faq-how-do-i.tex index 6dfa7525cd6..ba0b48c2c66 100644 --- a/Master/texmf-dist/doc/generic/FAQ-en/faq-how-do-i.tex +++ b/Master/texmf-dist/doc/generic/FAQ-en/faq-how-do-i.tex @@ -1,4 +1,4 @@ -% $Id: faq-how-do-i.tex,v 1.16 2010/08/14 20:22:55 rf10 Exp rf10 $ +% $Id: faq-how-do-i.tex,v 1.24 2011/02/10 23:01:29 rf10 Exp rf10 $ \section{How do I do\dots{}?} @@ -1558,6 +1558,17 @@ in the neighbourhood of list environments (unless you change your good), the documentation is in German. Piet van Oostrum has written a summary in English. \end{description} +All of the above deal insertions at one or other margin; they are able +to take advantage of the \tex{} \csx{parshape} primitive that allows +you to adjust the margins of the text of a paragraph, by line (Knuth +provides an example of such use, with text typeset in a circle, +half-overlapping the margin, in chapter~14 of the \tex{}book). To +place insertions in the middle of a paragraph requires effort of an +entirely different sort; the \Package{cutwin} package does this for +you. It requires a set of ``part line widths'' (two per line), and +typesets the ``cutout'' section of the paragraph line by line. The +examples in the package documentation look enticing. + \plaintex{} users only have one option: \Package{figflow} (which doesn't work in \LaTeX{}). \Package{Figflow} only offers flowed figures at the start of the paragraph, but it seems perfectly @@ -1568,6 +1579,7 @@ functional. Syntax is (the user is responsible for having the dimensions correct, and for ensuring the figure fits on the page). \begin{ctanrefs} +\item[cutwin.sty]\CTANref{cutwin} \item[figflow.tex]\CTANref{figflow} \item[floatflt.sty]\CTANref{floatflt} \item[picins.sty]\CTANref{picins} @@ -1616,16 +1628,18 @@ package, and at least the picture quality will be improved. Documentation of \Package{slashbox} is less than satisfactory: a \LaTeX{} source file of rather startling starkness accompanies the -package file in the distribution. It does, however, process to a -\acro{DVI} file that gives some idea of how the \csx{slashbox} may be -expected to look. (The third example in the file shows the effect of +package file in the distribution, and the distribution includes that +file processed to a \acro{PDF} file for reading over the net, if +necessary. (The third example in the file shows the effect of \environment{picture} mode's restrictions: the dividing line doesn't go from corner to corner in the box: to correct this requires revision of \Package{slashbox}~--- \Package{pict2e} alone doesn't help in this regard.) \begin{ctanrefs} +\item[pict2e.sty]\CTANref{pict2e} \item[slashbox.sty]\CTANref{slashbox} \end{ctanrefs} +\LastEdit{2010-11-02} \Question[Q-wholerow]{How to change a whole row of a table} @@ -1665,7 +1679,7 @@ than columns. So, we set things up by: \end{wideversion} \end{quote} Now, we put `\texttt{\$}' before the first column specifier; and we -put `\texttt{\textasciicircum{}}' +put `\texttt{\textasciicircum }' before the modifiers of subsequent ones. We then use \csx{rowstyle} at the start of each row we want to modify: \begin{quote} @@ -2009,7 +2023,7 @@ running off the end of the column at the end of the \Question[Q-dpfloat]{Facing floats on 2-page spread} -If a pair of floats are to be forced to form a 2-page spread (in a +If a pair of floats need to be forced to form a 2-page spread (in a book, or whatever), the first must lie on the left side of the spread, on an even-numbered page. The \Package{dpfloat} package provides for this: the construction to use is: @@ -2027,10 +2041,38 @@ this: the construction to use is: \end{figure} \end{verbatim} \end{quote} -The construction has no effect unless the standard class option -\pkgoption{twoside} is in effect. +The construction has no effect on documents with class option +\pkgoption{oneside} (\pkgoption{twoside} is the default for +\Class{book} class). + +A special case of this requirement places the caption for a float on +the next page. (This is useful if you have a float that ``only just'' +fits the page.) You can (with a certain amount of twiddling) make +this work with \Package{dpfloat}, but the \Package{fltpage} package is +specially designed for the job: +\begin{quote} +\begin{verbatim} +\documentclass[twoside]{article} +\usepackage[leftFloats]{fltpage} +\begin{document} +... +\begin{FPfigure} + \includegraphics{my-huge-figure} + \caption{Whew! That was a big one!} +\end{FPfigure} +... +\end{document} +\end{verbatim} +\end{quote} +That example should produce a caption +\begin{quote} + Figure \emph{n (facing page)}: Whew! \dots{} +\end{quote} +(Note, however, that the package is an old one, and declares itself to +be a beta release. I seems to work, but\dots{}) \begin{ctanrefs} \item[dpfloat.sty]\CTANref{dpfloat} +\item[fltpage.sty]\CTANref{fltpage} \end{ctanrefs} \Question[Q-vertposfp]{Vertical layout of float pages} @@ -2532,93 +2574,114 @@ since the syntax of the \csx{input} command is so peculiar. In the case of \LaTeX{}, the input commands have pretty regular syntax, and the simplest \Qref*{patching techniques}{Q-patch} can be -used on them. - -If you're not inputting things from a file that's already been input, -the job is almost trivial: -\begin{quote} -\begin{verbatim} -\def\ThisFile{\jobname} -\let\OldInput\input -\renewcommand{\input}[1]{% - \renewcommand{\ThisFile}{#1}% - \OldInput#1% -} -\end{verbatim} -\end{quote} -With that, the macro \csx{ThisFile} always contains the last thing -input: it starts pointing at the base file of your document -(\csx{jobname}), and thereafter changes every time you use -\cmdinvoke*{input}{file}. Note that this is not satisfactory if your -document contains things \emph{other} than \csx{input} commands. For -example, in: -\begin{quote} -\begin{verbatim} -\documentclass{article} -... (macros above) -\begin{document} -\input{preamble} -<body of document> -\input{postamble} -\end{document} -\end{verbatim} -\end{quote} -\csx{ThisFile} contains \texttt{postamble} throughout the % !line break -\meta{body of document}. - -Most ordinary users will quickly become irritated with the simplicity -of of the \csx{ThisFile} mechanism above. The following code is more -cunning: it maintains details of the files you've `come through' to -get to where you are, and it restores \csx{ThisFile} to what the -previous file was before returning. -\begin{quote} -\begin{verbatim} -\def\ThisFile{\jobname} -\newcounter{FileStack} -\let\OrigInput\input -\renewcommand{\input}[1]{% - \stackinput{#1}{\OrigInput}% -} -\newcommand{\stackinput}[2]{% - \stepcounter{FileStack}% - \expandafter\let - \csname NameStack\theFileStack\endcsname - \ThisFile - \def\ThisFile{#1}% - #2#1% - \expandafter\let\expandafter - \ThisFile - \csname NameStack\theFileStack\endcsname - \addtocounter{FileStack}{-1}% -} -\end{verbatim} -\end{quote} -To do the same for \csx{include}, we need the simple addition: -\begin{quote} -\begin{verbatim} -\let\OrigInclude\include -\renewcommand{\include}[1]{% - \stackinput{#1}{\OrigInclude}% -} -\end{verbatim} -\end{quote} -Both examples of patching \csx{input} assume you always use -\LaTeX{} syntax, i.e., always use braces around the argument. +used on them. (Note that latex{}'s \csx{input} command is itself a +patch on top of the \plaintex{} command. Our patches apply to the +\latex{} version of the command, which is used as \cmdinvoke*{input}{file}) -The \Package{FiNK} (``File Name Keeper'') package provides a -regular means of keeping track of the current file name (with its -extension), in a macro \csx{finkfile}. If you need the unadorned file -name (without its `\extension{tex}'), use the commands: -\begin{quote} -\begin{verbatim} -\def\striptexext#1.tex{#1} -... -\edef\ThisFile{\expandafter\stripext\finkfile} -\end{verbatim} -\end{quote} +%% If you only have one level of input (you never input things from a +%% file that was itself input), the job is almost trivial: +%% \begin{quote} +%% \begin{verbatim} +%% \def\ThisFile{\jobname} +%% \let\OldInput\input +%% \renewcommand{\input}[1]{% +%% \renewcommand{\ThisFile}{#1}% +%% \OldInput#1% +%% } +%% \end{verbatim} +%% \end{quote} +%% With that, the macro \csx{ThisFile} always contains the last thing +%% input: it starts pointing at the base file of your document +%% (\csx{jobname}), and thereafter changes every time you use +%% \cmdinvoke*{input}{file}. Note that this is not satisfactory if your +%% document contains things \emph{other} than \csx{input} commands. For +%% example, in: +%% \begin{quote} +%% \begin{verbatim} +%% \documentclass{article} +%% ... (macros above) +%% \begin{document} +%% \input{preamble} +%% <body of document> +%% \input{postamble} +%% \end{document} +%% \end{verbatim} +%% \end{quote} +%% \csx{ThisFile} contains ``\texttt{preamble}'' throughout the % !line break +%% \meta{body of document}. + +%% Most ordinary users will quickly become irritated with the simplicity +%% of of the \csx{ThisFile} mechanism above. The following code is more +%% cunning: it maintains details of the files you've `come through' to +%% get to where you are, and it restores \csx{ThisFile} to what the +%% previous file was before returning. +%% \begin{quote} +%% \begin{verbatim} +%% \def\ThisFile{\jobname} +%% \newcounter{FileStack} +%% \let\OrigInput\input +%% \renewcommand{\input}[1]{% +%% \stackinput{#1}{\OrigInput}% +%% } +%% \newcommand{\stackinput}[2]{% +%% \stepcounter{FileStack}% +%% \expandafter\let +%% \csname NameStack\theFileStack\endcsname +%% \ThisFile +%% \def\ThisFile{#1}% +%% #2#1% +%% \expandafter\let\expandafter +%% \ThisFile +%% \csname NameStack\theFileStack\endcsname +%% \addtocounter{FileStack}{-1}% +%% } +%% \end{verbatim} +%% \end{quote} +%% To do the same for \csx{include}, we need the simple addition: +%% \begin{quote} +%% \begin{verbatim} +%% \let\OrigInclude\include +%% \renewcommand{\include}[1]{% +%% \stackinput{#1}{\OrigInclude}% +%% } +%% \end{verbatim} +%% \end{quote} +%% Remember, both examples of patching \csx{input} assume you always use +%% \LaTeX{} syntax, i.e., always use braces around the argument. + +It is possible to keep track of the name of the file currently being +processed, but it's surprisingly difficult (these \acro{FAQ}s offered +code, for a long time, that just didn't work in many cases). + +The \Package{currfile} package provides a regular means of keeping +track of the details of the current file (its name in +\csx{currfilename}, directory in \csx{currfiledir}, as well as the +file `base' name (less its extension) and its extension). +\Package{Currfile} does this with the help of a second package, +\Package{filehook}, which spots file operations that use \csx{input}, +\csx{InputIfFileExists} and \csx{include}, as well as package and +class loading. + +The \Package{FiNK} (``File Name Keeper'') package keeps track of the +file name and extension, in a macro \csx{finkfile}. \Package{FiNK} is +now deprecated, in favour of \Package{currfile}, but remains available +for use in old documents. +% +%% If you need the +%% unadorned file name (without its `\extension{tex}'), use the commands: +%% \begin{quote} +%% \begin{verbatim} +%% \def\striptexext#1.tex{#1} +%% ... +%% \edef\ThisFile{\expandafter\stripext\finkfile} +%% \end{verbatim} +%% \end{quote} +% The \Package{FiNK} bundle includes a \File{fink.el} that provides support under \ProgName{emacs} with \acro{AUC}-\TeX{}. \begin{ctanrefs} +\item[currfile.sty]\CTANref{currfile} +\item[filehook.sty]\CTANref{filehook} \item[fink.sty]\CTANref{fink} \end{ctanrefs} @@ -3033,8 +3096,8 @@ following minimal solution: \begin{wideversion} \begin{verbatim} \def\RCS$#1: #2 ${\expandafter\def\csname RCS#1\endcsname{#2}} -\RCS$Revision: 1.16 $ % or any RCS keyword -\RCS$Date: 2010/08/14 20:22:55 $ +\RCS$Revision: 1.24 $ % or any RCS keyword +\RCS$Date: 2011/02/10 23:01:29 $ ... \date{Revision \RCSRevision, \RCSDate} \end{verbatim} @@ -3044,8 +3107,8 @@ following minimal solution: \def\RCS$#1: #2 ${\expandafter \def\csname RCS#1\endcsname{#2}% } -\RCS$Revision: 1.16 $ % or any RCS keyword -\RCS$Date: 2010/08/14 20:22:55 $ +\RCS$Revision: 1.24 $ % or any RCS keyword +\RCS$Date: 2011/02/10 23:01:29 $ ... \date{Revision \RCSRevision, \RCSDate} \end{verbatim} |