diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2008-08-05 13:22:00 +0000 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2008-08-05 13:22:00 +0000 |
commit | 1552db7705d6a6a967ace880fc8ece127eb706d7 (patch) | |
tree | ce9d19a3b5a91643515a5e4c578f7fd333107728 | |
parent | 91cb8abd5dae54bc53bdfc49215f927e0a2481bf (diff) |
rm galley
git-svn-id: svn://tug.org/texlive/trunk@10091 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex3/galley/xhj-test.tex | 176 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex3/galley/galley2.dtx | 3780 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex3/galley/galley2.ins | 14 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex3/galley/xhj.dtx | 1924 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex3/galley/galley2.sty | 1724 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex3/galley/xhj.sty | 313 | ||||
-rw-r--r-- | Master/tlpkg/tlpsrc/galley.tlpsrc | 2 |
7 files changed, 0 insertions, 7933 deletions
diff --git a/Master/texmf-dist/doc/latex3/galley/xhj-test.tex b/Master/texmf-dist/doc/latex3/galley/xhj-test.tex deleted file mode 100644 index 6ba6fa5486f..00000000000 --- a/Master/texmf-dist/doc/latex3/galley/xhj-test.tex +++ /dev/null @@ -1,176 +0,0 @@ -\documentclass{article} - - -\setlength\textwidth{5cm} - -\usepackage{xparse,xhj,galley2} -\tracinggalleys=2 % want tracing here - - -\def\trace{\tracingassigns=1\tracingall} - -\IgnoreWhiteSpace - -% simple definition for \\ -% ignoring * form -% -\DeclareDocumentCommand\\{so} - {\leavevmode \unskip - \hskip \GAL@@linefillskip - \IfNoValueF{#2}{\vadjust{\vskip #2}}\break - } - - - -\setlength\parindent{12pt} - -\begin{document} - -some starting text - -%\trace -\UseInstance{pshape}{staggered} - -\section{This should\\ be\\ - a really staggered\\heading (but isn't)} - -In fact we should not be surprised since the standard \LaTeX{} heading -code is essentially using its own pshape and thus overwriting the -outer pshape declaration. - -\UseInstance{pshape}{staggered} -\UseInstance{justification}{raggedright} -This is a paragraph for testing various justification\\ settings. We have some -text and after the word `word' \\ we just had a forced line break. We -do some more line break testing, e.g., this\\[7pt] one was supposed to -add 7pts of extra space. - - -And here a paragraph for comparison with some text some text some text -also-containing-a-longer-word some text some text some text some text -some text some text some text. - -\section{Linebreaks} - - -A line break with linebreak\linebreak -and now ... - -% A line break with oldlinebreak\oldlinebreak -% what takes longer? - - -\section{Justified} - -%\trace -some text\marginpar{\UseInstance{justification}{raggedright}\fussy - \fontfamily{pop}\fontsize{7}{9}\selectfont ZZZ Some text in - optima. Some text in optima. Some text in optima. Some text in - optima. Some text in optima.} -some text some text some text some text some text some text some text -some text some text some text some text some text some text -some text some text some text some text some text some text some text -some text some text some text some text some text some text -some text some text some text some text some text some text some text -some text some text some text some text some text some text - -%\trace - -\section{Raggedright} - -\UseInstance{justification}{raggedright} -This is a paragraph for testing various justification settings. We have some -text and after the word `word' \\ we just had a forced line break. We -do some more line break testing, e.g., this\\[7pt] one was supposed to -add 7pts of extra space. - - -And here a paragraph for comparison with some text some text some text -also-containing-a-longer-word some text some text some text some text -some text some text some text. - -\section{Left} - -\UseInstance{justification}{raggedleft} -\UseInstance{hyphenation}{off}\sloppy -This is a paragraph for testing various justification settings. We have some -text and after the word `word' \\ we just had a forced line break. We -do some more line break testing, e.g., this\\[7pt] one was supposed to -add 7pts of extra space. - - - -And here a paragraph for comparison with some text some text some text -also-containing-a-longer-word some text some text some text some text -some text some text some text. - -\tracingpages=1 - -\section{Adjust} - -\UseInstance{justification}{adjust} -\UseInstance{hyphenation}{on}\fussy -This is a paragraph for testing various justification settings. We have some -text and after the word `word' \\ we just had a forced line break. We -do some more line break testing, e.g., this\\[7pt] one was supposed to -add 7pts of extra space. - - -And here a paragraph for comparison with some text some text some text -also-containing-a-longer-word some text some text some text some text -some text some text some text. - -\section{Center} - -\UseInstance{justification}{center} -This is a paragraph for testing various justification settings. We have some -text and after the word `word' \\ we just had a forced line break. We -do some more line break testing, e.g., this\\[7pt] one was supposed to -add 7pts of extra space. - - -And here a paragraph for comparison with some text some text some text -also-containing-a-longer-word some text some text some text some text -some text some text some text. - -\section{Center first} - -\UseInstance{justification}{centerfirst-adjust} -This is a paragraph for testing various justification settings. We have some -This is a paragraph for testing various justification settings. We have some -This is a paragraph for testing various justification settings. We have some -This is a paragraph for testing various justification settings. We have some -text and after the word `word' \\ we just had a forced line break. We -do some more line break testing, e.g., this\\[7pt] one was supposed to -add 7pts of extra space. -This is a paragraph for testing various justification settings. We have some -This is a paragraph for testing various justification settings. We have some -This is a paragraph for testing various justification settings. We have some -This is a paragraph for testing various justification settings. We have some - - -And here a paragraph for comparison with some text some text some text -also-containing-a-longer-word some text some text some text some text -some text some text some text. - - -\section{Center middle} - -\hrule - -\UseInstance{justification}{centermiddle} - -This is a paragraph for testing various justification settings. We have some -text and after the word `word' \\ we just had a forced line break. We -do some more line break testing, e.g., this\\[7pt] one was supposed to -add 7pts of extra space. - - -And here a paragraph for comparison with some text some text some text -also-containing-a-longer-word some text some text some text some text -some text some text some text. - -\hrule - -\end{document} - diff --git a/Master/texmf-dist/source/latex3/galley/galley2.dtx b/Master/texmf-dist/source/latex3/galley/galley2.dtx deleted file mode 100644 index a2fd84c8e16..00000000000 --- a/Master/texmf-dist/source/latex3/galley/galley2.dtx +++ /dev/null @@ -1,3780 +0,0 @@ -% \iffalse -%% -%% $Header: /usr3/users/latex3/design/consolidation/CURRENT/RCS/galley2.dtx,v 1.15 2000/01/27 21:45:56 latex3 Exp $ -%% -%% (C) Copyright 1999-2000 Frank Mittelbach -%% All rights reserved. -%% -%% Not for general distribution. In its present form it is not allowed -%% to put this package onto CD or an archive without consulting the -%% the authors. -%% -%<*dtx> - \ProvidesFile{galley.dtx} -%</dtx> -%<package>\NeedsTeXFormat{LaTeX2e} -%<package>\ProvidesPackage{galley2} -%<driver>\ProvidesFile{galley.drv} -% \fi -% \ProvidesFile{galley2.dtx} - [2000/01/27 v0.2s galley structures] -% -% \iffalse -%<*driver> - \documentclass{ltxdoc} - \typeout{********} - \typeout{* Unpack with:} - \typeout{* \string\generate{% - \string\file{galley2.sty}{\string\from{galley2.dtx}{package,trace}}} - } - \typeout{********} -% \usepackage{ldcdoc} -% \makeatletter -% \let\GAL@typeout\@gobble \let\GAL@show@datastructure\@gobble -% \makeatother - - \newcommand\LaTeXplus{\LaTeXe$*$} - - \CodelineIndex \EnableCrossrefs - \renewcommand\MakePrivateLetters{\makeatletter\catcode`\:11\relax} - \begin{document} - \DocInput{galley2.dtx} - \end{document} -%</driver> -% \fi -% -% \CheckSum{0} -% -% \newcommand\PARM[1]{parameter \textbf{#1}} -% \newcommand\subsubsubsection{\paragraph} -% -% -% \GetFileInfo{galley2.dtx} -% -% \title{The \textsf{galley} package\thanks{This file -% has version number \fileversion, last -% revised \filedate.}} -% \author{FMi} -% \date{\filedate} -% \maketitle -% -% \begin{abstract} -% This module provides the data structure for galleys and contains -% the low-level interfaces for direct manipulation of this data structure. -% Higher-level templates for interfacing with the -% galley mechanism are set up by the module -% \texttt{xhj}. -% The low-level interfaces of the current module are geared -% towards package writers having special needs which are not -% fulfilled by the templates in the \texttt{xhj} module. -% They are not intended to be used directly in class design. -% \end{abstract} -% -% \tableofcontents -% -% \section{Introduction} -% -% In \LaTeXplus{} terminology a galley is a rectangular area which -% receives text and other material filling it from -% top.\footnote{The predominant direction depends on the writing -% system and with extensions to \TeX{} such as Omega there are -% possibilities to define galleys with a different filling direction.} -% The vertically extend of a galley is normally not restricted -% (there are exceptions); instead certain chunks are taken off the top -% of an -% already partially filled galley to form columns or similar areas -% on a page. This process is typically asynchronous but there are ways -% to control or change its behavior. -% -% Examples for galleys are `the main galley', where the continuous -% document data gets formatted into and from which columns and pages are -% constructed, and `vbox galley's, such as the body of a minipage -% environment or the body of a float (in \LaTeXe only---the new float -% mechanism for \LaTeXplus{} will employ horizontally oriented float -% bodies). The latter galleys are typically not being split after -% formatting though there can be exceptions. -% -% The data that is being formatted into a galley can be described as a -% sequence of paragraphs of text separated by vertical material such -% as vertical spaces, penalties, writes, specials, etc. -% -% There are two components that a mechanism for galleys has to provide: -% the framework for manipulating the shape and placement of paragraph -% text (this is provided with higher-level templates in the module -% \texttt{xhj}) and the framework for manipulating the inter-paragraph -% material. -% -% -% -% \subsection{Some problems with \LaTeXe{} galleys} -% -% The handling of inter-paragraph material poses the most difficult -% problems as it is typically influenced by various factors and -% information gained at different stages throughout the document -% processing. \LaTeXe{} provided a certain control over this material, -% e.g., headings would set a |@nobreak| flag to prevent paragraph -% breaking after them and other commands and environments would test -% for it; |\addvspace| and |\addpenalty| could be used several times -% in succession and still provide reasonable results, but all in all -% these have been adhoc solutions to the most pressing problem of that -% area---many others remained unsolved: -% -% The following is a list of document extracts which one can imagine -% to appear in ordinary documents. They all have in common that in -% \LaTeXe{} they produce surprising (and undesired) results: -% \begin{enumerate} -% \item -% \begin{verbatim} -% \end{itemize} \vspace{3pt} \begin{itemize} ... -%\end{verbatim} -% \ldots not three points of extra space but 13 (with -% the \texttt{article} class) -% -% \item -% \begin{verbatim} -% \section{HEAD} {\sc ABC} ... -%\end{verbatim} -% \ldots page breaking restrictions apply to the -% second paragraph after the heading not the first as they -% should -% \item -% \begin{verbatim} -% \usepackage{hyperref} -%\end{verbatim} -% \ldots the danger of completely changed vertical spacing because -% the |\special|s added by \texttt{hyperref} interfere with the -% spacing and penalty mechanisms of \LaTeXe -% -% -% \item -% \begin{verbatim} -% {\section{HEAD}} para text \par \begin{itemize} ... -%\end{verbatim} -% \ldots one gets an indentation after the heading; a page break might -% happen after the first line in the paragraphs; and there will be no -% space above the itemize environment (though there will be space -% below) --- because of this \LaTeXe{} claims this is incorrect input -% --- and then since \LaTeX\,2.09 uses the equivalent of -% |\twocolumn[\chapter{HEAD}]| in certain circumstances in the report -% and book class :-) -% \end{enumerate} -% -% All these pitfalls are due to the fact that \LaTeXe{} typesets the -% inter-paragraph material whenever it receives it and once it is -% typeset \TeX{} has only a limited power to modify the material -% already present on the galley. -% -% Thus to be able to do better one has to defer any typesetting until -% the very last moment (i.e., when the next paragraph starts) and -% instead collect such inter-paragraph material in a suitable data -% structure where it can be manipulated and examined. -% The present code in this module provides such a data structure. Of -% course, to be successful it is important that all functions that -% would normally produce inter-paragraph material (such as user -% commands like |\vspace|) obey the concepts behind the mechanism and -% refrain from directly adding to the galley. -% How this is achieved will be explained in the next sections. -% -% -% \section{The galley data structure} -% -% A galley is a \LaTeX{} object which contains (or receives) -% paragraphs and typesets them vertically below each other intermixed -% with material like vertical spaces and penalties, etc.\ which are -% placed between such paragraphs. -% -% Galleys can be nested and thus data structures associated with them -% need to be provided using a stack structure. -% -% Technical aspects of the implementation of this structure are -% discussed in section~\ref{sec:galley-concept-impl}. -% -% -% \subsection{Writes, marks, specials and inserts} -% -% Writes, marks, specials and inserts are internally represented by -% \TeX{} as invisible objects (nodes) within the horizontal or -% vertical lists of \TeX. The -% problem with this is that they interfere with other nodes, produce -% additional break points, etc. -% -% For this reason they should not appear on their own but need to be -% placed into precisely controlled places. They can either go directly -% after the last line of a paragraph (preceded and followed by -% |\nobreak|) or they can go directly in front of the next -% paragraph. Table~\ref{tab:vthing} lists the different nodes and -% their suggested handling. -% \begin{table} -% \begin{center} -% \begin{tabular}{ll} -% \hline -% vthing & attach to \\ -% \hline -% insert & prev \\ -% write & prev or next (flag) \\ -% mark & prev or next (flag) \\ -% special (hyperref) & prev or next (different command) \\ -% special (others) & next -% \end{tabular} -% \end{center} -% \small ^^A well designed object :-) -% \begin{quote} -% prev := just add to MVL followed by |\nobreak| \\ -% next := store tokens and put in a primitive ``in hmode at start of -% next para'' -% \end{quote} -% \caption{Invisible nodes and their handling}\label{tab:vthing} -% \end{table} -% -% -% \subsection{Individual parameters} -% -% Each parameter related to a galley exists in two incarnation: -% \begin{itemize} -% \item it has one value which is considered to be static for a -% sequence of paragraphs (potentially for all paragraphs typeset on -% this level); any change to it via some mutator command will -% persist until a further change or the end of the level --- called -% static galley parameter value (SGPV) -% \item it has one value which is reset after each use to the -% corresponding static value --- called dynamic galley parameter -% value (DGPV). -% \end{itemize} -% -% The actual processing routines always use the DGPVs. Thus to produce -% a paragraph sequence with a certain uniform setting of parameters -% one would set up (or modify) the SGPVs, and to locally overwrite -% individual values for one paragraph one would modify the relevant DGPVs. -% -% -% \subsubsection{Vertical (pre-paragraph) parameters} -% -% \begin{description} -% \item[nobreak flag (b)] a flag that signals how page breaking should -% be handled -% between the previous and the upcoming paragraph; it takes a number -% between 0 and 3 with the following meaning: 0 means normal -% breaking behavior (value of \PARM{penalty} is used), 1 means -% prevent break between paragraphs (value of \PARM{penalty} is -% discarded and replaced by 10000), 2 is like 1 but additionally -% prevents\footnote{as far as possible with \TeX} a page break -% within the first lines of the upcoming paragraph (by fiddling with -% |\clubpenalty|), 3 is like 1 but also suppresses a page break for -% the whole upcoming paragraph (by setting -% |\interlinepenalty|)\footnote{One can actually implement something -% even better: with e\TeX{} more control is possible and with normal -% \TeX{} one could prevent a break for a minimum of X lines by -% checking on the value of \texttt{\textbackslash prevgraf} and decreasing this for the next -% time around} -% At the moment it also supports negative numbers ($-3$ especially) -% which have the same meaning as the positive counterparts except -% that they only influence the breaking within the paragraph, e.g., -% $-3$ do not break within the next paragraph (which is useful for -% initials etc). However this should probably be redesigned properly! -% \item[vpenalty (p)] penalty between paragraphs unless flag above is set -% \item[vspace (v)] skip between paragraphs as set by class or package -% commands, if -1sp then |\parskip| is used instead.\footnote{This -% -1sp is a speedup measure to avoid the need for an additional flag -% for suppressing or adding \texttt{\textbackslash parskip}, this way -% between normal paragraphs \texttt{\textbackslash parskip} is -% added (as the default for this parameter is -1sp) but any setting -% will result in suppressing it. Of course this means if some -% environment requests some space it does get 1sp less, acceptable? -% Using 0pt instead is not a good idea as it makes it difficult to -% state for some environment that all space should be suppressed.} -% \item[user vpenalty (up)] penalty between paragraphs set by user level -% commands -% \item[user vspace (uv)] additional space between paragraphs set by user level -% commands. This space is always added and never suppressed or subject -% to functions like using the maximum, since it is provided by -% user commands like |\vspace| where we assume that the user intends -% to correct the default result. -% \item[prev whatsits (pw)] whatsits that are supposed to get attached to -% the previous paragraph -% \item[parshape (ps)] structured parameter that sets up a \TeX{} -% |\parshape| declaration or empty; it replaces the next two parameters -% in the current implementation. However for reasons of secure -% programming it might be necessary to have all three. (Right now -% |\linewidth| and |\@totalleftmargin| are locally set when -% modifying the ps parameter and thus are in danger of getting out -% of sync if setting happens not at group boundaries. -% \item[measure (m)] nominal width of the upcoming paragraph lines -% (|\linewidth| is set to this value)\footnote{Not used right now -% see comment on ps parameter.} -% \item[hoffset (h)] offset for the upcoming paragraph lines from the left -% margin (in \LaTeXe{} this was -% |\@totalleftmargin|).\footnote{Not used right now, see comment on -% ps parameter.} -% \end{description} -% -% -% \subsubsection{Paragraph-start parameters} -% -% \begin{description} -% \item[indentation (i)] flag to suppress insertion of indentation -% box. A value of 0 means insert indentation any other value suppresses -% indentation. -% \item[next whatsits (nw)] whatsits that are supposed to get attached to -% the next paragraph -% \item[object (o)] typeset material at the start of the paragraph -% \item[queries (q)] information about previously seen objects/states -% on the galley that can be queried by following code as necessary, -% e.g., the fact that we just have processed an `item', or a -% `heading', or \ldots -% -% This parameter is not yet properly used and perhaps becomes -% obsolete once there is a proper mechanism for handing such data. -% \end{description} -% -% -% \subsubsection{Paragraph-justification parameters} -% -% The following parameter is supposed to define the inner shape of a -% paragraph, e.g., adjusted, centered lines, ragged shapes, etc. It -% is not meant to define the measure (for this see the \PARM{parshape}). -% \begin{description} -% \item[justification (j)] This is a multivalued parameter consisting of -% \begin{itemize} -% \item the counterpart to |\parfillskip| at the -% beginning of a paragraph -% \item the \TeX{} |\leftskip| -% \item the \TeX{} |\rightskip| -% \item the \TeX{} |\parfillskip| -% \item the \TeX{} |\spaceskip| -% \item the \TeX{} |\xspaceskip| -% \item glue specification to be put in front of a forced ``newline'' -% \item the \TeX{} |\parindent|\footnote{This parameter should -% perhaps be taken out, there is some dicussion related to -% this elsewhere.} -% \end{itemize} -% \end{description} -% -% \subsubsection{Line breaking parameters} -% -% Line breaking parameters are considered to be not related to -% individual paragraphs but to paragraphs sequences, i.e., they are -% not reset on each paragraph. Wrong? Instead they are initialized at -% start of galley and are otherwise only settable via templates. One -% could of course make them a multivalued parameter as well. -% -% -% -% \subsubsection{Paragraph-end parameters} -% -% None defined yet (but perhaps should) -% -% -% -% \subsection{Document level (user) commands} -% -% \subsubsection{Penalties} -% -% To give the user a chance to actually overwrite a penalty setting -% produced from environments or commands internally updating the -% galley structure, user level document commands like |\nopagebreak| -% do not modify the internal \PARM{penalty} but instead use a -% \PARM{user penalty}. If that parameter is set (i.e., non-empty) it -% will get used and the internal \PARM{penalty} that is normally -% applied will be ignored. This way, even in situations where the -% user request appears too early in the document (e.g., between -% environments where the following environment would modify -% \PARM{penalty} the desired outcome is ensured. -% -% \subsubsection{Vertical spaces} -% -% In contrast user commands for specifying vertical space will always -% add to the existing space.\footnote{Always? i can image to have the -% desire to explicitly set the space to a fixed value in which case i -% would like to ensure that the internal value for \PARM{vspace} is -% fully ignored. On the other hand this may not been sensible because -% it might be difficult for the user to know how big the space should -% be.} -% -% -% \subsection{Galley structure after lists/displays}\label{sec:endlist} -% -% After lists or a math display the continuation depends on whether -% the following text logically is part of the previous material or -% starts a new paragraph. This difference is coded in the source -% document by leaving or not leaving an empty line (|\par|). -% -% Depending on this the handling of the upcoming paragraph might -% differ in \PARM{penalty}, \PARM{vspace}, \PARM{indent} (and perhaps -% others) -% -% To allow for this a processing mechanism like this should be -% investigated\footnote{There is some concept code for this below but -% it is not finished!}: -% \begin{itemize} -% \item -% The environment that intends to make use of the structure sets a flag -% \item -% The values of parameters for the case of the paragraph continuing -% the previous material are specified by modifying the DGPVs. -% \item -% The values of parameters for the case that the next paragraph is -% to be considered independent are specified in a third structure -% (called XGPV for now) which is a plist like the SGPV (or part of -% it if we don't allow to modify any odd rubbish in that case, -% which is probably sensible) -% \item -% The code for the |\par| command is augmented in a way that if it -% is executed in vertical mode the following happens: -% \begin{itemize} -% \item -% The values in the XGPV are added to the DGPV values to allow -% for user level changes to be preserved. -% \item -% The flag above is reset so that following |\par| does not -% modify the DGPV further. -% \end{itemize} -% \end{itemize} -% The XGPV has to be stored away if a new galley level is initiated! -% -% -% -% -% -% \section{The low-level command interface} -% -% The commands described in this section are used to update the galley -% data structure. Their intended use is a) in kernel code, i.e., in -% parts that are already provided by the \LaTeXplus{} kernel such as -% the basic float mechanism and b) as building blocks for higher-level -% templates such as those defined by the module \texttt{xhj} or the -% module \texttt{xinitials}. -% They are not meant to be used directly when building classes. -% -% Their names are currently very strange and inconsistent and need to -% be normalized. -% -% -% -% \subsection{Manipulating the dynamic galley parameters values} -% -% To manipulate the dynamic parameter values of the galley structure a -% number of commands are available. As explained above changing the -% dynamic parameters effects the only next paragraph (or the next sequence -% of vertical objects between paragraphs) --- afterwards the -% parameters are reset to the values stored in their static counterparts. -% -% \noindent -% \DescribeMacro{\setDGPVthing:nn}\marg{id}\marg{value} \\ -% The |\setDGPVthing:nn| command takes a parameter \meta{id} (or more -% exactly its letter or letter sequence such as `j' or `ps') and -% assigns the \meta{value} to it. No processing of the value is -% undertaken. -% -% \noindent -% \DescribeMacro{\appendtoDGPVthing:nn}\marg{id}\marg{value} \\ -% \DescribeMacro{\appendtoDGPVthing:no} -% The |\appendtoDGPVthing:nn| also leaves the \meta{value} unchanged -% but appends it to the current value of the parameter. This is, for -% example, used to build the list of whatsits nodes in the \PARM{next -% whatsits} parameter. -% -% \noindent -% \DescribeMacro{\setDGPVdimension:nn}\marg{id}\marg{value} \\ -% \DescribeMacro{\addDGPVdimension:nn} -% \DescribeMacro{\maxDGPVdimension:nn} -% In contrast the family of |\...DGPVdimension:nn| commands process the -% \meta{value} by interpreting it as a calc dimension expression. The -% result is then set (|\set...|), or added to the current value -% (|\add...|), or compared with the current value (|\max...|) and the -% maximum assigned. -% -% \noindent -% \DescribeMacro{\setGALpenalty:n}\marg{value} \\ -% \DescribeMacro{\addGALpenalty:n} -% What is available for dimensions is also available for integer -% valued parameters. However, since there is only one such parameter -% (the \PARM{penalty}) at the moment, we provide a family of commands -% which take only a \meta{value} argument. -% -% \noindent -% \DescribeMacro{\setGALobject:n}\marg{value} \\ -% \DescribeMacro{\setGALbreak:n} -% The |\setGALobject:n| and |\setGALbreak:n| are special variants of -% the |\setDGPVthing:nn| command for the \PARM{object} and -% \PARM{nobreak flag} parameters, respectively.\footnote{should -% probably vanish} -% -% \noindent -% \DescribeMacro{\setGALleftparshape:nnn}\marg{\# of normal lines} -% \marg{default width} \marg{delta offset list} \\ -% \DescribeMacro{\setGALrightparshape:nnn} -% Defines a special parshape (that is it sets the \PARM{parshape} -% taking into account its current setting with respect to the galley -% measure) at the left or the right starting with -% a number of normal lines (first arg) followed by a number of special -% lines which are constructed assuming a hole of a certain width -% (second argument). The number of lines this hole exists vertically is -% defined by the number of delta offsets in the in comma separated -% third argument. The width of each delta is added to the nominal -% width of the hole thus allowing for special corrections on a line by -% line basis. -% -% -% -% \subsection{Manipulating the static galley parameters values} -% -% Manipulating the static galley parameters essentially means changing -% the default values to which these parameters are restored to at the -% end of each paragraph. These commands always set the corresponding -% dynamic parameter as well. -% -% \noindent -% \DescribeMacro{\setSGPVthing:nn} \marg{id} \marg{value}\\ -% Like |\setDGPVthing:nn| but for long-term changes, e.g., no -% processing of \meta{value} is undertaken. -% -% \noindent -% \DescribeMacro{\setSGPVdimension:nn} \marg{id} \marg{value} \\ -% Like |\setDGPVdimension:nn| but for long-term changes, e.g., the -% \meta{value} is evaluated using calc prior to assigning it to the -% parameter. -% -% There are no commands for making long-term changes to other parts of -% the interface. Mostly because they seemed to be unnecessary. If -% needed they could be added without much problem. -% -% -% -% \subsection{Manipulating the galley measure} -% -% In the current implementation the galley measure, i.e., the width of -% text lines and their indentation from the left are not represented -% by a galley parameter directly. Instead they are internally stored -% as part of the \PARM{parshape} (see discussion above). For -% this reason that parameter can't be (or rather shouldn't be) -% modified directly but only through the commands below and commands -% like |\setGALleftparshape:nnn| which know baout those dependencies -% and handle the update accordingly. -% -% \noindent -% \DescribeMacro{\setSGPVmeasure:nn} \marg{left-margin} -% \marg{line-width} \\ -% This command make a long-term change to the measure by setting the -% width of -% the line to \meta{line-width} and the width of the left margin to -% \meta{left-margin}. In addition it sets the registers |\linewidth| -% and |\@totalleftmargin| to these values (for inspection). -% -% \noindent -% \DescribeMacro{\addSGPVmeasure:nn} -% \marg{left-margin-increment} \marg{line-width-increment}\\ -% This command make a long-term change to the measure by incrementing the -% width of of the line with \meta{line-width-increment} and the width -% of the left margin with \meta{left-margin-increment}. In addition -% it sets the registers |\linewidth| -% and |\@totalleftmargin| to the resulting values (for inspection). -% -% -% -% -% -% \subsection{Saving and restoring SGPV changes} -% -% \DescribeMacro{\GALsavegalleystate:} \\ -% \DescribeMacro{\GALrestoregalleystate:} This pair of commands stores -% and retrieves the current state of the SGPVs and can be used with -% environments that want to make long term changes and revert to the -% old settings afterwards, i.e. use |\GALsavegalleystate:| at the -% beginning, before doing any modification, and then -% |\GALrestoregalleystate:| at the end. They should be called at the -% same level of grouping (as the saving is done locally) and with the -% current implementation they can't be called several times on the -% same level.\footnote{Or so i think; which is something we may not be -% able to leave as that} -% -% -% \subsection{Manipulating the behavior of \texttt{\textbackslash par}} -% -% The |\par| command in \TeX{} is perhaps the most troublesome item of -% the language for the simple reason that it can't be sucessfully -% trapped by the macro programmer and hidden from (mis)use. -% When \TeX{} sees an empty line it converts it into the token |\par| -% and this name is fixed and can't be changed. It is easy to provide -% special definitions for the action taken when this token is -% processed but there is no way to prevent somebody from overwriting -% those carefully designed interfaces by simply doing something like -% |\let\par\foo|. If this happens anything might go wrong and since -% |\par| is a name that can't be hidden from the user nor from the -% package designer the only thing one can do is to boldly state that -% \begin{center} -% \bfseries Manual changes to |\par| are not supported! -% \end{center} -% -% Having said this we now present the interfaces that can be used to give -% |\par| a special meaning within \LaTeXplus. It should be stressed -% that |\par| always has a special meaning within the galley mechanism -% and that direct changes to it, at best lead to incorrect formatting, -% far more likely however will lead to disaster. -% -% \noindent -% \DescribeMacro{\setGALnormalpar:}\\ -% This command defines |\par| to have its standard definition within -% the galley mechanism, i.e., if a paragraph is currently processed it -% will be finished (including all code necessary, e.g., execute end of -% paragraph hooks) and preparations are undertaken to initialize the -% data structure to be ready to processes inter-paragraph material -% and/or start a new paragraph. -% -% \noindent -% \DescribeMacro{\setGALignoredpar:n} \marg{error text}\\ -% The -% |\setGALignoredpar:n| changes |\par| so that it does nothing for -% a while, outputting the \meta{error text} after 3 successive -% |\par|s.\footnote{That command should probably be replaced in favor -% of the one below as it is quite dangerous if used in horizontal -% mode (see comments in the code section, there may be no way to -% gain control!)} -% -% \noindent -% \DescribeMacro{\setGALendlistpar:} -% A special definition for |\par| at the end of list like -% structures. The code for this is currently not functional, some -% ideas regarding this can be found in section~\ref{sec:endlist} -% and in the code section. -% -% \noindent -% \DescribeMacro{\GALignorepars:n}\marg{error text} \\ -% A sort of |\ignorespaces| but for spaces and |\par|s. Should of -% course only be used as the last command in expansion (and may need -% support within |\end| handling---the latter is not done) -% -% -% \section{Open issues} -% -% In this section unresolved issues or ideas to think about and -% perhaps implement are collected. There is no particular order to -% them. -% -% \begin{itemize} -% \item -% It seems advisable to change the way galleys are set up: don't -% automatically start a new galley with each vbox but instead start -% a galley only in dedicated ``galley-boxes'' such as the internal -% form of |\parbox| etc. The advantage is much less overhead, the -% disadvantage is that non-conforming packages (written without this -% mechanism in mind) will 99\% fall over while with the current setup -% they have a good chance to survive and produce more or less proper -% formatting. -% \item -% |\@totalleftmargin| and |\linewidth| need to be adequately dealt -% with, probably by integrating them properly into the data structure -% somehow at the parshape level. -% \item -% It is quite likely that we need more granularity on the interfaces -% for storing and restoring the galley state. There need to be a -% full store and restore for cases where an unrelated galley is -% started in the middle of some other galley (such as formatting a -% marginal paragraph in the middle of the main galley) but it is not -% appropriate to store and restore the whole galley state when -% formatting a list inside a galley (what is wanted there is to -% store and restore the outer measure, the outer parshape, etc.\ but -% not any registers which deal with penalties, vertical spaces -% between paragraphs and so on. So |\GALsavegalleystate:| needs some -% companion! -% \item -% Not properly integrated into the whole scheme are math displays -% (Michael Downes will hopefully come to rescue me here at some point). -% \end{itemize} -% -% -% -% \StopEventually{} -% -% \section{Implementation} -% -% Set up certain defaults including to ignore white space -% within the body of this package. \LaTeXe{} release needs to be -% recent because of changing some bits of the |\parbox| handling below. -% \begin{macrocode} -%<*package> -\NeedsTeXFormat{LaTeX2e}[1998/12/01] -\RequirePackage{ldcsetup} -% \end{macrocode} -% -% \begin{macrocode} -\RequirePackage{xhj} % taken out of this file -% \end{macrocode} -% -% \begin{macrocode} -\IgnoreWhiteSpace -% \end{macrocode} -% -% The code does use `:' characters in command names (basically -% inherited from expl3 and property list code I took from there for -% the first proto-type implementation). Right now it is a bit of a -% nuisance since using `:' should either be integrated into -% |\IgnoreWhiteSpace| and friends or otherwise probably not be -% used. -% \begin{macrocode} -\catcode`\:=11\relax -% \end{macrocode} -% -% -% \subsection{Tracing} -% -% \begin{macro}{\tracinggalleys} -% A complicated mechanism like the galley interface needs some -% tracing facilities. Here we provide some modeled after -% \TeX's internal low-level tracing functions. -% \begin{macrocode} -\def\tracinggalleys{\afterassignment\@tracinggalleys\count@} -%<-trace>\let\@tracinggalleys\relax -% \end{macrocode} -% -% If we compile this module without tracing than |\tracinggalleys| -% will scan away an integer assignment but otherwise does -% nothing. But if we docstrip with tracing included then depending -% on the integer values the following things happen: -% \begin{description} -% \item[0] No tracing. -% \item[1] All tracing info is written to the log file only. -% \item[2] All tracing info is written to the terminal. -% \item[3 and higher] All tracing info is written to the terminal -% and before it is presented a quick check for other internal -% \TeX{}-tracing is undertaken. If it looks as if |\tracingall| -% is currently used then various tracings are temporarily disable -% to avoid getting the output of the tracing being traced as -% well. This prevents getting many many uninteresting output -% lines which would otherwise appear. -% -% This value can only be used if e\TeX{} in extended mode is used -% as the formatter, as it sets |\tracingassigns|\footnote{Really -% useful that primitive, try it one day if you got stuck while -% macro writing, that alone is worth using e\TeX{} for.} which is -% not a primitive of \TeX. -% \end{description} -% -% \begin{macrocode} -%<*trace> -\def\@tracinggalleys{ - \ifcase \count@ - \let\GAL@typeout\@gobble -% \end{macrocode} -% -% We can't let |\Gal@typout| simply to |\wlog| if we don't want to see -% tracing on the screen since that does expand its argument and -% produces havoc in some cases, so here is a slightly slower variant. -% \begin{macrocode} - \or - \def\GAL@typeout ##1{ - \begingroup - \let\protect\@unexpandable@protect - \wlog {##1} - \endgroup - } -% \end{macrocode} -% If |\tracinggalleys| is set to 2 we show a lot of tracing data. -% \begin{macrocode} - \or - \let\GAL@typeout\typeout -% \end{macrocode} -% And another variant when lowlevel tracing is called for. This -% version does assume that e\TeX{} is being used as it tries to set -% |\tracingassigns|, so it will fail if this assumption is incorrect. -% \begin{macrocode} - \else - \def\GAL@typeout ##1{ - \ifnum\tracingmacros>\z@ - \begingroup - \tracingassigns\z@ - \tracingcommands\z@ - \tracingrestores\z@ - \tracingmacros\z@ - \typeout{##1} - \endgroup - \else - \typeout{##1} - \fi - } - \fi -} -%</trace> -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\GAL@typeout} -% This macro is used below to display some tracing info. By default -% no tracing happens. -% \begin{macrocode} -\let\GAL@typeout\@gobble -% \end{macrocode} -% \end{macro} -% -% -% -% \subsection{Taking away primitives from direct use} -% -% To make this mechanism work we have to shield the primitive \TeX{} -% parameters from direct access by the user or a package writer. We do -% this by giving them internal names of the type -% |\GAL@@|\meta{param-name} and the allocating under the original -% parameter name a suitable register to trap any direct access. -% -% We have to trap |\clubpenalty| and |\interlinepenalty|; both are used -% to prohibit page breaking in paragraphs. -% \begin{macrocode} -\let\GAL@@clubpenalty\clubpenalty -\newcount\clubpenalty -\let\GAL@@interlinepenalty\interlinepenalty -\newcount\interlinepenalty -% \end{macrocode} -% -% See comments below why this is not needed. -% \begin{macrocode} -%\let\GAL@@brokenpenalty\brokenpenalty -%\newcount\brokenpenalty -% \end{macrocode} -% -% And of course we have to trap |\everypar| since this token register -% is one of the central bits of the algorithm. It is used to gain -% control at the start of a new paragraph and actually put the stored -% galley data structure for inter-paragraph material onto the page. -% \begin{macrocode} -\let\GAL@@everypar\everypar -\newtoks\everypar -% \end{macrocode} -% -% Not sure if we really need to trap |\parindent|, anyway here it is: -% \begin{macrocode} -\let\GAL@@parindent\parindent \GAL@@parindent\z@ -\newdimen\parindent -% \end{macrocode} -% -% The |\parskip| parameter is a real nuisance, we really do not want -% it at all as we handle our inter-paragraph spaces ourself. However, -% we can't get rid of it, best we can do is to make it always zero. -% -% Setting the then alocated |\parskip| register will not have any -% effect at all.\footnote{Perhaps it should: i.e., at least produce a -% warning or error message.} -% \begin{macrocode} -\let\GAL@@parskip\parskip \GAL@@parskip\z@ -\newskip\parskip -% \end{macrocode} -% -% The next block is trapping those parameters which are responsible -% for the justification, ie -% \begin{macrocode} -\let\GAL@@leftskip\leftskip -\newskip\leftskip -\let\GAL@@rightskip\rightskip -\newskip\rightskip -\let\GAL@@parfillskip\parfillskip -\newskip\parfillskip \parfillskip\@flushglue -% \end{macrocode} -% -% And while we are at it, we might as well allocate two additional -% skips which are related to justification: |\GAL@@startskip| the -% counterpart to |\GAL@@parfillskip| at the beginning of the paragraph -% and |\GAL@@linefillskip| which will hold the space to be inserted -% before a forced newline (as in |\\|). -% \begin{macrocode} -\newskip\GAL@@startskip -\newskip\GAL@@linefillskip -% \end{macrocode} -% -% |\spaceskip| and |\xspaceskip| are needed when doing proper ragged -% settings so they are part of the interface. -% \begin{macrocode} -\let\GAL@@spaceskip\spaceskip -\newskip\spaceskip -\let\GAL@@xspaceskip\xspaceskip -\newskip\xspaceskip -% \end{macrocode} -% -% The next is not yet (but perhaps it should be as well). -% \begin{macrocode} -\let\GAL@@lineskip\lineskip -\newskip\lineskip -% \end{macrocode} -% -% -% -% \subsection{Some extra scratch registers} -% -% Those registers are needed by the mutator functions and we better -% not rely on general scratch registers (at least not for the -% moment). The box register is for the indentation box. -% \begin{macrocode} -\newcount\GAL@cnta -% \end{macrocode} -% -% \begin{macrocode} -\newskip\GAL@skipa -\newskip\GAL@skipb -% \end{macrocode} -% -% \begin{macrocode} -\newbox\GAL@boxa -% \end{macrocode} -% -% -% -% \subsection{Galley data structure}\label{sec:galley-concept-impl} -% -% \subsubsection{Original concepts} -% -% In earlier implementations of \texttt{galley2.dtx}, galley objects -% have been represented in the following fashion: -% -% \begin{itemize} -% \item the long range values are stored in a within one level in -% global a plist with the name |\GAL@static@hmode@plist| which is a -% property list keeping all individual galley values for hmode. The -% keys in the property list are of the form -% |\GAL@|\meta{letter(s)}|@|. -% \item a copy of this plist is saved away under the name -% |\GAL@static@hmode@|\meta{level-num}|@plist| just before we start -% a new level so that when returning to a level the previous state can -% be reconstructed.\footnote{Instead of doing a global save under a -% name associated with the level number we could probably simply -% save the list locally and use the savestack since each new level -% has to be always associated with a new group anyway!} -% \item the keys in the above plists are also used directly as global -% variables holding the actual current values of the galley object -% parameters which allows fast access. -% \item similar plists exists for vmode and perhaps we want even -% more\footnote{but perhaps not, putting the parameters in different -% plists is mainly a speed thing, we can use flags to reinit only -% things that have changed; the lists are shorter which makes -% property handling faster, etc, but it needs some careful studying -% at a later stage whether this is really beneficial---in principle -% there is no problem with keeping all parameters in a single plist.} -% \end{itemize} -% This means that to make a long-term change to some galley object -% parameter one has to change the property within the -% |\GAL@static@|\meta{h/v}|mode@plist|. Such a change is then -% propagated to both the saved version as well as the global key -% commands. -% -% \subsubsection{Current concepts} -% -% After some evaluation I decided to change this setup in favour of -% the following: -% -% \begin{itemize} -% \item Actual values are represented by global control sequences of -% the form |\GAL@|\meta{letter(s)}|@|. -% \item If they are supposed to be reset after each usage their -% long-term (static) value is recorded globally in -% |\GAL@|\meta{letter(s)}|@s|. -% \item When starting a new galley level saved versions of the -% dynamic parameters are stored locally in |\GAL@|\meta{letter(s)}|@l| -% and those for the static parameters are stored in -% |\GAL@|\meta{letter(s)}|@sl|. When the level is popped those values -% are used to restore the state of the parameters. A consequence of -% this setup is that starting a new galley state should always involve -% a new group level! -% \end{itemize} -% This means that to make a long-term change to some galley object -% parameter one has to change the the |\GAL@|\meta{letter(s)}|@s| -% parameter (if it exists) as well as the |\GAL@|\meta{letter(s)}|@| -% one. -% -% If a new parameter is added to this setup we have to modify the -% following functions below: |\GAL@init@static|, -% |\GAL@save@galleystate|, \\ -% |\GAL@restore@galleystate|, and -% |\GAL@init@dynamic@fully|. -% -% \begin{macro}{\GAL@init@static} -% The |\GAL@init@static| function initialises the static and dynamic -% parameters with fixed defaults. This is, for example, used when -% starting a new level. At a later state one probably want to be able -% to globally set even those defaults for a whole document, but for -% now this is probably okay. -% -% \begin{macrocode} -\def\GAL@init@static { - \gdef\GAL@b@s {\z@} - \gdef\GAL@p@s {\z@} - \gdef\GAL@v@s {-1sp} - \gdef\GAL@uv@s {\z@} - \gdef\GAL@up@s {} - \gdef\GAL@pw@s {} - \gdef\GAL@j@s {\z@\leftskip\rightskip\parfillskip - \spaceskip\xspaceskip\parfillskip\parindent} - \gdef\GAL@o@s {} - \gdef\GAL@ps@s {} - \gdef\GAL@i@s {\z@} - \gdef\GAL@nw@s {} - \gdef\GAL@q@s {} -% \end{macrocode} -% -% The definition of |\par| is kind of static.\footnote{Do we need -% to set the internal version of \texttt{\textbackslash everypar} -% as well?} -% \begin{macrocode} - \setGALnormalpar: -% \end{macrocode} -% -% Having the static parameter updated we have to initialise the -% dynamic ones as well. -% \begin{macrocode} - \GAL@init@dynamic@fully -% \end{macrocode} -% The seldom used parameters for linebreaking and -% hyphenation are not subject to the galley concept but are set for -% the whole galley. For this reason the code below should be moved -% outside this macro. -% -% We interface to a default template instance so that the default -% can be easily overwritten on the class level.\footnote{bad idea? -% good idea?} -% \begin{macrocode} - \UseInstance{hj}{default} -%% alternative -%% \UseInstance{hyphenation}{default} -%% \UseInstance{linebreak}{default} -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\GALsavegalleystate:} -% The |\GALsavegalleystate:| function saves away a copy of the current -% static plists in a way that it can be retrieved when returning to -% the current level. In the new implementation this means locally -% saviing all the dynamic parameters to their local counterparts -% (i.e., |\GAL@|\meta{letter}|@| to |\GAL@|\meta{letter}|@|l) and the -% same for the static parameters. -% \begin{macrocode} -\def\GALsavegalleystate: { - \let\GAL@b@l \GAL@b@ - \let\GAL@p@l \GAL@p@ - \let\GAL@v@l \GAL@v@ - \let\GAL@uv@l \GAL@uv@ - \let\GAL@up@l \GAL@up@ - \let\GAL@pw@l \GAL@pw@ - \let\GAL@j@l \GAL@j@ - \let\GAL@o@l \GAL@o@ - \let\GAL@ps@l \GAL@ps@ - \let\GAL@i@l \GAL@i@ - \let\GAL@nw@l \GAL@nw@ - \let\GAL@q@l \GAL@q@ -% - \let\GAL@b@sl \GAL@b@s - \let\GAL@p@sl \GAL@p@s - \let\GAL@v@sl \GAL@v@s - \let\GAL@uv@sl \GAL@uv@s - \let\GAL@up@sl \GAL@up@s - \let\GAL@pw@sl \GAL@pw@s - \let\GAL@j@sl \GAL@j@s - \let\GAL@o@sl \GAL@o@s - \let\GAL@ps@sl \GAL@ps@s - \let\GAL@i@sl \GAL@i@s - \let\GAL@nw@sl \GAL@nw@s - \let\GAL@q@sl \GAL@q@s -% \end{macrocode} -% The current definition of |\par| is handled manually (really -% manually)\footnote{Now this is pretty dangerous but i'm not sure -% this can be avoided: if \texttt{\textbackslash par} is being -% manually changed outside the control of these macros we might end up -% in deep shit. For example the old definition of tabular does this -% and the result is pretty bad, ie endless loop with -% \texttt{\textbackslash par} being a noop. any ideas?} -% \begin{macrocode} - \let\saved@GAL@par\par -% \end{macrocode} -% We also have to track the state of the |\GAL@reassign@list|: -% \begin{macrocode} - \let\saved@GAL@reassign@list\GAL@reassign@list -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\GALrestoregalleystate:} -% And here we have the reverse operation which is needed when we -% return to a previous level. -% \begin{macrocode} -\def\GALrestoregalleystate: { - \global\let\GAL@b@ \GAL@b@l - \global\let\GAL@p@ \GAL@p@l - \global\let\GAL@v@ \GAL@v@l - \global\let\GAL@uv@ \GAL@uv@l - \global\let\GAL@up@ \GAL@up@l - \global\let\GAL@pw@ \GAL@pw@l - \global\let\GAL@j@ \GAL@j@l - \global\let\GAL@o@ \GAL@o@l - \global\let\GAL@ps@ \GAL@ps@l - \global\let\GAL@i@ \GAL@i@l - \global\let\GAL@nw@ \GAL@nw@l - \global\let\GAL@q@ \GAL@q@l -% - \global\let\GAL@b@s \GAL@b@sl - \global\let\GAL@p@s \GAL@p@sl - \global\let\GAL@v@s \GAL@v@sl - \global\let\GAL@uv@s \GAL@uv@sl - \global\let\GAL@up@s \GAL@up@sl - \global\let\GAL@pw@s \GAL@pw@sl - \global\let\GAL@j@s \GAL@j@sl - \global\let\GAL@o@s \GAL@o@sl - \global\let\GAL@ps@s \GAL@ps@sl - \global\let\GAL@i@s \GAL@i@sl - \global\let\GAL@nw@s \GAL@nw@sl - \global\let\GAL@q@s \GAL@q@sl -% \end{macrocode} -% \begin{macrocode} - \global\let\par\saved@GAL@par - \global\let\GAL@reassign@list\saved@GAL@reassign@list -% \end{macrocode} -% As long as we to not set up the individual paragraph shape -% parameters each time (see comments in -% |\GAL@set@horizontal@objects|) we have to restore them at this -% point as well. -% \begin{macrocode} - \expandafter \setup@paragraph@justification \GAL@j@ -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\saved@GAL@par} -% Recover from confusion: the top-level definition of |\saved@GAL@par| -% should never get assigned to |\par| but in case it is (by getting -% the grouping wrong) we better try to recover -% gracefully\footnote{Gracefully meaning I haven't bothered with -% producing anything other than an undefined csname error :-)}, so -% instead of ending up with a |\par| being an undefined command we do -% the following: -% \begin{macrocode} -\def\saved@GAL@par{\ERROR\GAL@normal@par} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\GAL@init@dynamic@as@necessary} -% Whenever parameters got changed for one paragraph the -% |\GAL@reassign@list| gets extended with an assignment that resets -% the parameter back to its static value. The -% |\GAL@init@dynamic@as@necessary| then executes this list and afterwards -% define it to be empty. -% \begin{macrocode} -\def\GAL@init@dynamic@as@necessary { -%<*trace> - \GAL@typeout{Reinit~ parameters \on@line} - \GAL@typeout{\@spaces \meaning \GAL@reassign@list} -%</trace> - \GAL@reassign@list - \global\let\GAL@reassign@list\@empty -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\GAL@init@dynamic@fully} -% Sometimes we want to ensure that all parameter are set to their -% static values. This is done by the |\GAL@init@dynamic@fully| macro.. -% \begin{macrocode} -\def\GAL@init@dynamic@fully { -%<*trace> - \GAL@typeout{Reinit~ parameters \on@line} -%</trace> - \global\let\GAL@b@ \GAL@b@s - \global\let\GAL@p@ \GAL@p@s - \global\let\GAL@v@ \GAL@v@s - \global\let\GAL@uv@ \GAL@uv@s - \global\let\GAL@up@ \GAL@up@s - \global\let\GAL@pw@ \GAL@pw@s - \global\let\GAL@j@ \GAL@j@s - \global\let\GAL@o@ \GAL@o@s - \global\let\GAL@ps@ \GAL@ps@s - \global\let\GAL@i@ \GAL@i@s - \global\let\GAL@nw@ \GAL@nw@s - \global\let\GAL@q@ \GAL@q@s -% \end{macrocode} -% And since everything is as the static value there is nothing for -% us to reassign so be make this list empty. -% \begin{macrocode} - \global\let\GAL@reassign@list\@empty -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\GAL@reassign@list} -% The |\GAL@reassign@list| holds the parameters that need to be -% reset at the next paragraph or more exactly it holds the -% assignments that do the resetting. So by default this is empty. -% \begin{macrocode} -\let\GAL@reassign@list\@empty -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\GAL@prepare@reassign:NN} -% The |\GAL@prepare@reassign:NN| macro receives the internal names -% of dynamic and and static placeholder for a parameter and extends -% the |\GAL@reassign@list|. -% \begin{macrocode} -\def\GAL@prepare@reassign:NN #1#2{ -% \end{macrocode} -% It might pay off to make a quick check whether or not the value -% of the dynamic parameter really differs from those of the static -% one. If not we can avoid updating the |\GAL@reassign@list| which -% takes some time and further more makes later updates of this list -% slower.\footnote{This needs some empirical testing: if most -% of the time this test results in false then it might be better to -% remove it though. One such test indicated that removal might be -% better but this isn't far from being conclusive.} -% \begin{macrocode} - \ifx#1#2 - \else - \appendtoDGPV@internal:Nn\GAL@reassign@list - {\global \let #1 #2 } - \fi -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\GAL@prepare@reassign:n} -% In contrast |\GAL@prepare@reassign:n| takes only the id for a -% parameter, such as |v| or |up|. It also has some extra code to -% check if the parameter is actually one that has both dynamic and -% static incarnations.\footnote{In the current implementation this -% is probably always the case but if we re-add \texttt{m} and -% \texttt{h} we may not want to reset them on every paragraph but -% handle them always as static for the whole galley.} If not we -% don't need to reassign.\footnote{Furthermore, for speed -% consideration it might be advisable to internally always replaces -% the call to this command by \texttt{GAL@prepare@reassign:NN} -% since this will always saves at least one extra csname parsing.} -% \begin{macrocode} -\def\GAL@prepare@reassign:n #1{ - \expandafter\ifx \csname GAL@#1@s\endcsname \relax -%<*trace> - \GAL@typeout{Not~ reassigning~ for~ #1!} -%</trace> - \else - \expandafter - \GAL@prepare@reassign:NN - \csname GAL@#1@ \expandafter \endcsname - \csname GAL@#1@s \endcsname - \fi -} -% \end{macrocode} -% \end{macro} -% -% -% -% -% -% \subsubsection{Starting and ending a level} -% -% The |\GAL@start@level| command first saves away the current state -% and then starts a new group. This group (|\bgroup|) will be matched -% by the closing brace of the current ``vbox'' either the explicit |}| -% or an |\egroup| equivalent of that. The |\GAL@cleanup@level| which -% then gets into control is supposed to restore the state and finally -% issue and |\egroup| which will then actually end the box. -% -% \begin{macro}{\GAL@start@level} -% \begin{macrocode} -\def\GAL@start@level{ - \GALsavegalleystate: - \bgroup -%<*trace> - \advance\GAL@level@num\@ne - \GAL@typeout{Entering~ galley~ level:~ - \the\GAL@level@num~ \on@line} -%</trace> - \GAL@init@static - \@GAL@if@first@on@leveltrue % temp solution! - % see below - \aftergroup\GAL@cleanup@level} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\GAL@level@num} -% The counter is really only necessary if tracing is compiled in, -% however we define it always just to ensure that the allocation -% doesn't change if tracing is added. -% \begin{macrocode} -\newcount\GAL@level@num -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\if@GAL@if@first@on@level} -% This belongs to some hack which needs some better -% implementation. It signals that we are at the beginning of a galley. -% \begin{macrocode} -\newif\if@GAL@if@first@on@level -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\GAL@cleanup@level} -% \begin{macrocode} -\def\GAL@cleanup@level{ - \par - \GAL@finish@typesetting -%<*trace> - \GAL@typeout{Returning~ to~ galley~ level:~ \the\GAL@level@num~ \on@line} -%</trace> - \GALrestoregalleystate: - \egroup -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\GAL@finish@typesetting} -% At the end of a galley (if in vmode) we have to ensure that we -% don't have any dangling bits in the data structure (like -% untypeset specials or writes that want to make their appearance -% at the beginning of the next paragraph. This is what -% |\GAL@finish@typesetting| is supposed to take care -% of\footnote{one day}. -% \begin{macrocode} -\def\GAL@finish@typesetting {} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\everyvbox} -% We start a new galley with every vbox. -% \begin{macrocode} -\everyvbox{\GAL@start@level} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\insert} -% Interestingly enough |\everyvbox| is not triggered by |\inserts| -% even though those are also vboxes so we have to do it manually -% here (and that is a bit of a pain~\ldots). -% \begin{macrocode} -\let\@@insert\insert -% \end{macrocode} -% There are cases where after the |\insert| we have stuff like -% |\csname ...\endcsname| and to ensure that we don't fall over in -% that case our redefinition has to be a bit elaborate. Of course -% all this is only of interest if we stay with the current -% implementation of always automatically starting a galley. -% \begin{macrocode} -\long\def\insert #1#{\@insert{#1}} -\long\def\@insert #1#2{\@@insert#1{\GAL@start@level#2\par}} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\GAL@ignore@next@galley} -% \begin{macro}{\GAL@ignore@next@galley@vbox} -% We may not need the next two commands at all if we change from -% setting up a galley everywhere to setting up galleys only for -% ``minipage'' like vboxes. And i think we should! -% \begin{macrocode} -\def\GAL@ignore@next@galley{ - \everyvbox{\global\everyvbox{\GAL@start@level}} -} -\def\GAL@ignore@next@galley@vbox{ - \everyvbox{\global\everyvbox{\GAL@start@level}}\vbox -} -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% -% \subsubsection{Using the galley data structure} -% -% \begin{macro}{\GAL@show@datastructure} -% Some tracing to show the state of the data structure. -% As some internal params take arbitrary content we have to be a bit careful -% displaying them. Needs (some:-) improvement to be useful. -% \begin{macrocode} -%<*trace> -\def \GAL@show@datastructure #1{ - \GAL@typeout{#1^^J - \@spaces nominal~ width~ =~ \the\hsize ^^J - \@spaces left~ indentation~ =~ \the\@totalleftmargin ^^J - \@spaces break~ switch~ (b)~ =~ \GAL@b@ \space (\GAL@b@s) ^^J - \@spaces v-penalty~ (p)~ =~ \GAL@p@ \space (\GAL@p@s) ^^J - \@spaces v-space~ (v)~ =~ \GAL@v@ \space (\GAL@v@s) ^^J - \@spaces user~ v-penalty~ (up)~ =~ \GAL@up@ ^^J - \@spaces user~v-space~ (uv)~ =~ \GAL@uv@ ^^J - \@spaces prev-whatits~ (pw)~ =~ \meaning \GAL@pw@ ^^J - \@spaces next-whatits~ (nw)~ =~ \meaning \GAL@nw@ ^^J - \@spaces parshape~spec~ (ps)~ =~ \GAL@ps@ \space (\GAL@ps@s) ^^J - \@spaces queries~ (q)~ =~ \meaning \GAL@q@ ^^J - \@spaces indent~ flag~ (i)~ =~ \GAL@i@ \space (\GAL@i@s) ^^J - \@spaces para~ object~ (o)~ =~ \meaning \GAL@o@ ^^J - \@spaces para~ justification~ (j)~ =~ \meaning \GAL@j@ } -} -%</trace> -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\GAL@use@on@para} -% The next function is called when \TeX{} switches to horizontal mode, -% i.e., at the start of a paragraph. -% -% \begin{macrocode} -\def\GAL@use@on@para{ -%<*trace> - \GAL@show@datastructure{Para~ start~ for~ galley~ - level~ \the\GAL@level@num \on@line} -%</trace> -% \end{macrocode} -% At the start of a new galley we do not want to have any vertical -% space being inserted not even a zero |\parskip| since that would -% mess up use of |\vtop| etc. The below is a sort of crude fix for -% the problem ie this is the old minipage switch. -% -% What about a redesign??? -% \begin{macrocode} - \if@GAL@if@first@on@level - \GAL@handle@first@para - \else -% \end{macrocode} -% -% -% We want to return to vmode without leaving too much trace. so we -% remove the indentation box and call |\endgraf|. All this is done -% in a group to keep an already setup |\parshape|, eg in a list. In -% fact we might want to have this parshape setting as part of the -% galley-objects but this is not done so far.\footnote{There is a -% problem with code like this which was the result of a pr in -% \LaTeXe. If the start of a paragraph is triggered by certain very -% special commands (such as encoding-specific accents that involve -% grouping) we might have the case that such a command already -% started a group and then triggers the paragraph mechanism which -% in turn triggers this macro. That may result in those groups to -% overlap in a bad way---needs some clear instruction perhaps -% \texttt{\textbackslash leavevmode} in all potential cases.} -% \begin{macrocode} - \begingroup - \global\setbox\GAL@boxa\lastbox - \endgraf - \GAL@set@vertical@objects -% \end{macrocode} -% Before reentering h-mode we better clear the everypar register or -% we end up in a loop: -% \begin{macrocode} - \GAL@@everypar{} - \noindent - \endgroup - \fi -% \end{macrocode} -% Instead of setting up the measure each time one could probably -% move this to the template setting things up (or not?) -% \begin{macrocode} - \GAL@set@measure - \GAL@set@horizontal@objects -% \end{macrocode} -% At this point during the processing the parameters are all -% reinitialised, i.e., anything not yet used will be -% lost!\footnote{This is important if you think about paragraph -% ending stuff which is not yet implemented} -% \begin{macrocode} - \GAL@init@dynamic@as@necessary -} -% \end{macrocode} -% \end{macro} -% -% -% -% \begin{macro}{\GAL@handle@first@para} -% Since this part of the code from above is not used that often it was -% placed into a separate command (for faster skipping). -% -% What needs to be done always? -% \begin{macrocode} -\def\GAL@handle@first@para { - \@GAL@if@first@on@levelfalse - \GAL@pw@ -% \end{macrocode} -% \begin{macrocode} - \@tempskipa \GAL@uv@ \relax - \ifdim \@tempskipa =\z@ \else -% \end{macrocode} -% \begin{macrocode} - \ifhmode - \begingroup - \global\setbox\GAL@boxa\lastbox - \endgraf - \vskip \@tempskipa - \GAL@@everypar{} - \noindent - \endgroup - \else - \vskip \@tempskipa - \fi - \fi -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\GAL@use@on@vobject} -% The other case where (part of) the galley data structure is going to -% be used is the case when we are already in vertical mode but want to -% append some vertical mode material (e.g., a rule, an inline float) -% or start some environment that likes to look like a paragraph even -% though it doesn't actually uses \TeX's low-level mechanisms (e.g., -% longtable?, tabbing, \ldots). -% \begin{macrocode} -\def\GAL@use@on@vobject{ -%<*trace> - \GAL@show@datastructure{V-object~ for~ galley~ - level~ \the\GAL@level@num \on@line} -%</trace> - \if@GAL@if@first@on@level - \GAL@handle@first@para - \else - \GAL@set@vertical@objects - \fi - \GAL@init@dynamic@as@necessary -} -% \end{macrocode} -% The use of this command should be followed by a |\nobreak| after the -% v-object or else we introduce an unwanted breakpoint due to the next -% |\parskip| being inserted. -% -% \end{macro} -% -% -% \begin{macro}{\GAL@set@vertical@objects} -% When setting the vertical components of the galley structure the -% following happens: -% \begin{itemize} -% \item First any whatsits for the previous para are -% inserted\footnote{A nobreak is probably not necessary at this -% point as the -% parskip should by now already be inserted so that the next -% thing happening is an explicit penalty anyway.} -% \item -% If a document user command for penalties as been used (i.e., when -% \PARM{user penalty} is none-empty) it take precidence and the internal -% penalty value is ignored. -% \item -% Otherwise the \PARM{break switch} is checked. If this greater -% zero a nobreak penalty is issued and \PARM{penalty} is ignored. -% \item -% Otherwise the \PARM{penalty} value is used. -% \end{itemize} -% -% \begin{macrocode} -\def \GAL@set@vertical@objects { - \GAL@pw@ - \penalty - \ifx \GAL@up@ \@empty - \ifnum \GAL@b@ > \z@ - \@M - \else - \GAL@p@ \relax - \fi - \else - \GAL@up@ \relax - \fi -% \end{macrocode} -% A user skip as supplied by |\vspace| etc.\ is going into a -% separate register to ensure that it will always have the effect -% of adding extra space independent of what surrounding -% environments do. -% -% The |\parskip| below is not the \TeX{} primitive (which is always -% zero) but a user level register which is only applied at this -% point if ever. -% \begin{macrocode} - \GAL@skipa \GAL@v@ \relax - \vskip \ifdim -% \end{macrocode} -% |\parskip| gets applied if we are between two paragraphs without -% any further space requests; this is signalled by |\GAL@v@| having -% a value of |-1sp| (its default). Of course it is in theory -% possible that this value is the result to modification of -% |\GAL@v@| but allowing for this saves us an extra flag or -% register that would otherwise be needed and checked every time. -% \begin{macrocode} - \GAL@skipa = -1sp \parskip -%<*trace> - \GAL@typeout{\parskip=\the\parskip\space applied} -%</trace> - \else - \GAL@skipa - \fi - \vskip \GAL@uv@ \relax -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\GAL@set@measure} -% Some comments on the next macro: -% not sure: do we better set parshape global? (can we?); of course it -% could and perhaps should be run inline, also we might instead add -% |\parshape| to the required content of |\GAL@ps@| so that we avoid -% the test and simply execute it always. -% -% \begin{macrocode} -\def \GAL@set@measure { - \parshape - \ifx\GAL@ps@\@empty - \z@ - \else - \GAL@ps@ - \fi -} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\GAL@set@horizontal@objects} -% Once we are back in hmode we first output any waiting whatsits, then -% run any query setups, then -% look at the saved indentation box: if it is void we know that we had -% a paragraph started with \noindent otherwise we typeset some -% indentation then the galley object and finally a horizontal skip -% (might also want a break penalty there or even more stuff). -% -% \begin{macrocode} -\def \GAL@set@horizontal@objects { - \GAL@nw@ - \GAL@q@ -% \end{macrocode} -% The shape is now a multi-valued parameter so we pass it expanded -% and let |\setup@paragraph@justification| do the assignments if necessary. -% -% As a speedup measure we are comparing |\GAL@j@| to the saved -% version |\GAL@j@s|, if they are identical we assume that all -% components of the multi-valued parameter are already properly set -% up. This saves doing 8 assignments at every paragraph. The catch -% is, that a change to the static parameter (via |\setSGPVthing:nn| -% |s|) needs to be manually followed by running -% |\setup@paragraph@justification| (see definition of -% \texttt{justification} template).\footnote{Actually, -% that shortcut does not work correctly! Needs thought! So commented out for the -% moment!} -% \begin{macrocode} -% \ifx \GAL@j@ \GAL@j@s % what is the right test to suppress? -% \GAL@typeout{Not~ setting~ up~ paragraph~ shape} -% \else - \expandafter \setup@paragraph@justification \GAL@j@ -% \fi - \ifnum \GAL@i@ = \z@ - \ifvoid\GAL@boxa \else \hb@xt@ \GAL@@parindent{} \fi - \fi - \GAL@o@ \relax - \hskip \GAL@@startskip \relax - \setup@page@breaking@penalties \GAL@b@ -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\setup@page@breaking@penalties} -% The way the following code is written (at the moment) -% |\clubpenalty|, |\interlinepenalty|, and |\brokenpenalty| are still -% available as user level registers so that setting up, say, the -% broken penalty default for the whole document is done via setting -% that particular register. -% -% Another observation is that we most likely do not have to set -% |\GAL@@brokenpenalty| at all (and if |\GAL@@interlinepenalty| is -% set to `nobreak' we can also leave |\GAL@@clubpenalty| alone) -% since if i read it right these penalties are additive so one -% large one should be sufficient. -% -% \begin{macrocode} -\def \setup@page@breaking@penalties #1{ - \GAL@@clubpenalty \clubpenalty - \GAL@@interlinepenalty \interlinepenalty -% \GAL@@brokenpenalty \brokenpenalty - \ifcase #1 -% 0 - \or -% 1 - \or -%2 - \GAL@@clubpenalty \@M -% \GAL@@brokenpenalty \@M - \or -%3 - \GAL@@interlinepenalty \@M -% \GAL@@brokenpenalty \@M - \else -% assume negative: this loops if called with a value greater than 3! so -% probably can't stay this way. - \setup@page@breaking@penalties {-#1} - \fi -} -% \end{macrocode} -% \end{macro} -% -% -% -% \begin{macro}{\setup@paragraph@justification} -% Setting up the inner paragraph shape, e.g., the justification is -% done by breaking up the multi-value parameter |s| into its 8 -% components.\footnote{Do one has to make those settings global? Check!} -% \begin{macrocode} -\def \setup@paragraph@justification #1 #2 #3 #4 #5 #6 #7 #8{ - \global \GAL@@startskip #1 \relax - \global \GAL@@leftskip #2 \relax - \global \GAL@@rightskip #3 \relax - \global \GAL@@parfillskip #4 \relax - \global \GAL@@spaceskip #5 \relax - \global \GAL@@xspaceskip #6 \relax - \global \GAL@@linefillskip#7 \relax - \global \GAL@@parindent #8 \relax -} -% \end{macrocode} -% \end{macro} -% -% -% \subsection{Handling of \texttt{\textbackslash par}} -% -% Depending on the state of the machinery |\par| might a get different -% definition. -% -% \begin{macro}{\GAL@normal@par} -% In most cases |\par| will be |\let| to |\GAL@normal@par|. -% \begin{macrocode} -\def \GAL@normal@par { - \begingroup - \ifvmode - \endgraf - \else %% For error-trapping needs - %% \ifinner \ifhmode etc cases -% \end{macrocode} -% At this point we might want to add and end par hook (not done); -% if we are not adding one then this definition can be optimised a lot -% (moving |\endgraf| up and using |\ifhmode| instead of the above. -% \begin{macrocode} - \endgraf - %%%% NOTE: this puts us into vmode with the para on the galley - %%%% AND rignt here we have stuff that has migrated - %%%% (eg vadjust stuff) from the last line!!! - \nobreak - \fi - \endgroup -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\@@par} -% \LaTeX's saved version of the original |\par| primitive now needs -% actually run |\GAL@normal@par| to trick \LaTeX{} into accepting -% this redefinition. This is needed at least as long as if we run -% with a mixture of old and new code. -% \begin{macrocode} -\let\@@par\GAL@normal@par -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\GAL@endlist@par} -% -% Another potential definition of |\par| comes into play when we -% are at the end of a list environment and want to take different -% actions depending on getting a continution of the paragraph or a -% real end. This code is not functional! -% -% ATTENTION: most likely either have to set those locally or have -% to save the state of |\par| as well! And anyway it is not -% finished code yet!!!! -% -% \begin{macrocode} -%<*unfinished> -\def \GAL@endlist@par { - \begingroup - \ifvmode - \addDGPVdimension:nn v \GAL@v@X - \addDGPVdimension:nn i \GAL@i@X - \addGALpenalty:n \GAL@p@X - \setGALnormalpar: - \else - \endgraf - \nobreak - \fi - \endgroup -} -%</unfinished> -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\setGALnormalpar:} -% The |\setGALnormalpar:| states that we are in normal operation. -% \begin{macrocode} -\def\setGALnormalpar:{ - \global\let\par\GAL@normal@par -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\setGALendlistpar:} -% The |\setGALendlistpar:| states that we want to handle the end -% of list case. -% \begin{macrocode} -%<*unfinished> -\def\setGALendlistpar:{ - \global\let\par\GAL@endlist@par -} -%</unfinished> -% \end{macrocode} -% \end{macro} -% -% -% For ignoring |\par| commands we currently have two functions. -% -% \begin{macro}{\setGALignoredpar:n} -% The |\setGALignoredpar:n| command disables |\par| altogether and -% hopes that the beginning of another paragraph shows up soon -% (three |\par|s are allowed). If not it issues an error message -% (arg 1) and redefines |\par| to be |\GAL@normal@par|. -% \begin{macrocode} -\def \setGALignoredpar:n #1 { - \ifvmode - \global \par@deathcycles \z@ - \global\let\par\GAL@ignored@par - \gdef\GAL@ignored@par@error{#1} - \appendtoDGPVthing:nn q \setGALnormalpar: -% \end{macrocode} -% Not sure what should be done if this gets executed in hmode: a) -% ignore the request b) output an error message c) run it and with -% it have the rest of the document being typeset into a single -% paragraph :-)? Since c) isn't really an option we have to take -% some precaution, for the moment i have added an error but perhaps -% this should be restricted to appear really only in hmode as an -% error not in a |\write|, say, so maybe the test should be for -% hmode --- or perhaps the whole commands should be removed in -% favour of the one below. -% \begin{macrocode} - \else - \ERROR \setGALnormalpar: \par - \fi -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\GAL@ignored@par} -% Helper function for |\setGALignoredpar:n|. -% \begin{macrocode} -\def\GAL@ignored@par{ - \global \advance\par@deathcycles \@ne - \ifnum \par@deathcycles > \thr@@ - \PackageError{galley2}\GAL@ignored@par@error\@ehd - \setGALnormalpar: - \par - \fi -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\GALignorepars:n} -% An alternative is to explicitly look out for |\par| and spaces -% (the point being that this immediately set the definition of -% |\par| back to its normal value if anything else is encountered). -% Again up to three |\par|s are accepted otherwise we get an error -% message. -% \begin{macrocode} -\def \GALignorepars:n #1 { - \global \par@deathcycles \z@ - \global\let\par\GAL@ignore@next@pars - \gdef\GAL@ignored@par@error{#1} - \GAL@ignore@next@pars -} -% \end{macrocode} -% \end{macro} -% -% -% -% -% \begin{macro}{\GAL@ignore@next@pars} -% And here is a helper for |\GALignorepars:n|. -% \begin{macrocode} -\def\GAL@ignore@next@pars { - \global \advance\par@deathcycles \@ne - \ifnum \par@deathcycles > \thr@@ - \PackageError{galley2}\GAL@ignored@par@error\@ehd - \setGALnormalpar: - \par - \fi - \@ifnextchar\par{}{\setGALnormalpar:} -} -% \end{macrocode} -% \end{macro} -% -% -% -% -% \subsection{Support for paragraph shapes} -% -% -% \begin{macro}{\GAL@for} -% Next macro is a reimplementation of |\@for| to get rid of the |:| -% \begin{macrocode} -\long\def\GAL@for#1#2\do#3{% - \expandafter\def\expandafter\@fortmp\expandafter{#2}% - \ifx\@fortmp\@empty \else - \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}\fi} -% \end{macrocode} -% \end{macro} -% -% -% -% -% \begin{macro}{\parshape@setup} -% The |\parshape@setup| macro provides a low-level interface for -% declaring special parshapes for the upcoming paragraph. It is -% especially tuned to deal with the more common cases like -% providing space for an initial or for an inline figure. It takes -% six arguments with the following meaning: -% \begin{itemize} -% \item If a hole is to be cut on the left of the paragraph the -% first argument should be |{\the\parshape@lineindent}| otherwise -% |\@totalleftmargin| (hole on the right). At the moment there is -% no provision for special shapes on both sides of the -% paragraph.\footnote{This is low-level but still more than awkward -% so probably should be replaced by something nicer one day.} -% \item -% The second argument gives the indentation to be used for all -% lines following the last special line. Typical value would be -% |\@totalleftmargin|, or in case of setting up hanging paragraphs, -% |\@totalleftmargin+<amount of hang>|. More exactly this indentation -% is assumed to be what is needed if this would have been a normal -% paragraph. It is therefore also added to the special lines. -% \item -% The third argument gives the line width for all lines following -% the last special line. Typical argument might be |\linewidth| or -% in case of hanging paragraphs -% |\linewidth+<amount of hang>|.\footnote{rewrite -% description of this and previous item} -% \item -% The forth argument gives the number of lines before the first special -% line (in case of an initial this would be 0 typically). -% \item -% The fifth argument gives an initial amount to be left free on all -% special lines. -% \item -% Finally the sixth argument specifies the special lines as a comma -% separated lists of dimensions. These dimensions are deltas to the -% space specified in the forth argument. -% \end{itemize} -% -% Running this command has several effects: -% \begin{itemize} -% \item -% The |\GAL@ps@| parameter is getting updated, ie it receives the -% area parshape spec. -% \item -% In the command |\parshape@firstlineindent| the indent of the -% first special line (not taking into account the standard line -% indentation) is made available for use by an -% application. This can be used to get to the left point on the -% line to insert an initial character or a figure. -% \end{itemize} -% -% \begin{macrocode} -\def \parshape@setup #1 #2 #3 #4 #5 #6{ -% \end{macrocode} -% -% \begin{macrocode} - \setlength\@tempdima{#2} - \setlength\@tempdimb{#3} - \global\let\GAL@ps@\@gobble % remove upcoming space below -% \end{macrocode} -% -% \begin{macrocode} - \parshape@linecnt \z@ - \@whilenum \parshape@linecnt < #4 \do - { \xdef\GAL@ps@{\GAL@ps@\space - \the\@tempdima\space \the\@tempdimb - } - \advance \parshape@linecnt \@ne - } -% \end{macrocode} -% -% \begin{macrocode} - \GAL@for\parshape@next#6\do - { - \advance\parshape@linecnt\@ne - \setlength\parshape@lineindent{\@tempdima+#5+\parshape@next} - \setlength\parshape@linewidth - {\@tempdima+\@tempdimb-\parshape@lineindent} - -% \end{macrocode} -% -% \begin{macrocode} -% \setlength\parshape@linewidth -% {\@tempdimb-#5-(\parshape@next)} -% \setlength\parshape@lineindent -% {\@tempdima+\@tempdimb-\parshape@linewidth} -% \end{macrocode} -% -% If we setting up the first special line we record the indentation -% used compared to a normal paragraph at this point. The -% |\parshape@firstlineindent| is not part of the galley structure -% thus we store it locally. -% \begin{macrocode} - \ifnum\parshape@linecnt=\@ne - \@tempdimc \parshape@lineindent - \advance\@tempdimc -\@tempdima - \edef\parshape@firstlineindent{\the\@tempdimc} - \fi -% \end{macrocode} -% -% \begin{macrocode} - \xdef\GAL@ps@{\GAL@ps@\space - #1\space - \the\parshape@linewidth} - } -% \end{macrocode} -% -% \begin{macrocode} - \advance\parshape@linecnt\@ne - \xdef\GAL@ps@{\the\parshape@linecnt\space - \GAL@ps@\space - \the\@tempdima\space \the\@tempdimb} -%<*trace> - \GAL@typeout{\space\space set~ ps = \GAL@ps@}% -%</trace> -% \end{macrocode} -% -% \begin{macrocode} - \GAL@prepare@reassign:NN \GAL@ps@ \GAL@ps@s -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macrocode} -\newcount\parshape@linecnt -\newlength\parshape@lineindent -\newlength\parshape@linewidth -% \end{macrocode} -% -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% \subsection{Short-term mutators} -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% All these functions only modify the DGPV, i.e., the one that gets -% reset after use. -% -% -% \subsubsection{Dimensions (skips and dimens)} -% -% -% For setting galley parameters of type skip or dimen we provide -% functions which take as their first argument an identifier -% (typically a single character) that identifies the parameter to -% change, e.g., `v' for vertical skip or `i' for indentation and as -% second argument a dimension (for setting the parameter to this -% value or adding this value or using the maximum of the old and the -% new value, etc).\footnote{They currently work using skip registers -% internally which means that it is up to the programmer to ensure -% that a dimen parameter gets passed only dimen values without plus -% or minus parts.} -% -% -% -% \begin{macro}{\setDGPVdimension:nn} -% |\setDGPVdimension:nn| sets the parameter specified by the first -% argument to the value given as the second argument. -% \begin{macrocode} -\def\setDGPVdimension:nn #1#2{% #1=v/h #2=value - \calc@assign@skip\GAL@skipb{#2} -%<*trace> - \GAL@typeout{\space\space set~ #1 = #2 = \the\GAL@skipb}% -%</trace> - \expandafter \xdef - \csname GAL@#1@\endcsname - {\the\GAL@skipb} - \GAL@prepare@reassign:n{#1} -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\addDGPVdimension:nn} -% -% |\addDGPVdimension:nn| add to the parameter specified by the first -% argument the value given as the second argument. -% \begin{macrocode} -\def\addDGPVdimension:nn #1#2{% #1=v/h/... #2=value - \GAL@skipb\csname GAL@#1@ \endcsname\relax -% \end{macrocode} -% Since the value of -1sp is (at least for the v parameter) used as -% a special flag we are a bit careful when adding so that we are -% not off by -1sp: this is not visible but in certain situations -% \TeX{} might be upset even by this tiny amount.\footnote{Really -% necessary?} -% \begin{macrocode} - \ifdim\GAL@skipb=-1sp - \calc@assign@skip\GAL@skipb{#2} - \else - \calc@assign@skip{\advance\GAL@skipb}{#2} - \fi -%<*trace> - \GAL@typeout{\space\space set~ #1 =+ #2 = \the\GAL@skipb} -%</trace> - \expandafter - \xdef - \csname GAL@#1@\endcsname - {\the\GAL@skipb} - \GAL@prepare@reassign:n{#1} -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\maxDGPVdimension:nn} -% |\maxDGPVdimension:nn| compares the current value of the -% parameter specified by the first argument with the value given as -% the second argument and stores the maximum of -% them.\footnote{Current \LaTeX's \texttt{\textbackslash addvspace} -% works quite differently and we may have to provide something else -% here (or in addition)} -% \begin{macrocode} -\def\maxDGPVdimension:nn #1#2{ - \GAL@skipa\csname GAL@#1@\endcsname\relax - \calc@assign@skip\GAL@skipb{#2} - \ifdim\GAL@skipa<\GAL@skipb - \expandafter - \xdef - \csname GAL@#1@\endcsname - {\the\GAL@skipb} - \GAL@prepare@reassign:n{#1} - \fi -%<*trace> - \GAL@typeout{\space\space set~ #1 = - max(\the\GAL@skipa,\the\GAL@skipb) ^^J\@spaces\@spaces - = \csname GAL@#1@\endcsname} -%</trace> -} -% \end{macrocode} -% \end{macro} -% -% -% -% \subsubsection{Integers} -% -% From previous coding we still have things like |\setGALpenalty:n| --- -% i guess one could normalise this to an interface like -% |\setGALinteger| \ldots -% -% \begin{macro}{\setGALpenalty:n} -% we can either set the `penalty' object or add to it. To speed things -% up we use a mixture of calc and low-level \TeX{} conventions -% -% \begin{macrocode} -\def\setGALpenalty:n #1{% - \calc@assign@count\GAL@cnta{#1} - \xdef \GAL@p@ {\the\GAL@cnta} -%<*trace> - \GAL@typeout{\space\space set~ p = #1 = \the\GAL@cnta} -%</trace> - \GAL@prepare@reassign:NN \GAL@p@ \GAL@p@s -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\addGALpenalty:n} -% -% \begin{macrocode} -\def\addGALpenalty:n #1{% - \GAL@cnta \GAL@p@ \relax - \calc@assign@count{\advance\GAL@cnta}{#1} - \xdef \GAL@p@ {\the\GAL@cnta} -%<*trace> - \GAL@typeout{\space\space set~ p += #1 = \the\GAL@cnta} -%</trace> - \GAL@prepare@reassign:NN \GAL@p@ \GAL@p@s -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\setGALbreak:n} -% The |\setGALbreak:n| sets the switch that controls page breaking -% \begin{macrocode} -\def\setGALbreak:n #1{% values 0, 1, 2, or 3 -%<*trace> - \GAL@typeout{\space\space set~ b = #1 } -%</trace> - \gdef \GAL@b@ {#1} - \GAL@prepare@reassign:NN \GAL@b@ \GAL@b@s -} -% \end{macrocode} -% \end{macro} -% -% -% -% -% \subsubsection{Objects and thingies in general} -% -% \begin{macro}{\setGALobject:n} -% -% For the `o' object i've implemented only a `set' command so far -% (have to see what kind of usage this gets first) -% -% \begin{macrocode} -\def\setGALobject:n #1{ - \gdef \GAL@o@ {#1} - \GAL@prepare@reassign:NN \GAL@o@ \GAL@o@s -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\setDGPVthing:nn} -% A generalised version of that is |\setDGPVthing:nn|. -% \begin{macrocode} -\def\setDGPVthing:nn #1 #2{ - \expandafter \gdef \csname GAL@#1@\endcsname {#2} - \GAL@prepare@reassign:n{#1} -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\appendtoDGPVthing:nn} -% \begin{macro}{\appendtoDGPVthing:no} -% And here is another one which appends code to the right of the -% parameter: -% \begin{macrocode} -\def\appendtoDGPVthing:nn #1#2{ - \expandafter\appendtoDGPV@internal:Nn\csname GAL@#1@\endcsname {#2} - \GAL@prepare@reassign:n{#1} -} -\def\appendtoDGPVthing:no #1#2{ - \expandafter\appendtoDGPV@internal:No\csname GAL@#1@\endcsname {#2} - \GAL@prepare@reassign:n{#1} -} -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% -% \begin{macro}{\appendtoDGPV@internal:Nn} -% \begin{macro}{\appendtoDGPV@internal:No} -% These are internals which look suspiciently like some macros -% already present a million times in \LaTeX{}. -% \begin{macrocode} -\def\appendtoDGPV@internal:Nn #1 #2{ - \expandafter \gdef \expandafter #1 \expandafter - {#1 #2} -} -\def\appendtoDGPV@internal:No #1 #2{ - \expandafter\appendtoDGPV@internal:Nn\expandafter #1\expandafter {#2} -} -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% \subsubsection{Paragraph shapes} -% -% \begin{macro}{\setGALleftparshape:nnn} -% \begin{macro}{\setGALrightparshape:nnn} -% Setting a parshape on the left or the right for the next -% paragraph, e.g., an initial. Not implemented so far is doing -% something special on both sides. -% \begin{macrocode} -\def \setGALleftparshape:nnn { - \parshape@setup {\the\parshape@lineindent} \@totalleftmargin - \linewidth } -\def \setGALrightparshape:nnn { - \parshape@setup \@totalleftmargin \@totalleftmargin \linewidth -} -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% -% \begin{macro}{\GALhangfrom:n} -% And here a reimplementation of |\@hangfrom| but obeying -% |\@totalleftmargin| indentation. -% \begin{macrocode} -\def \GALhangfrom:n #1 { - \setbox\@tempboxa\hbox{{#1}} - \parshape@setup {\the\parshape@lineindent} - {\@totalleftmargin+\wd\@tempboxa} - {\linewidth-\wd\@tempboxa} - \z@ - \z@ - {-\wd\@tempboxa} - \noindent\box\@tempboxa} -\let \@hangfrom \GALhangfrom:n -% \end{macrocode} -% \end{macro} -% -% -% -% -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% \subsection{Long-term mutators} -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% The following functions now modify the SGPV, i.e., modify the -% values that are used as defaults unless overwritten for an -% individual paragraph. Right now I don't see any purpose in providing -% computation support at this level other than something like calc -% expansion; so need one function per parameter type. Otherwise a -% single function would be sufficient. -% -% \subsubsection{Objects and thingies in general} -% -% \begin{macro}{\setSGPVthing:nn} -% So here is one that simply stores away the value in the right plist -% under the right key. In addition we also directly update the key -% command itself to avoid having to run something like -% |\GAL@init@hmode| afterwards. -% \begin{macrocode} -\def\setSGPVthing:nn #1 #2 { - \setDGPVthing:nn {#1} {#2} - \global\expandafter - \let\csname GAL@#1@s \expandafter\endcsname - \csname GAL@#1@ \endcsname -} -% \end{macrocode} -% \end{macro} -% -% -% \subsubsection{Dimensions (skips and dimens)} -% -% \begin{macro}{\setSGPVdimension:nn} -% The |\setSGPVdimension:nn| first sets the dynamic part of the -% parameter (which is done using calc expansion) followed by -% updating the static part of the parameter. -% \begin{macrocode} -\def\setSGPVdimension:nn #1 #2 { - \setDGPVdimension:nn {#1} {#2} - \global\expandafter - \let\csname GAL@#1@s \expandafter\endcsname - \csname GAL@#1@ \endcsname -} -% \end{macrocode} -% \end{macro} -% -% -% \subsubsection{Paragraph shapes} -% -% \begin{macro}{\setSGPVmeasure:nn} -% Dealing with the parshape: the long term modification is essentially -% setting the measure and to support old \LaTeX{} code also sets -% |\linewidth| and |\@totalleftmargin| (but see comments on this somewhere!) -% -% \begin{macrocode} -\def \setSGPVmeasure:nn #1 #2 { - \setlength\@totalleftmargin{#1} - \setlength\linewidth{#2} - \xdef\GAL@ps@s{\@ne\space - \the\@totalleftmargin\space \the\linewidth} - \global\let\GAL@ps@\GAL@ps@s -} -% \end{macrocode} -% \end{macro} -% -% -% \begin{macro}{\addSGPVmeasure:nn} -% This is a variant modifies the measure (the name is -% horrible) by adding to |\@totalleftmargin| and |\linewidth|. Note -% that you normally need to substract from |\linewidth| if -% |\@totalleftmargin| is enlarged! -% \begin{macrocode} -\def \addSGPVmeasure:nn #1 #2 { - \addtolength\@totalleftmargin{#1} - \addtolength\linewidth{#2} - \xdef\GAL@ps@s{\@ne\space - \the\@totalleftmargin\space \the\linewidth} - \global\let\GAL@ps@\GAL@ps@s -} -% \end{macrocode} -% \end{macro} -% -% -% -% \subsubsection{Integers} -% -% No functions provided. For consistency reasons there probably should -% some in the end. -% -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% \subsection{Higher level commands} -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% -% \begin{macro}{\vspace} -% The |*| of |\vspace| is parsed but not handled in this -% implementation yet! -% \begin{macrocode} -\DeclareDocumentCommand \vspace {s m } - { - \addDGPVdimension:nn{uv}{#2} - } -% \end{macrocode} -% \end{macro} -% -% -% -% \begin{macro}{\addvspace} -% |\addvspace| is quite a bit different to the latex original, this -% needs changing! -% \begin{macrocode} -\def\addvspace#1{ - \maxDGPVdimension:nn{v}{#1} -} -% \end{macrocode} -% \end{macro} -% -% -% -% \begin{macro}{\addpenalty} -% \begin{macrocode} -\def\addpenalty#1{ - \addGALpenalty:n{#1} -} -% \end{macrocode} -% \end{macro} -% -% -% -% -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% \subsection{Templates (first ideas)} -% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% Code in this section is essentially left over from previous -% versions. Most templates have been moved to different files already. -% -% The endlist template is rubbish and just for testing the concept -% itself! and not finished either! -% -% \begin{macrocode} -\RequirePackage{template} -\RequirePackage{xparse} -% \end{macrocode} -% -% \begin{macrocode} -\DeclareTemplateType{endlist}{0} - -\DeclareTemplate{endlist}{std}{0}{ - penalty =+C \GAL@p@ , - vspace =+L \GAL@v@ , - parindent =+L \GAL@i@ , - par-penalty =+C [0] \GAL@p@X , - par-vspace =+L [\z@] \GAL@v@X , - par-parindent =+L [\z@] \GAL@i@X , - } - {\DoParameterAssignments - \setGALendlistpar:} - -\DeclareInstance{endlist}{list}{std}{ - penalty = 999 , - vspace = 10pt , - parindent = 0pt , - par-penalty = -1000 , - par-vspace = 5pt , - par-parindent = 10pt , - } -% \end{macrocode} -% -% -% -% -% \subsection{Initialisation} -% -% \begin{macrocode} -\GAL@init@static % this is to be after the templates by now - -\GAL@@everypar{\GAL@use@on@para\the\everypar} - -% \end{macrocode} -% -% We need to initialize again at start of document i fear to ensure -% that stuff like the hyphenation is set up properly (this needs some -% further thoughts!) -% \begin{macrocode} -\AtBeginDocument { - \GAL@init@static % this is to be after the templates by now -} -% \end{macrocode} -% -% \section{Updated code from \texttt{latex.ltx}} -% -% There are a bunch of additional code lines which are originally from -% \texttt{latex.ltx} and have been updated (in part) to use the new -% mechanism. This isn't really worth printing as most of that is not -% fully done or obsolete by redefinition of, say, code for lists, -% etc. But one might want to have a look at it at some stage. For this -% reason the code contains an |\end{document}| at this point. which -% you may or may not want to remove. -% -% \PrintIndex -% -% \end{document} -% -% \begin{macrocode} -\def\@@line#1{\GAL@use@on@vobject\hb@xt@\hsize{#1}\nobreak} - -\long\def \@savemarbox #1#2{% - \global\setbox #1% - \color@vbox - \vtop{% - \hsize\marginparwidth - \@parboxrestore - \@marginparreset - #2% - \par % needed nowadays! - \@minipagefalse - \outer@nobreak - }% - \color@endbox -} - -\long\def\@footnotetext#1{\insert\footins{% - \reset@font\footnotesize - \interlinepenalty\interfootnotelinepenalty - \splittopskip\footnotesep - \splitmaxdepth \dp\strutbox \floatingpenalty \@MM - \hsize\columnwidth \@parboxrestore - \protected@edef\@currentlabel{% - \csname p@footnote\endcsname\@thefnmark - }% - \color@begingroup - \@makefntext{% - \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox\par}% %ditto!!! - \color@endgroup}}% - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% -% all latex.ltx commands that involved the @nobreak flag -% -% most of them have been modified to use the new structure but not all -% and not all correctly (see comments within the code - -%<*trace> -\def\showGALcmd#1{\GAL@typeout{In~#1: \the\GAL@level@num~ \on@line}} -%</trace> - -\def\@afterheading{ -%<*trace> - \showGALcmd{@afterheading} -%</trace> - \if@afterindent \else - \setDGPVthing:nn i \@ne - \fi - \setGALbreak:n 2 -} - -\def\nofiles{% -%<*trace> - \showGALcmd{} -%</trace> - \@fileswfalse - \typeout{No auxiliary output files.^^J}% - \long\def\protected@write##1##2##3% - {\write\m@ne{}% -% -% i think that the following code can simply vanish since if we are in -% vmode and the \PARM{break flag} is set then the GAL mechansim will -% automatically add a penalty 10000 at the right point; correct? -% -%\if@nobreak\ifvmode\nobreak\fi\fi}% - } - \let\makeindex\relax - \let\makeglossary\relax} - -\long\def \protected@write#1#2#3{% -%<*trace> - \showGALcmd{protected@write} -%</trace> - \begingroup - \let\thepage\relax - #2% - \let\protect\@unexpandable@protect - \edef\reserved@a{\write#1{#3}}% - \appendtoDGPVthing:no {nw} \reserved@a - \endgroup -% -% see above -% -% \if@nobreak\ifvmode\nobreak\fi\fi -} - -\def\markboth#1#2{\gdef\@themark{{#1}{#2}}{% -%<*trace> - \showGALcmd{} -%</trace> - \let\protect\@unexpandable@protect - \let\label\relax \let\index\relax \let\glossary\relax - \mark{\@themark}}% -% -%\if@nobreak\ifvmode\nobreak\fi\fi -} - -\def\markright#1{{\let\protect\@unexpandable@protect -%<*trace> - \showGALcmd{} -%</trace> - \let\label\relax \let\index\relax \let\glossary\relax - \expandafter\@markright\@themark - {#1}\mark{\@themark}}% -% -%\if@nobreak\ifvmode\nobreak\fi\fi -} - -\def \newpage {% -%<*trace> - \showGALcmd{newpage} -%</trace> - \if@noskipsec - \ifx \@nodocument\relax - \leavevmode - \global \@noskipsecfalse - \fi - \fi - \if@inlabel - \leavevmode - \global \@inlabelfalse - \fi -% -% newpage is supposed to stop any \PARM{nobreak flag}, so the right -% approach is probably something like -% - \ifnum \GAL@b@ > \z@ - \setGALbreak:n 0 - \fi -% -% \if@nobreak \@nobreakfalse \everypar{}\fi -% - \par - \vfil - \penalty -\@M} -% -% -% the |\@arrayparboxrestore| nothing else than initialising a new -% galley level (in the old \LaTeX) so most of what is there needs -% either to vanish or to get integrated into the startup code of a new -% galley (not done yet) -% -\def\@arrayparboxrestore{% -%<*trace> - \showGALcmd{@arrayparboxrestore} -%</trace> -% -% again nothing to do (i think): if used as part of a minipage or -% parbox we are at a new level, otherwise we are probably not supposed -% to change that value -% -% \let\if@nobreak\iffalse - \let\if@noskipsec\iffalse - \let\par\@@par - \let\-\@dischyph - \let\'\@acci\let\`\@accii\let\=\@acciii - \parindent\z@ \parskip\z@skip - \everypar{}% - \linewidth\hsize - \@totalleftmargin\z@ - \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip - \parfillskip\@flushglue \lineskip\normallineskip - \baselineskip\normalbaselineskip - \sloppy} - -\def\@startsection#1#2#3#4#5#6{% -%<*trace> - \showGALcmd{@startsection} -%</trace> - \if@noskipsec \leavevmode \fi - \par - \@tempskipa #4\relax - \@afterindenttrue - \ifdim \@tempskipa <\z@ - \@tempskipa -\@tempskipa \@afterindentfalse - \fi -% -% the section case is interesting since the @nobreak flag is used for -% two things: a) to suppress a penalty if heading follow each other -% and be to suppress a skip in this case. This works because in latex -% the @nobreak switch is only set in the heading context (so is -% actually something like ``heading just seen flag'' -% -% not sure how to model something like this in general, for the moment -% i look at the \PARM{nobreak flag} but this is not correct! -% -% \if@nobreak -% \everypar{}% -% \else -% \addpenalty\@secpenalty\addvspace\@tempskipa -% \fi - \ifnum \GAL@b@ = \z@ - \addpenalty\@secpenalty\addvspace\@tempskipa - \fi - \@ifstar - {\@ssect{#3}{#4}{#5}{#6}}% - {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}} - -\def\@xsect#1{% -%<*trace> - \showGALcmd{@xsect} -%</trace> - \@tempskipa #1\relax - \ifdim \@tempskipa>\z@ - \par \nobreak - \vskip \@tempskipa - \@afterheading - \else - \global\@noskipsectrue -% \@nobreakfalse -% \everypar{% -% \if@noskipsec -% \global\@noskipsecfalse -% {\setbox\z@\lastbox}% -% \clubpenalty\@M -% \begingroup \@svsechd \endgroup -% \unskip -% \@tempskipa #1\relax -% \hskip -\@tempskipa -% \else -% \clubpenalty \@clubpenalty -% \everypar{}% -% \fi}% - \setDGPVthing:nn i \@ne - \setGALbreak:n 2 - \setGALobject:n { \begingroup \@svsechd \endgroup - \unskip } -% obey stupid latex startsection interface with negative numbers ... - \@tempskipa #1\relax - \setDGPVdimension:nn h {-\@tempskipa} -% -% the noskipsec flag is probably needed in interaction with lists as -% long as this is only a partial conversion so i do set it (maybe not) -% - \everypar{% - \if@noskipsec - \global\@noskipsecfalse - \else - \everypar{}% - \fi}% - \fi - \ignorespaces} - -\gdef\@specialoutput{% -%<*trace> - \showGALcmd{@specialoutput} -%</trace> - \ifnum \outputpenalty>-\@Mii - \@doclearpage - \else - \GAL@ignore@next@galley - \ifnum \outputpenalty<-\@Miii - \ifnum \outputpenalty<-\@MM \deadcycles \z@ \fi - \global \setbox\@holdpg \vbox {\unvbox\@cclv}% - \else - \global \setbox\@holdpg \vbox{% - \unvbox\@holdpg - \unvbox\@cclv - \setbox\@tempboxa \lastbox - \unskip - }% - \@pagedp \dp\@holdpg - \@pageht \ht\@holdpg - \unvbox \@holdpg - \@next\@currbox\@currlist{% - \ifnum \count\@currbox>\z@ - \advance \@pageht \@pagedp - \ifvoid\footins \else - \advance \@pageht \ht\footins - \advance \@pageht \skip\footins - \advance \@pageht \dp\footins - \fi - \ifvbox \@kludgeins - \ifdim \wd\@kludgeins=\z@ - \advance \@pageht \ht\@kludgeins - \fi - \fi - \@reinserts - \@addtocurcol - \else - \@reinserts - \@addmarginpar - \fi - }\@latexbug -% -% with the same argument as before we can always add the penalty, right? -% - \ifnum \outputpenalty<\z@ -% \if@nobreak -% \nobreak -% \else - \addpenalty \interlinepenalty -% \fi - \fi - \fi - \fi -} - -\def \@addtocurcol {% -%<*trace> - \showGALcmd{@addtocurcol} -%</trace> - \@insertfalse - \@setfloattypecounts - \ifnum \@fpstype=8 - \else - \ifnum \@fpstype=24 - \else - \@flsettextmin - \advance \@textmin \@textfloatsheight - \@reqcolroom \@pageht - \ifdim \@textmin>\@reqcolroom - \@reqcolroom \@textmin - \fi - \advance \@reqcolroom \ht\@currbox - \ifdim \@colroom>\@reqcolroom - \@flsetnum \@colnum - \ifnum \@colnum>\z@ - \@bitor\@currtype\@deferlist - \if@test - \else - \@bitor\@currtype\@botlist - \if@test - \@addtobot - \else - \ifodd \count\@currbox - \advance \@reqcolroom \intextsep - \ifdim \@colroom>\@reqcolroom - \global \advance \@colnum \m@ne - \global \advance \@textfloatsheight \ht\@currbox - \global \advance \@textfloatsheight 2\intextsep - \@cons \@midlist \@currbox -% -% same argument as before (perhaps incorrect here?) -% -% \if@nobreak -% \nobreak -% \@nobreakfalse -% \everypar{}% -% \else - \addpenalty \interlinepenalty -% \fi -% -% at least it seems to me that we should not use \vskip here -% -% -% however we should then also have a way to trigger the use of the -% GAL structure without actually starting hmode (note done so all -% this is incorrect) -% - \vskip \intextsep - \box\@currbox -% -% and neither here ... -% - \penalty\interlinepenalty - \vskip\intextsep - \ifnum\outputpenalty <-\@Mii \vskip -\parskip\fi - \outputpenalty \z@ - \@inserttrue - \fi - \fi - \if@insert - \else - \@addtotoporbot - \fi - \fi - \fi - \fi - \fi - \fi - \fi - \if@insert - \else - \@resethfps - \@cons\@deferlist\@currbox - \fi -} - -% and the whole item stuff is too complicated for me to really think -% about it tonight ... - -\def\@item[#1]{% -%<*trace> - \showGALcmd{@item} -%</trace> - \if@noparitem - \@donoparitem - \else - \if@inlabel - \indent \par - \fi - \ifhmode - \unskip\unskip \par - \fi - \if@newlist - \if@nobreak - \@nbitem - \else - \addpenalty\@beginparpenalty - \addvspace\@topsep - \addvspace{-\parskip}% - \fi - \else - \addpenalty\@itempenalty - \addvspace\itemsep - \fi - \global\@inlabeltrue - \fi - \everypar{% - \@minipagefalse - \global\@newlistfalse - \if@inlabel - \global\@inlabelfalse - {\setbox\z@\lastbox - \ifvoid\z@ - \kern-\itemindent - \fi}% - \box\@labels - \penalty\z@ - \fi - \if@nobreak - \@nobreakfalse - \clubpenalty \@M - \else - \clubpenalty \@clubpenalty - \everypar{}% - \fi}% - \if@noitemarg - \@noitemargfalse - \if@nmbrlist - \refstepcounter\@listctr - \fi - \fi - \sbox\@tempboxa{\makelabel{#1}}% - \global\setbox\@labels\hbox{% - \unhbox\@labels - \hskip \itemindent - \hskip -\labelwidth - \hskip -\labelsep - \ifdim \wd\@tempboxa >\labelwidth - \box\@tempboxa - \else - \hbox to\labelwidth {\unhbox\@tempboxa}% - \fi - \hskip \labelsep}% - \ignorespaces} - - -% \end{macrocode} -% -% -% \section{Fixing non-galley vboxes} -% -% \begin{macrocode} -\DeclareRobustCommand{\LaTeX}{L\kern-.36em% - {\sbox\z@ T% - \GAL@ignore@next@galley@vbox to\ht\z@{\hbox{\check@mathfonts - \fontsize\sf@size\z@ - \math@fontsfalse\selectfont - A}% - \vss}% - }% - \kern-.15em% - \TeX} -\DeclareTextCommandDefault{\textunderscore}{% - \leavevmode \kern.06em\GAL@ignore@next@galley@vbox{\hrule\@width.3em}} -\DeclareTextCommandDefault{\textvisiblespace}{% - \mbox{\kern.06em\vrule \@height.3ex}% - \GAL@ignore@next@galley@vbox{\hrule \@width.3em}% - \hbox{\vrule \@height.3ex}} -\gdef\showhyphens#1{% - \setbox0\vbox{% - \color@begingroup - \everypar{}% - \parfillskip\z@skip\hsize\maxdimen - \normalfont - \pretolerance\m@ne\tolerance\m@ne\hbadness\z@\showboxdepth\z@\ #1% - \color@endgroup}} -\catcode`\:=12 -\long\def\@imakepicbox(#1,#2)[#3]#4{% - \GAL@ignore@next@galley@vbox to#2\unitlength - {\let\mb@b\vss \let\mb@l\hss\let\mb@r\hss - \let\mb@t\vss - \@tfor\reserved@a :=#3\do{% - \if s\reserved@a - \let\mb@l\relax\let\mb@r\relax - \else - \expandafter\let\csname mb@\reserved@a\endcsname\relax - \fi}% - \mb@t - \hb@xt@ #1\unitlength{\mb@l #4\mb@r}% - \mb@b - \kern\z@}} -\catcode`\:=11 -\long\def\frame#1{% - \leavevmode - \hbox{% - \hskip-\@wholewidth - \GAL@ignore@next@galley@vbox{% - \vskip-\@wholewidth - \hrule \@height\@wholewidth - \hbox{% - \vrule\@width\@wholewidth - #1% - \vrule\@width\@wholewidth}% - \hrule\@height\@wholewidth - \vskip-\@wholewidth}% - \hskip-\@wholewidth}} -\def\@frameb@x#1{% - \@tempdima\fboxrule - \advance\@tempdima\fboxsep - \advance\@tempdima\dp\@tempboxa - \hbox{% - \lower\@tempdima\hbox{% - \GAL@ignore@next@galley@vbox{% - \hrule\@height\fboxrule - \hbox{% - \vrule\@width\fboxrule - #1% - \GAL@ignore@next@galley@vbox{% - \vskip\fboxsep - \box\@tempboxa - \vskip\fboxsep}% - #1% - \vrule\@width\fboxrule}% - \hrule\@height\fboxrule}% - }% - }% -} -\typeout{****~ Careful:~ there~ is~ another~ rewrite~ for~ iiiparbox~ in~ coffins!} - -\long\def\@iiiparbox#1#2[#3]#4#5{% - \leavevmode - \@pboxswfalse - \setlength\@tempdima{#4}% - \@begin@tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\@@par}% - \ifx\relax#2\else - \setlength\@tempdimb{#2}% - \def\@parboxto{to\@tempdimb}% - \fi - \GAL@ignore@next@galley - \if#1b\vbox - \else\if #1t\vtop - \else\ifmmode\vcenter - \else\@pboxswtrue $\vcenter - \fi\fi\fi - \@parboxto{\let\hss\vss\let\unhbox\unvbox - \csname bm@#3\endcsname}% - \if@pboxsw \m@th$\fi - \@end@tempboxa} -\def\@iiiminipage#1#2[#3]#4{% - \leavevmode - \@pboxswfalse - \setlength\@tempdima{#4}% - \def\@mpargs{{#1}{#2}[#3]{#4}}% - \setbox\@tempboxa\vbox\bgroup - \color@begingroup - \hsize\@tempdima - \textwidth\hsize \columnwidth\hsize - \@parboxrestore - \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@ - \let\@footnotetext\@mpfootnotetext - \let\@listdepth\@mplistdepth \@mplistdepth\z@ - \@minipagerestore - \@setminipage} -\long\def\@mpfootnotetext#1{% - \global\setbox\@mpfootins\vbox{% - \unvbox\@mpfootins - \reset@font\footnotesize - \hsize\columnwidth - \@parboxrestore - \protected@edef\@currentlabel - {\csname p@mpfootnote\endcsname\@thefnmark}% - \color@begingroup - \@makefntext{% - \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% - \color@endgroup}} -\def\@array[#1]#2{% - \GAL@ignore@next@galley - \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi - \bgroup - \setbox\@arstrutbox\hbox{% - \vrule \@height\arraystretch\ht\strutbox - \@depth\arraystretch \dp\strutbox - \@width\z@}% - \@mkpream{#2}% - \edef\@preamble{% - \ialign \noexpand\@halignto - \bgroup \@arstrut \@preamble \tabskip\z@skip \cr}% - \let\@startpbox\@@startpbox \let\@endpbox\@@endpbox - \let\tabularnewline\\% -% -% we can't allow uncontrolled changes of \par -% -%%%% \let\par\@empty - \let\@sharp##% - \set@typeset@protect - \lineskip\z@skip\baselineskip\z@skip - \ifhmode \@preamerr\z@ \@@par\fi - \@preamble} -\gdef\@shortstack[#1]{% - \leavevmode - \GAL@ignore@next@galley@vbox\bgroup - \baselineskip-\p@\lineskip 3\p@ - \let\mb@l\hss\let\mb@r\hss - \expandafter\let\csname mb@#1\endcsname\relax - \let\\\@stackcr - \@ishortstack} -\gdef\@ishortstack#1{\ialign{\mb@l {##}\unskip\mb@r\cr #1\crcr}\egroup} -\gdef\@stackcr{\@ifstar\@ixstackcr\@ixstackcr} -\gdef\@ixstackcr{\@ifnextchar[\@istackcr{\cr\ignorespaces}} -\gdef\@istackcr[#1]{\cr\noalign{\vskip #1}\ignorespaces} -\newif\if@negarg -\gdef\line(#1,#2)#3{\@xarg #1\relax \@yarg #2\relax - \@linelen #3\unitlength - \ifdim\@linelen<\z@\@badlinearg\else - \ifnum\@xarg =\z@ \@vline - \else \ifnum\@yarg =\z@ \@hline \else \@sline\fi - \fi - \fi} -\gdef\@sline{% - \ifnum\@xarg<\z@ \@negargtrue \@xarg -\@xarg \@yyarg -\@yarg - \else \@negargfalse \@yyarg \@yarg \fi -\ifnum \@yyarg >\z@ \@tempcnta\@yyarg \else \@tempcnta -\@yyarg \fi -\ifnum\@tempcnta>6 \@badlinearg\@tempcnta\z@ \fi -\ifnum\@xarg>6 \@badlinearg\@xarg \@ne \fi -\setbox\@linechar\hbox{\@linefnt\@getlinechar(\@xarg,\@yyarg)}% -\ifnum \@yarg >\z@ \let\@upordown\raise \@clnht\z@ - \else\let\@upordown\lower \@clnht \ht\@linechar\fi -\@clnwd \wd\@linechar -\if@negarg - \hskip -\wd\@linechar \def\reserved@a{\hskip -2\wd\@linechar}% -\else - \let\reserved@a\relax -\fi -\@whiledim \@clnwd <\@linelen \do - {\@upordown\@clnht\copy\@linechar - \reserved@a - \advance\@clnht \ht\@linechar - \advance\@clnwd \wd\@linechar}% -\advance\@clnht -\ht\@linechar -\advance\@clnwd -\wd\@linechar -\@tempdima\@linelen\advance\@tempdima -\@clnwd -\@tempdimb\@tempdima\advance\@tempdimb -\wd\@linechar -\if@negarg \hskip -\@tempdimb \else \hskip \@tempdimb \fi -\multiply\@tempdima \@m -\@tempcnta \@tempdima -\@tempdima \wd\@linechar \divide\@tempcnta \@tempdima -\@tempdima \ht\@linechar \multiply\@tempdima \@tempcnta -\divide\@tempdima \@m -\advance\@clnht \@tempdima -\ifdim \@linelen <\wd\@linechar - \hskip \wd\@linechar - \@picture@warn - \else\@upordown\@clnht\copy\@linechar\fi} -\gdef\@hline{\ifnum \@xarg <\z@ \hskip -\@linelen \fi -\vrule \@height \@halfwidth \@depth \@halfwidth \@width \@linelen -\ifnum \@xarg <\z@ \hskip -\@linelen \fi} -\gdef\@getlinechar(#1,#2){\@tempcnta#1\relax\multiply\@tempcnta 8% - \advance\@tempcnta -9\ifnum #2>\z@ \advance\@tempcnta #2\relax\else - \advance\@tempcnta -#2\relax\advance\@tempcnta 64 \fi - \char\@tempcnta} -\gdef\vector(#1,#2)#3{\@xarg #1\relax \@yarg #2\relax - \@tempcnta \ifnum\@xarg<\z@ -\@xarg\else\@xarg\fi - \ifnum\@tempcnta<5\relax - \@linelen #3\unitlength - \ifdim\@linelen<\z@\@badlinearg\else - \ifnum\@xarg =\z@ \@vvector - \else \ifnum\@yarg =\z@ \@hvector \else \@svector\fi - \fi - \fi - \else\@badlinearg\fi} -\gdef\@hvector{\@hline\hb@xt@\z@{\@linefnt - \ifnum \@xarg <\z@ \@getlarrow(1,0)\hss\else - \hss\@getrarrow(1,0)\fi}} -\gdef\@vvector{\ifnum \@yarg <\z@ \@downvector \else \@upvector \fi} -\gdef\@svector{\@sline - \@tempcnta\@yarg \ifnum\@tempcnta <\z@ \@tempcnta -\@tempcnta\fi - \ifnum\@tempcnta <5% - \hskip -\wd\@linechar - \@upordown\@clnht \hbox{\@linefnt \if@negarg - \@getlarrow(\@xarg,\@yyarg)\else \@getrarrow(\@xarg,\@yyarg)\fi}% - \else\@badlinearg\fi} -\gdef\@getlarrow(#1,#2){\ifnum #2=\z@ \@tempcnta'33 \else - \@tempcnta #1\relax\multiply\@tempcnta \sixt@@n \advance\@tempcnta - -9 \@tempcntb #2\relax\multiply\@tempcntb \tw@ - \ifnum \@tempcntb >\z@ \advance\@tempcnta \@tempcntb - \else\advance\@tempcnta -\@tempcntb\advance\@tempcnta 64 - \fi\fi\char\@tempcnta} -\gdef\@getrarrow(#1,#2){\@tempcntb #2\relax -\ifnum\@tempcntb <\z@ \@tempcntb -\@tempcntb\relax\fi -\ifcase \@tempcntb\relax \@tempcnta'55 \or -\ifnum #1<\thr@@ \@tempcnta #1\relax\multiply\@tempcnta -24\advance\@tempcnta -6 \else \ifnum #1=\thr@@ \@tempcnta 49 -\else\@tempcnta 58 \fi\fi\or -\ifnum #1<\thr@@ \@tempcnta=#1\relax\multiply\@tempcnta -24\advance\@tempcnta -\thr@@ \else \@tempcnta 51 \fi\or -\@tempcnta #1\relax\multiply\@tempcnta -\sixt@@n \advance\@tempcnta -\tw@ \else -\@tempcnta #1\relax\multiply\@tempcnta -\sixt@@n \advance\@tempcnta 7 \fi\ifnum #2<\z@ \advance\@tempcnta 64 \fi -\char\@tempcnta} -\gdef\@vline{\ifnum \@yarg <\z@ \@downline \else \@upline\fi} -\gdef\@upline{% - \hb@xt@\z@{\hskip -\@halfwidth \vrule \@width \@wholewidth - \@height \@linelen \@depth \z@\hss}} -\gdef\@downline{% - \hb@xt@\z@{\hskip -\@halfwidth \vrule \@width \@wholewidth - \@height \z@ \@depth \@linelen \hss}} -\gdef\@upvector{\@upline\setbox\@tempboxa\hbox{\@linefnt\char'66}\raise - \@linelen \hb@xt@\z@{\lower \ht\@tempboxa\box\@tempboxa\hss}} -\gdef\@downvector{\@downline\lower \@linelen - \hb@xt@\z@{\@linefnt\char'77\hss}} -\gdef\dashbox#1(#2,#3){\leavevmode\hb@xt@\z@{\baselineskip \z@skip -\lineskip \z@skip -\@dashdim #2\unitlength -\@dashcnt \@dashdim \advance\@dashcnt 200 -\@dashdim #1\unitlength\divide\@dashcnt \@dashdim -\ifodd\@dashcnt\@dashdim \z@ -\advance\@dashcnt \@ne \divide\@dashcnt \tw@ -\else \divide\@dashdim \tw@ \divide\@dashcnt \tw@ -\advance\@dashcnt \m@ne -\setbox\@dashbox \hbox{\vrule \@height \@halfwidth \@depth \@halfwidth -\@width \@dashdim}\put(0,0){\copy\@dashbox}% -\put(0,#3){\copy\@dashbox}% -\put(#2,0){\hskip-\@dashdim\copy\@dashbox}% -\put(#2,#3){\hskip-\@dashdim\box\@dashbox}% -\multiply\@dashdim \thr@@ -\fi -\setbox\@dashbox \hbox{\vrule \@height \@halfwidth \@depth \@halfwidth -\@width #1\unitlength\hskip #1\unitlength}\@tempcnta\z@ -\put(0,0){\hskip\@dashdim \@whilenum \@tempcnta <\@dashcnt -\do{\copy\@dashbox\advance\@tempcnta \@ne }}\@tempcnta\z@ -\put(0,#3){\hskip\@dashdim \@whilenum \@tempcnta <\@dashcnt -\do{\copy\@dashbox\advance\@tempcnta \@ne }}% -\@dashdim #3\unitlength -\@dashcnt \@dashdim \advance\@dashcnt 200 -\@dashdim #1\unitlength\divide\@dashcnt \@dashdim -\ifodd\@dashcnt \@dashdim \z@ -\advance\@dashcnt \@ne \divide\@dashcnt \tw@ -\else -\divide\@dashdim \tw@ \divide\@dashcnt \tw@ -\advance\@dashcnt \m@ne -\setbox\@dashbox\hbox{\hskip -\@halfwidth -\vrule \@width \@wholewidth -\@height \@dashdim}\put(0,0){\copy\@dashbox}% -\put(#2,0){\copy\@dashbox}% -\put(0,#3){\lower\@dashdim\copy\@dashbox}% -\put(#2,#3){\lower\@dashdim\copy\@dashbox}% -\multiply\@dashdim \thr@@ -\fi -\setbox\@dashbox\hbox{\vrule \@width \@wholewidth -\@height #1\unitlength}\@tempcnta\z@ -\put(0,0){\hskip -\@halfwidth \GAL@ignore@next@galley@vbox{\@whilenum \@tempcnta <\@dashcnt -\do{\vskip #1\unitlength\copy\@dashbox\advance\@tempcnta \@ne }% -\vskip\@dashdim}}\@tempcnta\z@ -\put(#2,0){\hskip -\@halfwidth \GAL@ignore@next@galley@vbox{\@whilenum \@tempcnta<\@dashcnt -\do{\vskip #1\unitlength\copy\@dashbox\advance\@tempcnta \@ne }% -\vskip\@dashdim}}}\@makepicbox(#2,#3)} -\gdef\@ovvert#1#2{\GAL@ignore@next@galley@vbox to\@ovyy{% - \if@ovb \@tempcntb \@tempcnta \advance \@tempcntb #1\relax - \kern -\@ovro \hbox{\char \@tempcntb}\nointerlineskip - \else \kern \@ovri \kern \@ovdy \fi - \leaders\vrule \@width \@wholewidth\vfil \nointerlineskip - \if@ovt \@tempcntb \@tempcnta \advance \@tempcntb #2\relax - \hbox{\char \@tempcntb}% - \else \kern \@ovdy \kern \@ovro \fi}} -\catcode`\:=12 -\def\@xfloat #1[#2]{% - \@nodocument - \def \@captype {#1}% - \def \@fps {#2}% - \@onelevel@sanitize \@fps - \def \reserved@b {!}% - \ifx \reserved@b \@fps - \@fpsadddefault - \else - \ifx \@fps \@empty - \@fpsadddefault - \fi - \fi - \ifhmode - \@bsphack - \@floatpenalty -\@Mii - \else - \@floatpenalty-\@Miii - \fi - \ifinner - \@parmoderr\@floatpenalty\z@ - \else - \@next\@currbox\@freelist - {% - \@tempcnta \sixt@@n - \expandafter \@tfor \expandafter \reserved@a - \expandafter :\expandafter =\@fps - \do - {% - \if \reserved@a h% - \ifodd \@tempcnta - \else - \advance \@tempcnta \@ne - \fi - \fi - \if \reserved@a t% - \@setfpsbit \tw@ - \fi - \if \reserved@a b% - \@setfpsbit 4% - \fi - \if \reserved@a p% - \@setfpsbit 8% - \fi - \if \reserved@a !% - \ifnum \@tempcnta>15 - \advance\@tempcnta -\sixt@@n\relax - \fi - \fi - }% - \@tempcntb \csname ftype@\@captype \endcsname - \multiply \@tempcntb \@xxxii - \advance \@tempcnta \@tempcntb - \global \count\@currbox \@tempcnta - }% - \@fltovf - \fi - \global \setbox\@currbox - \color@vbox - \normalcolor - \vbox \bgroup - \hsize\columnwidth - \@parboxrestore - \@floatboxreset -} -\catcode`\:=11 -\def\end@float{% - \@endfloatbox - \ifnum\@floatpenalty <\z@ - \@largefloatcheck - \@cons\@currlist\@currbox - \ifnum\@floatpenalty <-\@Mii - \penalty -\@Miv - \@tempdima\prevdepth - \GAL@ignore@next@galley@vbox{}% - \prevdepth\@tempdima - \penalty\@floatpenalty - \else - \vadjust{\penalty -\@Miv \GAL@ignore@next@galley@vbox{}\penalty\@floatpenalty}\@Esphack - \fi - \fi -} -\def \@xympar{% - \ifnum\@floatpenalty <\z@\@cons\@currlist\@marbox\fi - \setbox\@tempboxa - \color@vbox - \vbox \bgroup - \end@float - \@ignorefalse - \@esphack -} -\def \AtBeginDvi #1{% - \global \setbox \@begindvibox - \vbox{\unvbox \@begindvibox #1}% -} -\def\clearpage{% - \ifvmode - \ifnum \@dbltopnum =\m@ne - \ifdim \pagetotal <\topskip - \hbox{}% - \fi - \fi - \fi - \newpage - \write\m@ne{}% - \GAL@ignore@next@galley@vbox{}% - \penalty -\@Mi -} -\def \@emptycol {\GAL@ignore@next@galley@vbox{}\penalty -\@M} -\long\def \@topnewpage [#1]{% - \@nodocument - \@next\@currbox\@freelist{}{}% - \global \setbox\@currbox - \color@vbox - \normalcolor - \vbox {% - \hsize\textwidth - \@parboxrestore - \col@number \@ne - #1% - \vskip -\dbltextfloatsep - }% - \color@endbox - \ifdim \ht\@currbox>\textheight - \ht\@currbox \textheight - \fi - \global \count\@currbox \tw@ - \@tempdima -\ht\@currbox - \advance \@tempdima -\dbltextfloatsep - \global \advance \@colht \@tempdima - \ifx \@dbltoplist \@empty - \else - \@latexerr{Float(s) lost}\@ehb - \let \@dbltoplist \@empty - \fi - \@cons \@dbltoplist \@currbox - \global \@dbltopnum \m@ne - \ifdim \@colht<2.5\baselineskip - \@latex@warning@no@line {Optional argument of \noexpand\twocolumn - too tall on page \thepage}% - \@emptycol - \if@firstcolumn - \else - \@emptycol - \fi - \else - \global \vsize \@colht - \global \@colroom \@colht - \@floatplacement - \fi -} -\gdef\@specialoutput{% - \ifnum \outputpenalty>-\@Mii - \@doclearpage - \else - \ifnum \outputpenalty<-\@Miii - \ifnum \outputpenalty<-\@MM \deadcycles \z@ \fi - \global \setbox\@holdpg \vbox {\unvbox\@cclv}% - \else - \global \setbox\@holdpg \vbox{% - \unvbox\@holdpg - \unvbox\@cclv - \setbox\@tempboxa \lastbox - \unskip - }% - \@pagedp \dp\@holdpg - \@pageht \ht\@holdpg - \unvbox \@holdpg - \@next\@currbox\@currlist{% - \ifnum \count\@currbox>\z@ - \advance \@pageht \@pagedp - \ifvoid\footins \else - \advance \@pageht \ht\footins - \advance \@pageht \skip\footins - \advance \@pageht \dp\footins - \fi - \ifvbox \@kludgeins - \ifdim \wd\@kludgeins=\z@ - \advance \@pageht \ht\@kludgeins - \fi - \fi - \@reinserts - \@addtocurcol - \else - \@reinserts - \@addmarginpar - \fi - }\@latexbug - \ifnum \outputpenalty<\z@ - \if@nobreak - \nobreak - \else - \addpenalty \interlinepenalty - \fi - \fi - \fi - \fi -} -\def \@doclearpage {% - \ifvoid\footins - \setbox\@tempboxa\vsplit\@cclv to\z@ \unvbox\@tempboxa - \setbox\@tempboxa\box\@cclv - \xdef\@deferlist{\@toplist\@botlist\@deferlist}% - \global \let \@toplist \@empty - \global \let \@botlist \@empty - \global \@colroom \@colht - \ifx \@currlist\@empty - \else - \@latexerr{Float(s) lost}\@ehb - \global \let \@currlist \@empty - \fi - \@makefcolumn\@deferlist - \@whilesw\if@fcolmade \fi{\@opcol\@makefcolumn\@deferlist}% - \if@twocolumn - \if@firstcolumn - \xdef\@dbldeferlist{\@dbltoplist\@dbldeferlist}% - \global \let \@dbltoplist \@empty - \global \@colht \textheight - \begingroup - \@dblfloatplacement - \@makefcolumn\@dbldeferlist - \@whilesw\if@fcolmade \fi{\@outputpage - \@makefcolumn\@dbldeferlist}% - \endgroup - \else - \GAL@ignore@next@galley@vbox{}\clearpage - \fi - \fi - \else - \setbox\@cclv\vbox{\box\@cclv\vfil}% - \@makecol\@opcol - \clearpage - \fi -} -\gdef \@makecol {% - \ifvoid\footins - \setbox\@outputbox \box\@cclv - \else - \setbox\@outputbox \vbox {% - \boxmaxdepth \@maxdepth - \@tempdima\dp\@cclv - \unvbox \@cclv - \vskip-\@tempdima - \vskip \skip\footins - \color@begingroup - \normalcolor - \footnoterule - \unvbox \footins - \color@endgroup - }% - \fi - \xdef\@freelist{\@freelist\@midlist}% - \global \let \@midlist \@empty - \@combinefloats - \ifvbox\@kludgeins - \@makespecialcolbox - \else - \setbox\@outputbox \vbox to\@colht {% - \@texttop - \dimen@ \dp\@outputbox - \unvbox \@outputbox - \vskip -\dimen@ - \@textbottom - }% - \fi - \global \maxdepth \@maxdepth -} -\gdef \@makespecialcolbox {% - \setbox\@outputbox \vbox {% - \@texttop - \dimen@ \dp\@outputbox - \unvbox\@outputbox - \vskip-\dimen@ - }% - \@tempdima \@colht - \ifdim \wd\@kludgeins>\z@ - \advance \@tempdima -\ht\@outputbox - \advance \@tempdima \pageshrink - \setbox\@outputbox \vbox to \@colht {% - \unvbox\@outputbox - \vskip \@tempdima - \@textbottom - }% - \else - \advance \@tempdima -\ht\@kludgeins - \setbox \@outputbox \vbox to \@colht {% - \GAL@ignore@next@galley@vbox to \@tempdima {% - \unvbox\@outputbox - \@textbottom}% - \vss}% - \fi - {\setbox \@tempboxa \box \@kludgeins}% -} -\def\@outputpage{% -\begingroup % the \endgroup is put in by \aftergroup - \@resetactivechars - \@parboxrestore - \let \protect \noexpand % <- this moved after parboxrestore!!!! - \shipout \vbox{% - \set@typeset@protect - \aftergroup \endgroup - \aftergroup \set@typeset@protect - % correct? or just restore by ending - % the group? - \if@specialpage - \global\@specialpagefalse\@nameuse{ps@\@specialstyle}% - \fi - \if@twoside - \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot - \let\@themargin\oddsidemargin - \else \let\@thehead\@evenhead - \let\@thefoot\@evenfoot \let\@themargin\evensidemargin - \fi - \fi - \reset@font - \normalsize - \normalsfcodes - \let\label\@gobble - \let\index\@gobble - \let\glossary\@gobble - \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@ - \@begindvi - \vskip \topmargin - \moveright\@themargin \vbox {% - \setbox\@tempboxa \vbox to\headheight{% - \vfil - \color@hbox - \normalcolor - \hb@xt@\textwidth{\@thehead}% - \color@endbox - }% %% 22 Feb 87 - \dp\@tempboxa \z@ - \box\@tempboxa - \vskip \headsep - \box\@outputbox - \baselineskip \footskip - \color@hbox - \normalcolor - \hb@xt@\textwidth{\@thefoot}% - \color@endbox - }% - }% - \global \@colht \textheight - \stepcounter{page}% - \let\firstmark\botmark -} -\def \@cflt{% - \let \@elt \@comflelt - \setbox\@tempboxa \vbox{}% - \@toplist - \setbox\@outputbox \vbox{% - \boxmaxdepth \maxdepth - \unvbox\@tempboxa - \vskip -\floatsep - \topfigrule - \vskip \textfloatsep - \unvbox\@outputbox - }% - \let\@elt\relax - \xdef\@freelist{\@freelist\@toplist}% - \global\let\@toplist\@empty -} -\def\@comflelt#1{\setbox\@tempboxa - \vbox{\unvbox\@tempboxa\box #1\vskip\floatsep}} -\def \@combinedblfloats{% - \ifx \@dbltoplist \@empty - \else - \setbox\@tempboxa \vbox{}% - \let \@elt \@comdblflelt - \@dbltoplist - \let \@elt \relax - \xdef \@freelist {\@freelist\@dbltoplist}% - \global\let \@dbltoplist \@empty - \setbox\@outputbox \vbox to\textheight - {%\boxmaxdepth\maxdepth %% probably not needed, CAR - \unvbox\@tempboxa\vskip-\dblfloatsep - \ifnum \@dbltopnum>\m@ne - \dblfigrule - \fi - \vskip \dbltextfloatsep - \box\@outputbox - }% - \fi -} -\def\@vtryfc #1{% - \global\setbox\@outputbox\vbox{}% - \let\@elt\@wtryfc - \@flsucceed - \global\setbox\@outputbox \vbox to\@colht{% - \vskip \@fptop - \vskip -\@fpsep - \unvbox \@outputbox - \vskip \@fpbot}% - \let\@elt\relax - \xdef #1{\@failedlist\@flfail}% - \xdef\@freelist{\@freelist\@flsucceed}} -\def\@wtryfc #1{% - \global\setbox\@outputbox\vbox{% - \unvbox\@outputbox - \vskip\@fpsep - \box #1}} -\def\@addmarginpar{\@next\@marbox\@currlist{\@cons\@freelist\@marbox - \@cons\@freelist\@currbox}\@latexbug\@tempcnta\@ne - \if@twocolumn - \if@firstcolumn \@tempcnta\m@ne \fi - \else - \if@mparswitch - \ifodd\c@page \else\@tempcnta\m@ne \fi - \fi - \if@reversemargin \@tempcnta -\@tempcnta \fi - \fi - \ifnum\@tempcnta <\z@ \global\setbox\@marbox\box\@currbox \fi - \@tempdima\@mparbottom - \advance\@tempdima -\@pageht - \advance\@tempdima\ht\@marbox - \ifdim\@tempdima >\z@ - \@latex@warning@no@line {Marginpar on page \thepage\space moved}% - \else - \@tempdima\z@ - \fi - \global\@mparbottom\@pageht - \global\advance\@mparbottom\@tempdima - \global\advance\@mparbottom\dp\@marbox - \global\advance\@mparbottom\marginparpush - \advance\@tempdima -\ht\@marbox - \global\setbox \@marbox - \vbox {\vskip \@tempdima - \box \@marbox}% - \global \ht\@marbox \z@ - \global \dp\@marbox \z@ - \kern -\@pagedp - \nointerlineskip - \hb@xt@\columnwidth - {\ifnum \@tempcnta >\z@ - \hskip\columnwidth \hskip\marginparsep - \else - \hskip -\marginparsep \hskip -\marginparwidth - \fi - \box\@marbox \hss}% - \nointerlineskip - \hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}} -\def\@outputdblcol{% - \if@firstcolumn - \global \@firstcolumnfalse - \global \setbox\@leftcolumn \box\@outputbox - \else - \global \@firstcolumntrue - \setbox\@outputbox \vbox {% - \hb@xt@\textwidth {% - \hb@xt@\columnwidth {% - \box\@leftcolumn \hss}% - \hfil - \vrule \@width\columnseprule - \hfil - \hb@xt@\columnwidth {% - \box\@outputbox \hss}% - }% - }% - \@combinedblfloats - \@outputpage - \begingroup - \@dblfloatplacement - \@startdblcolumn - \@whilesw\if@fcolmade \fi - {\@outputpage - \@startdblcolumn}% - \endgroup - \fi -} - - - -% \end{macrocode} -% -% \begin{macrocode} -\catcode`\:=12\relax -\endinput -% \end{macrocode} -% -% \begin{macrocode} -%</package> -% \end{macrocode} -% -% -% \Finale -% diff --git a/Master/texmf-dist/source/latex3/galley/galley2.ins b/Master/texmf-dist/source/latex3/galley/galley2.ins deleted file mode 100644 index f44ac61196b..00000000000 --- a/Master/texmf-dist/source/latex3/galley/galley2.ins +++ /dev/null @@ -1,14 +0,0 @@ -\input docstrip -\keepsilent -\askforoverwritefalse - -\preamble - -\endpreamble - -\generate{% - \file{galley2.sty}{\from{galley2.dtx}{package,trace}} - \file{xhj.sty}{\from{xhj.dtx}{package,trace}} - } - -\endbatchfile diff --git a/Master/texmf-dist/source/latex3/galley/xhj.dtx b/Master/texmf-dist/source/latex3/galley/xhj.dtx deleted file mode 100644 index 56f245782c9..00000000000 --- a/Master/texmf-dist/source/latex3/galley/xhj.dtx +++ /dev/null @@ -1,1924 +0,0 @@ -% \iffalse -%% -%% $Header: /usr3/users/latex3/design/consolidation/CURRENT/RCS/xhj.dtx,v 1.8 2000/01/14 15:24:24 latex3 Exp $ -%% -%% (C) Copyright 1999-2000 Frank Mittelbach -%% All rights reserved. -%% -%% Not for general distribution. In its present form it is not allowed -%% to put this package onto CD or an archive without consulting the -%% the authors. -%% -%% This module only works in conjunction with the galley2 module. -%% -%<*dtx> - \ProvidesFile{xhj.dtx} -%</dtx> -%<package>\NeedsTeXFormat{LaTeX2e} -%<package>\ProvidesPackage{xhj} -%<driver>\ProvidesFile{xhj.drv} -% \fi -% \ProvidesFile{xhj.dtx} - [2000/01/14 v0.3c hyphenation & justification] -% -% \iffalse -%<*driver> - \documentclass{ltxdoc} -%\usepackage{xlists-samples} -%\makeatletter \let\GAL@typeout\@gobble \let\GAL@show@datastructure\@gobble -% \usepackage{ldcdoc} - -\newcommand\LaTeXplus{\LaTeXe$*$} - -\newcommand\DelayEvaluation{\texttt{\textbackslash DelayEvalution} - \ignorespaces} -\newcommand\fontwordspace{\texttt{\textbackslash fontwordspace}} -\newcommand\fontextraspace{\texttt{\textbackslash fontextraspace}} - - -% next three definitions are big hacks to run the file -% without the above packages -% -\newcommand\NoValue{\texttt{\textbackslash NoValue}} - -\makeatletter -\newenvironment{TemplateInterfaceDescription}[1] - {\subsection{The Template Type `#1'}% - \begingroup - \@beginparpenalty\@M - \description - \def\TemplateArgument##1##2{\item[Arg: ##1]##2\par}% - \def\TemplateSemantics{\enddescription\endgroup - \subsubsection*{Semantics:}}% - } - {\par\bigskip} - -\newenvironment{TemplateDescription}[2] - {\subsection{The Template `#2' (type #1)}% - \subsubsection*{Attributes:}% - \begingroup - \@beginparpenalty\@M - \description - \def\TemplateKey##1##2##3##4{\item[##1 (##2)]##3% - \ifx\TemplateKey##4\TemplateKey\else -% \hskip0ptplus3em\penalty-500\hskip 0pt plus 1filll Default:~##4% - \hfill\penalty500\hbox{}\hfill Default:~##4% - \nobreak\hskip-\parfillskip\hskip0pt\relax - \fi - \par}% - \def\TemplateSemantics{\enddescription\endgroup - \subsubsection*{Semantics \& Comments:}}% - } - {\par\bigskip} - -\newenvironment{InstanceDescription}[4][xxxxxxxxxxxxxxx] - {\subsubsection{The Instance `#3' (template #2/#4)}% - \subsubsection*{Attribute values:}% - \begingroup - \@beginparpenalty\@M - \def\InstanceKey##1##2{\>\textbf{##1}\>##2\\}% - \def\InstanceSemantics{\endtabbing\endgroup - \vskip-30pt\vskip0pt - \subsubsection*{Layout description \& Comments:}}% - \tabbing - xxxx\=#1\=\kill - } - {\par\bigskip} - -\makeatother - -\newcommand\key[1]{\textbf{#1}} - - \begin{document} - \DocInput{xhj.dtx} - \end{document} -%</driver> -% \fi -% -% \CheckSum{298} -% -% \newcommand\subsubsubsection{\paragraph} -% -% \GetFileInfo{xhj.dtx} -% -% \title{The \textsf{h\&j} package\thanks{This file -% has version number \fileversion, last -% revised \filedate.}} -% \author{FMi} -% \date{\filedate} -% \maketitle -% -% \tableofcontents -% -% \bigskip -% -% \begin{abstract} -% This module contains basic templates for interfacing with the -% galley mechanism as set up by the module -% \texttt{galley2}. These templates are intended for class -% designers and are mostly usable out of the box (i.e., this is one -% of the modules where providing a suitable number of default -% instances is probably sensible since they would cover 98\% of all -% usage. In contrast the \texttt{galley2} module contains only -% low-level interfaces for -% direct manipulation of the galley mechanism which are geared -% towards package writers having special needs which are not -% fulfilled by the templates in this module. -% \end{abstract} -% -% -% -% -% \section{Introduction} -% -% In \LaTeXplus{} terminology a galley is a rectangular area which -% receives text and other material filling it from -% top.\footnote{The predominant direction depends on the writing -% system and with extensions to \TeX{} such as Omega there are -% possibilities to define galleys with a different filling direction.} -% The vertically extend of a galley is normally not restricted -% (there are exceptions); instead certain chunks are taken off the top -% of an -% already partially filled galley to form columns or similar areas -% on a page. This process is typically asynchronous but there are ways -% to control or change its behavior. -% -% Examples for galleys are `the main galley', where the continuous -% document data gets formatted into and from which columns and pages are -% constructed, and `vbox galley's, such as the body of a minipage -% environment or the body of a float (in \LaTeXe only---the new float -% mechanism for \LaTeXplus{} will employ horizontally oriented float -% bodies). The latter galleys are typically not being split after -% formatting though there can be exceptions. -% -% Low-level interfaces for setting up such galleys and the way objects -% are formatted into them are provided by the module -% \texttt{galley2}. -% -% \subsection{Formatting layers} -% -% The present module is mainly concerned with the -% formatting of text in such galleys. -% The galley mechanism provides interfaces at four different layers -% some of which can be manipulated through the templates provided by -% this module. -% -% \subsubsection{Outer galley dimensions} -% -% In the bottom layer the external dimensions of a galley are -% fixed. In most cases only the horizontal dimension is defined while -% the vertical dimension (i.e., the filling direction) remains -% unspecified. These dimensions are fixed when initiating a new galley, -% using low-level functions, and are not modifiable. The horizontal -% overall width of the current galley is available for inspection in -% the register |\hsize|.\footnote{This is going to change once there -% is a final concept for handling this part of the interface, e.g., -% the relation of \texttt{\textbackslash hsize}, -% \texttt{\textbackslash columnwidth}, and \texttt{\textbackslash -% textwidth}. The latter are actually parameters of the text-page and -% should probably not be handled as it is done in \LaTeXe{}, i.e., by -% also using \texttt{\textbackslash columnwidth} as a measure for the -% current galley width. Perhaps one should introduce a -% \texttt{\textbackslash galleywidth} parameter instead of using -% \texttt{\textbackslash hsize}.} -% There are no templates that only set variable of this layer, though -% higher level -% templates (e.g., a template for providing minipage functionality) -% will of course address this part of the galley mechanism. -% -% -% \subsubsection{Inner galley dimensions} -% -% The second layer defines the inner horizontal galley dimensions of -% the galley, i.e., the measure used for paragraph text and its -% positioning within the galley. The current measure of the galley is -% available for inspection in the register |\linewidth| and the -% indentation from the left outer margin is available in the register -% |\@totalleftmargin|.\footnote{The two registers are already -% available in \LaTeXe{} and their names have been retained to make -% it easier to use a mixture of old and new code. However at some -% point the interface should be made more uniform by either providing -% two user accessible or two user inaccessible names.} -% -% This layer can (and should) be manipulated by higher-level templates -% through template instances of the type `measure'. These templates -% make long-term changes. -% -% -% -% -% \subsubsection{Paragraph shapes} -% -% The third layer defines the paragraph shape within the measure as -% provided by the second layer. In the absence of any specification -% for that layer the paragraph shape used will be that of a -% rectangular area of the width of the current measure. -% -% For this layer we are restricted by the mechanisms offered by -% \TeX{}. This means that it is possible to define particular -% paragraph shapes such as cutouts only from the top of a paragraph -% but not relative to its bottom. -% -% This layer can (and should) be manipulated by higher-level templates -% through template instances of the type `pshape'. Templates in this -% layer typically make short-term changes only (i.e. applicable only -% to the upcoming paragraph), however templates for long-term changes -% are also permissable though none are provided right now. -% -% A future implementation of the \texttt{galley2} module is probably -% going to support pshapes spanning several paragraphs, however at the -% moment pshapes apply per paragraph only. -% -% -% \subsubsection{Text formatting within the paragraph shape} -% -% The forth (and currently final) layer deals with the paragraph -% formatting aspects such as hyphenation and justification (h\&j which -% gave the current module its name). -% -% There are several template types in this layer: `hj' is a type that -% sets all aspects of h\&j in a single template whereas the types -% `justification', `linebreak', and `hyphenation' deal with individual -% aspects. -% -% \subsection{Open issues} -% -% Several but right now most of them are discussed when describing the -% interfaces in more details below. -% -% \begin{itemize} -% \item -% The model attempts a proper separation between paragraph shapes -% (layer three) and justification (part of layer four). However, due -% to the way \TeX{} works certain paragraph shapes can only be -% accomplished by using the parameters that are normally reserved -% for justification (an example would be the famous shape used by -% |\@dottedcontentsline|, i.e., a rectangular shape with the first -% line sticking out to the left and the last line sticking out to -% the right). How to integrate such shapes on layer three needs some -% more thought. -% \item -% What does the argument to the `measure' type really signal? Always -% a relative value (to current |\@totalleftmargin|), always an -% absolute value, or a value depending on what the template makes -% out of it? Perhaps this is not that important as one can't expect -% any such document supplied value be correct for different -% designs---or is this the wrong idea? At the moment I make -% it always be a relative change to |\@totalleftmargin| independent -% of the type of template being used. -% \end{itemize} -% -% -% \section{Interfaces} -% -% \begin{TemplateInterfaceDescription}{measure} -% -% \TemplateArgument{1} -% {Indentation of the left margin overwriting the default change -% or \NoValue{} in which case the value from the template -% is used. If provide the value is \emph{always} interpreted as -% being relative to the current indentation in the galley.} -% -% \TemplateSemantics -% This template type defines the basic measure of the galley, -% i.e., the width of the lines (|\linewidth|) and their -% indentation from the left (|\@totalleftmargin|). -% -% Each template of this type has to set the above parameters -% locally to their correct value.\footnote{That part of the -% implementation in \texttt{galley2.dtx} probably needs changing.} -% -% The templates can (and in most cases do) refer to an -% external\footnote{Again that is something which may not survive -% for long. It might very well be the case that all these -% parameters need to be added to the main galley data structures.} -% parameter holding the overall nominal width of the current -% galley (|\hsize|). However it is perfectly admissible that the -% template parameters are set in a way that |\@totalleftmargin| + -% |\linewidth| exceeds this nominal width (the galley mechanism -% provides low-level calls that allow for this without producing -% an error. This way paragraphs in a galley may stick out on -% either side if desired. -% -% One could think of making also the right margin being user -% over-writable or providing something like a boolean to modify the -% meaning of the template argument---suggestions/applications -% needed.\footnote{Think!} -% -% Templates of this type make long-term changes, i.e., their -% settings remain until the next occurence of an instance of this -% type or until the galley ends or its previous settings are -% restored. As remarked in the introduction -% there is a need for saving and restoring the settings of this -% particular part of the mechanism individually. -% -% \end{TemplateInterfaceDescription} -% -% -% \begin{TemplateDescription}{measure}{relative} -% -% \TemplateKey{leftmargin}{l} -% {Additional indentation on the left for all lines} -% {none} -% -% \TemplateKey{rightmargin}{l} -% {Additional indentation on the right for all lines} -% {none} -% -% \TemplateSemantics -% This is the main template needed for defining vertically oriented -% lists and the like (at least if they are supposed to allow for -% nesting). -% -% \end{TemplateDescription} -% -% -% -% \begin{TemplateDescription}{measure}{absolute} -% -% \TemplateKey{leftmargin}{l} -% {Indentation on the left for all lines} -% {none} -% -% \TemplateKey{rightmargin}{l} -% {Indentation on the right for all lines measured from the -% nominal width of the galley (i.e., \texttt{\textbackslash -% hsize})} -% {none} -% -% \TemplateSemantics -% This template can be used in cases where one wishes to ignore -% any already existing indentations. Whether or not this has real -% applications remains to be seen. -% -% \end{TemplateDescription} -% -% -% -% -% -% \begin{TemplateInterfaceDescription}{pshape} -% -% \TemplateArgument{none} -% {---} -% -% \TemplateSemantics -% Templates of this type define the shape of the paragraph within -% the given measure of the galley, e.g., whether it has some -% special form such as a cutout one or the other side. -% -% Typically they define a shape only for the next paragraph, -% however templates that provide long term changes are also allowed. -% -% Since such special forms often require that all lines of a -% paragraph are kept together on a page these templates typically -% also define whether or not pages breaks within a paragraph are -% allowed. -% -% An interesting question is whether or not such templates should -% set (or inhibit) paragraph indentations via a template key. After -% all with cutouts on the top left such indentations are usually -% not desired.\footnote{Right now only justification templates set -% indentation but perhaps they should not, or both should, or what?} -% -% \end{TemplateInterfaceDescription} -% -% -% -% \begin{TemplateDescription}{pshape}{cutout} -% -% \TemplateKey{no-page-break-boolean}{s} -% {If true the upcoming paragraph will not be broken across a -% page. If false the breakability of the upcoming paragraph -% depends on other elements in the galley, i.e., it might still -% be forbidden to break.} -% {false} -% -% \TemplateKey{left-side-boolean}{s} -% {If true, the cutout will appear on the left otherwise it will -% appear on the right.} -% {true} -% -% \TemplateKey{normal-lines-num}{c} -% {Number of lines before the cutoff starts.} -% {0} -% -% \TemplateKey{parshape-list}{f0} -% {Comma separated list of dimensions denoting the horizontal -% size of the cutout for successive lines. If the paragraph -% contains more lines than the sum of \key{normal-lines-num} and -% the number of elements in this list then the remaining lines -% are all normal lines (i.e., cutout width 0pt) again.} -% {none} -% -% \TemplateSemantics -% This template is used to define a fixed cutout on one or the -% other side of a paragraph. It applies to the next paragraph -% only. -% -% The \key{normal-lines-num} is for convenience -% only. Alternatively one could prepend a suitable number of -% `\texttt{0pt,}'s to \key{parshape-list}. -% -% \end{TemplateDescription} -% -% -% \begin{InstanceDescription}[\textbf{no-page-break-boolean}xx] -% {pshape}{staggered}{cutout} -% -% \InstanceKey{no-page-break-boolean}{true} -% -% \InstanceKey{left-side-boolean}{true} -% -% \InstanceKey{normal-lines-num}{1} -% -% \InstanceKey{parshape-list}{20pt,40pt,60pt} -% -% \InstanceSemantics -% This instance will indent each line by an additional 20pt (up to -% the fourth line). A possible application would be a heading text -% (with a maximum number of four lines). -% This should then perhaps be combined with a special justification -% instance which does ragged right except for the last line which is -% set to full measure. -% -% \end{InstanceDescription} -% -% -% \begin{InstanceDescription}[\textbf{no-page-break-boolean}xx] -% {pshape}{ltriangle}{cutout} -% -% \InstanceKey{no-page-break-boolean}{true} -% -% \InstanceKey{left-side-boolean}{true} -% -% \InstanceKey{normal-lines-num}{0} -% -% \InstanceKey{parshape-list}{60pt,40pt,20pt} -% -% \InstanceSemantics -% This instance will produce a triangle cutout on the left upper -% corner of a paragraph. Could, for example, used together with an -% unusual heading layout~\ldots -% -% \end{InstanceDescription} -% -% -% \begin{InstanceDescription}[\textbf{no-page-break-boolean}xx] -% {pshape}{rectangle}{cutout} -% -% \InstanceKey{no-page-break-boolean}{false} -% -% \InstanceKey{left-side-boolean}{true} -% -% \InstanceKey{normal-lines-num}{0} -% -% \InstanceKey{parshape-list}{} -% -% \InstanceSemantics -% This instance can be used when a pshape is required but one just -% wants a standard regular paragraph area.\footnote{Using the cutoff -% template for this is overkill; at some point in the future this -% instance should be reimplemented.} -% -% \end{InstanceDescription} -% -% -% -% -% \begin{TemplateInterfaceDescription}{justification} -% -% \TemplateArgument{none} -% {---} -% -% \TemplateSemantics -% Templates of this type define how a paragraph text is formatted -% within the boundaries of a general paragraph shape (as defined -% through a measure (and perhaps additionally a pshape) -% template). More exactly they define whether or -% not the text should be justified at both sides or only at one -% side and in the latter case how much raggedness is desired, -% etc. See the instance examples for more details. -% -% The \key{linefillskip} in the templates below is worth -% mentioning. It defines a stretchable space that is used by -% commands that end a line prematurely in the middle of a -% paragraph, e.g., |\\| or |\newline|. In most cases what is -% needed is to fill the line with white space in exactly the same -% way as \TeX's |\parfillskip| parameter works (which is also the -% reason for the chosen default). However, for special instances -% this is not appropriate. Important is that any template of this -% type provides this key or rather provides a mechanism to -% correctly feeds the underlying data structure. -% -% Originally there have been different template types for setting -% the paragraph specs for all following paragraphs and for only -% the next one but this was combined into a single type. Whether -% or not this is the right approach remains to be seen. -% -% \end{TemplateInterfaceDescription} -% -% -% \begin{TemplateDescription}{justification}{std} -% -% \TemplateKey{startskip}{l} -% {Stretchable space added to the left of the first line in a -% paragraph (in addition to \key{leftskip}).} -% {0pt} -% -% \TemplateKey{leftskip}{l} -% {Stretchable space added to the left of every line in a -% paragraph.} -% {\texttt{\textbackslash leftskip}} -% -% \TemplateKey{rightskip}{l} -% {Stretchable space added to the right of every line in a -% paragraph.} -% {\texttt{\textbackslash rightskip}} -% -% \TemplateKey{parfillskip}{l} -% {Stretchable space added to the right of the last line in a -% paragraph (in addition to \key{rightskip}).} -% {\texttt{\textbackslash parfillskip}} -% -% \TemplateKey{spaceskip}{l} -% {Stretchable space to use between words if non-zero. Otherwise -% size for space between words is taken from the current font -% metrics.} -% {\texttt{\textbackslash spaceskip}} -% -% \TemplateKey{xspaceskip}{l} -% {Extra space to use after periods etc.~(in certain situations)} -% {\texttt{\textbackslash xspaceskip}} -% -% \TemplateKey{linefillskip}{l} -% {Space to add at the point where some command requests a -% ``carriage-return line-feed'' in the middle of a paragraph, -% e.g., the \LaTeX{} command \texttt{\textbackslash newline}.} -% {value of \key{parfillskip}} -% -% \TemplateKey{parindent}{l} -% {Non-stretchable space to be added at the beginning of a -% paragraph.} -% {\texttt{\textbackslash parindent}} -% -% \TemplateSemantics -% -% This template sets the paragraph justification for all following -% paragraph (within the normal scope, i.e., until the end of the -% galley or a new specification). -% -% The key names for this template are derived from the original -% \TeX{} primitives whenever applicable. Perhaps this is a bad -% idea as \key{startskip} and \key{parfillskip} do not go well -% together. -% -% The defaults for most keys are actually the command names of the -% original \TeX{} primitives. The intention is that something like -% \key{parindent} could be externally provided by setting -% |\parindent| for all instances which do not explicitly set it to -% some value (e.g., to 0pt in instances where paragraph -% indentation is not really appropriate). Whether this is a good -% idea remains to be seen, this probably need some radically -% different default concept. -% -% \end{TemplateDescription} -% -% -% -% -% \begin{InstanceDescription}{justification}{default}{std} -% -% \InstanceKey{leftskip}{0pt} -% -% \InstanceKey{rightskip}{0pt} -% -% \InstanceKey{parfillskip}{0pt plus 1fil} -% -% \InstanceSemantics -% -% This instance is slightly special as it is internally called -% whenever a new galley is instantiated, e.g., in a minipage. Thus -% it must be defined by class. The setting above is the same as for -% the adjust instance, but of course a class might wish to change -% this, e.g., if the desired layout requires ragged right setting by -% default. -% -% \end{InstanceDescription} -% -% -% -% -% -% -% \begin{InstanceDescription}{justification}{adjust}{std} -% -% \InstanceKey{leftskip}{0pt} -% -% \InstanceKey{rightskip}{0pt} -% -% \InstanceKey{parfillskip}{0pt plus 1fil} -% -% \InstanceSemantics -% -% This instance provides the standard justified paragraph setting, -% i.e., every line is justified at both sides and the final line -% is set flush left. Paragraph indentation is not set, i.e. will -% be whatever the value of |\parindent| is. -% -% \end{InstanceDescription} -% -% -% -% -% -% \begin{InstanceDescription}{justification}{adjust2}{std} -% -% \InstanceKey{leftskip}{0pt} -% -% \InstanceKey{rightskip}{0pt} -% -% \InstanceKey{parfillskip}{20pt plus 1fil} -% -% \InstanceSemantics -% -% This is a variation of the previous instance: the difference is -% that the last line of a paragraph can never be completely -% filled. In some sense this defines a paragraph indent at the -% end. -% -% Further variations are possible, e.g., one can ensure that the -% last line always contains at least a certain amount of space. -% -% \end{InstanceDescription} -% -% -% -% -% -% \begin{InstanceDescription}{justification}{center}{std} -% -% \InstanceKey{parindent}{0pt} -% -% \InstanceKey{leftskip}{0pt} -% -% \InstanceKey{rightskip}{0pt} -% -% \InstanceKey{parfillskip}{0pt} -% -% \InstanceSemantics -% -% This instance is an example of a layout where the paragraph -% indent is explicitly set to zero to ensure that all lines are -% properly centered. Of course even with centered lines somebody -% could think of having a paragraph indentation: if so define a -% variation of the this instance. -% -% \end{InstanceDescription} -% -% -% -% -% \begin{InstanceDescription}{justification}{centermiddle}{std} -% -% \InstanceKey{parindent}{0pt} -% -% \InstanceKey{startskip}{-36pt plus -1fill} -% -% \InstanceKey{leftskip}{36pt plus 1fill} -% -% \InstanceKey{rightskip}{36pt plus 1fill} -% -% \InstanceKey{parfillskip}{-36pt plus -1fill} -% -% \InstanceSemantics -% -% A specialized instance that sets the first line of the paragraph -% flush left, the last line flush right and the intermediate lines -% centered with at least one centimeter space at each -% side. Possible application could be two or three line headings. -% -% \end{InstanceDescription} -% -% -% -% -% -% \begin{InstanceDescription}{justification}{raggedright}{std} -% -% \InstanceKey{startskip}{0pt} -% -% \InstanceKey{leftskip}{0pt} -% -% \InstanceKey{rightskip}{\DelayEvaluation 0pt plus 2em} -% -% \InstanceKey{parfillskip}{0pt plus 1fil} -% -% \InstanceKey{spaceskip}{\DelayEvaluation \fontwordspace} -% -% \InstanceKey{xspaceskip}{\DelayEvaluation -% \fontwordspace + \fontextraspace} -% -% \InstanceSemantics -% -% This interesting instance defines a ragged right setting which -% allows for hyphenation in case the raggedness would otherwise be -% too extreme (2em in the current font are considered okay anything -% in addition will start making the line bad as far as \TeX's -% paragraph algorithm is concerned so \TeX{} will consider -% hyphenation in such cases. -% -% An unjustified setting should always contain identical word -% spaces. Since we restrict the stretchability at the right end (it is -% of the same strength as the default word space stretchability), we -% have to ensure that the word spaces to not stretch or shrink at -% all. This is achieved by forcing the \key{spaceskip} to the -% normal font word space (without any stretch). -% -% \end{InstanceDescription} -% -% -% -% -% -% -% \begin{InstanceDescription}{justification}{flushleft}{std} -% -% \InstanceKey{startskip}{0pt} -% -% \InstanceKey{leftskip}{0pt} -% -% \InstanceKey{rightskip}{0pt plus 1fill} -% -% \InstanceKey{parfillskip}{0pt plus 1fill} -% -% \InstanceSemantics -% -% In contrast to the previous instance, this instance allows for -% arbitrary short lines, i.e., a paragraph set using this instance -% will never get hyphenated unless it contains words longer than -% the line measure. -% -% As all the stretchable space will appear at the right margin -% there in no point in artifically modify the word spaces as they -% will be set at their natural size anyway. -% -% \end{InstanceDescription} -% -% -% -% -% -% \begin{InstanceDescription}{justification}{raggedleft}{std} -% -% \InstanceKey{startskip}{0pt} -% -% \InstanceKey{leftskip}{\DelayEvaluation 0pt plus 2em} -% -% \InstanceKey{rightskip}{0pt} -% -% \InstanceKey{parfillskip}{0pt} -% -% \InstanceKey{spaceskip}{\DelayEvaluation \fontwordspace} -% -% \InstanceKey{xspaceskip}{\DelayEvaluation -% \fontwordspace + \fontextraspace} -% -% \InstanceSemantics -% -% This instance is the raggedleft counter part to the raggedright -% instance above. -% -% \end{InstanceDescription} -% -% -% -% -% -% \begin{InstanceDescription}{justification}{flushright}{std} -% -% \InstanceKey{startskip}{0pt} -% -% \InstanceKey{leftskip}{0pt plus 1fill} -% -% \InstanceKey{rightskip}{0pt} -% -% \InstanceKey{parfillskip}{0pt} -% -% \InstanceSemantics -% -% And here is the variation which is not using hyphenation unless -% there is absolutely no other alternative. -% -% \end{InstanceDescription} -% -% -% -% \begin{TemplateDescription}{justification}{single} -% -% \TemplateKey{startskip}{l} -% {Stretchable space added to the left of the first line in a -% paragraph (in addition to \key{leftskip}).} -% {0pt} -% -% \TemplateKey{leftskip}{l} -% {Stretchable space added to the left of every line in a -% paragraph.} -% {\texttt{\textbackslash leftskip}} -% -% \TemplateKey{rightskip}{l} -% {Stretchable space added to the right of every line in a -% paragraph.} -% {\texttt{\textbackslash rightskip}} -% -% \TemplateKey{parfillskip}{l} -% {Stretchable space added to the right of the last line in a -% paragraph (in addition to \key{rightskip}).} -% {\texttt{\textbackslash parfillskip}} -% -% \TemplateKey{spaceskip}{l} -% {Stretchable space to use between words if non-zero. Otherwise -% size for space between words is taken from the current font -% metrics.} -% {\texttt{\textbackslash spaceskip}} -% -% \TemplateKey{xspaceskip}{l} -% {Extra space to use after periods etc.~(in certain situations)} -% {\texttt{\textbackslash xspaceskip}} -% -% \TemplateKey{linefillskip}{l} -% {Space to add at the point where some command requests a -% ``carriage-return line-feed'' in the middle of a paragraph, -% e.g., the \LaTeX{} command \texttt{\textbackslash newline}.} -% {value of \key{parfillskip}} -% -% \TemplateKey{parindent}{l} -% {Non-stretchable space to be added at the beginning of a -% paragraph.} -% {\texttt{\textbackslash parindent}} -% -% \TemplateSemantics -% -% This template is exactly the same as the std one, except that it -% applies only to the next paragraph after which the previous -% setting will become active again. For an explanation of the keys -% see the std template description. -% -% It is not clear whether this approach makes much -% sense. See comments below. -% -% \end{TemplateDescription} -% -% -% -% -% -% \begin{InstanceDescription}{justification}{centerfirst}{single} -% -% \InstanceKey{startskip}{0pt plus 2fill} -% -% \InstanceKey{leftskip}{0pt plus -1fill} -% -% \InstanceKey{rightskip}{0pt plus 1fill} -% -% \InstanceKey{parfillskip}{0pt} -% -% \InstanceKey{linefillskip}{0pt} -% -% \InstanceSemantics -% -% This instance centers the first line of a paragraph and sets all -% remaining lines as a solid block (including the last line). This -% is a rather specialized justification method which relies on some -% peculiar features of the \TeX's internal handling of stretchable -% space. It is not possible to control the amount of white space on -% the first line (other than forcing it to be centered) with the -% controls available. Anything further needs manual intervention by -% the user. -% -% In a similar fashion centering of the last line could be achieved -% (by setting \key{parfillskip} rather than \key{startskip}. -% -% \end{InstanceDescription} -% -% -% -% -% -% -% -% \begin{TemplateDescription}{justification}{complex} -% -% \TemplateKey{first-para-justification-setup}{i} -% {Justification setup for the first paragraph of a sequence.} -% {none} -% -% \TemplateKey{other-para-justification-setup}{i} -% {Justification setup for the remaining paragraphs in the sequence} -% {none} -% -% \TemplateSemantics -% -% This template allows to specify a different justification setup -% for the first paragraph of a sequence and its remaining -% paragraphs. Due to the implementation it is currently required -% that the key \key{first-para-justification-setup} receives an -% instance defined through the template `single' or more exactly -% through a template that modifies the justification setup only for -% a single paragraph. Otherwise all paragraphs in the sequence will -% be formatted in the same way (i.e., the second key would have no -% effect). -% -% This is largely due to the fact that the implementation previously -% contained different template types for local and `global' changes -% to the justification.\footnote{Better concept needed! Perhaps the -% coding in galley2 needs changing in this area.} -% -% -% \end{TemplateDescription} -% -% -% -% -% \begin{InstanceDescription}[\textbf{other-para-justification-setup}xx] -% {justification}{centerfirst-adjust}{complex} -% -% \InstanceKey{first-para-justification-setup}{centerfirst} -% -% \InstanceKey{other-para-justification-setup}{adjust} -% -% \InstanceSemantics -% -% This instance is an example for a paragraph justification where -% the first and the remaining paragraphs are handled differently: -% the first paragraph will get a centered first line (with the -% remaining lines being set as a squared block and any additional -% paragraph will be justified. A common use for such a -% layout would be table captions. -% -% \end{InstanceDescription} -% -% -% -% -% -% -% -% -% -% -% \begin{TemplateInterfaceDescription}{hyphenation} -% -% \TemplateArgument{none} -% {---} -% -% \TemplateSemantics -% -% Templates of this type define whether or not hyphenation is -% attempted for upcoming paragraphs in the galley and if hyphenation -% is allowed whether it should be encouraged (to support better -% justification) or whether it should be only used if justification -% would get too bad without it.\footnote{There are a few conceptual -% questions: should templates of this type set anything like -% \key{hyphenpenalty} or would this be better handled in the -% linebreak template type and this template type only be used to set -% hyphenation on/off? In case of the latter is it needed as a -% separate type or should it be added to some other type?} -% -% \end{TemplateInterfaceDescription} -% -% -% \begin{TemplateDescription}{hyphenation}{TeX} -% -% \TemplateKey{uchyph}{c} -% {If positive allow hyphenation of words starting with an -% uppercase letter.} -% {1} -% -% \TemplateKey{hyphenpenalty}{c} -% {} -% {50} -% -% \TemplateKey{exhyphenpenalty}{c} -% {} -% {50} -% -% \TemplateKey{lefthyphenmin}{c} -% {} -% {leave unchanged} -% -% \TemplateKey{righthyphenmin}{c} -% {} -% {leave unchanged} -% -% \TemplateSemantics -% -% Keys are named like the \TeX{} primitives. As I remarked -% earlier, perhaps \key{hyphenpenalty} and \key{exhyphenpenalty} -% should be moved to the linebreak templates. -% -% Also an open question is the keys -% \key{left/righthyphenmin}. Their minimum values are actually a -% feature of the current language or more exactly a feature of the -% hyphenation patterns in force, but on the other hand one can -% increase their values without harm and especially by setting -% them to extremely high values one can disable hyphenation -% altogether. So how should this be handled? -% -% \end{TemplateDescription} -% -% -% -% \begin{TemplateDescription}{hyphenation}{std} -% -% \TemplateKey{hyphen-enable-boolean}{s} -% {If false disables hyphenation} -% {none} -% -% \TemplateKey{hyphen-uppercase-boolean}{s} -% {If positive allows hyphenation of words starting with an -% uppercase letter.} -% {none} -% -% \TemplateKey{hyphen-discourage-boolean}{s} -% {Sets penalties for breaking a line at a discretionary to a -% higher value. Only relevant if \key{hyphen-enable-boolean} is -% set to true.} -% {none} -% -% \TemplateKey{hyphen-encourage-boolean}{s} -% {Sets penalties for breaking a line at a discretionary to a -% higher value. Only relevant if \key{hyphen-enable-boolean} is -% set to true.} -% {none} -% -% \TemplateSemantics -% -% Better or worse than the TeX version? In any case it remains a -% question of whether the line breaking parts should be set in a -% template like this. -% -% \end{TemplateDescription} -% -% -% -% -% -% -% \begin{TemplateInterfaceDescription}{linebreak} -% -% \TemplateArgument{none} -% {---} -% -% \TemplateSemantics -% -% This template type determines the line breaking behavior of the -% \TeX{} machinery, with the exception of whether or not to -% hyphenate (certain) words. It could be considered to moved the -% parameters related to breaking up math formulas to a separate -% type. -% -% \end{TemplateInterfaceDescription} -% -% -% \begin{TemplateDescription}{linebreak}{TeX} -% -% \TemplateKey{pretolerance}{c} -% {Maximum tolerance allowed for individual lines to break the -% paragraph without attempting hyphenation.} -% {100} -% -% \TemplateKey{tolerance}{c} -% {Maximum tolerance allowed for individual lines when breaking a -% paragraph while attempting hyphenation (if this limit can't be -% met \key{emergencystretch} comes into play.} -% {200} -% -% \TemplateKey{linepenalty}{c} -% {Extra penalty charged per line in the paragraph. By making -% this penalty higher \TeX{} will try harder to produce compact -% paragraphs.} -% {10} -% -% \TemplateKey{binoppenalty}{c} -% {Penalty charged if an inline math formula is broken at a -% binary operator.} -% {700} -% -% \TemplateKey{relpenalty}{c} -% {Penalty charged if an inline math formula is broken at a -% relational symbol.} -% {500} -% -% \TemplateKey{hbadness}{c} -% {Boundary that if exceeded will cause \TeX{} to report an -% underfull line.} -% {1000} -% -% \TemplateKey{adjdemerits}{c} -% {Extra demerit charge if two visually incompatible lines follow -% each other.} -% {10000} -% -% \TemplateKey{doublehyphendemerits}{c} -% {Extra demerit charge of two (or more) lines in succession end -% in a hyphen.} -% {10000} -% -% \TemplateKey{finalhyphendemerits}{c} -% {Extra demerit charge if the second last line is hyphenated.} -% {5000} -% -% \TemplateKey{hfuzz}{l} -% {Boundary below overfull lines are not reported.} -% {.1pt} -% -% \TemplateKey{emergencystretch}{l} -% {Complicated --- I write up the explanation at some other day :-)} -% {0pt} -% -% \TemplateSemantics -% Keys are named like the \TeX{} primitives. As I remarked -% earlier, perhaps \key{hyphenpenalty} and \key{exhyphenpenalty} -% from the hyphenation template -% should be moved to the linebreak templates. -% -% -% \end{TemplateDescription} -% -% -% -% -% -% -% \begin{TemplateInterfaceDescription}{hj} -% -% \TemplateArgument{none} -% {---} -% -% \TemplateSemantics -% Often certain combinations of justification, line breaking and -% hyphenation settings are used together. For those case it might -% be desirable to be able to identify these settings with a single -% name. The hj type provides for this. It is supposed to set the -% complete ``micro typography'' setting concerning paragraphs, -% i.e., everything that happens within the outer form as defined by -% the measure and/or pshape templates. -% -% Whether this template type is actually needed remains to be -% seen. Clearly everywhere where it gets applied one could apply -% individually templates of type justification, linebreak, and -% hyphenation. -% -% Right now the low-level galley interface uses an instance of this -% type (with the name ``default'') to initialize a new -% galley. -% -% \end{TemplateInterfaceDescription} -% -% -% \begin{TemplateDescription}{hj}{std} -% -% \TemplateKey{justification-setup}{i} -% {Instance specifying the justification used.} -% {\texttt{default}} -% -% \TemplateKey{linebreak-setup}{i} -% {Instance specifying the line breaking parameters} -% {\texttt{default}} -% -% \TemplateKey{hyphenation-setup}{i} -% {Instance specifying the hyphenation parameter used.} -% {\texttt{default}} -% -% \TemplateSemantics -% This is the shortcut template as discussed before. One could -% think of other templates that do set the parameters using a large -% number keys (\TeX{} style, for example) --- whether this -% makes sense~\ldots -% -% \end{TemplateDescription} -% -% - -% \begin{InstanceDescription}[\textbf{justification-setup}xx] -% {hj}{default}{std} -% -% \InstanceKey{justification-setup}{default} -% -% \InstanceKey{linebreak-setup}{default} -% -% \InstanceKey{hyphenation-setup}{default} -% -% \InstanceSemantics -% -% This instance is used when initializing new galleys. It is in -% fact slightly faster to run |\UseInstance{hj}{default}| compared -% to three calls to |\UseInstance| for the individual template -% instances.\footnote{This is because we avoid the overhead of -% \texttt{\textbackslash UseInstance} (the keys of type \texttt{i} -% are optimized in this respect.} -% -% \end{InstanceDescription} -%% -% -% -% -% \StopEventually{} -% -% \section{Implementation} -% -% Set up certain defaults including to ignore white space -% within the body of this package. \LaTeXe{} release needs to be -% recent because of changing some bits of the |\parbox| handling below. -% \begin{macrocode} -%<*package> -\NeedsTeXFormat{LaTeX2e}[1998/12/01] -% \end{macrocode} -% -% \begin{macrocode} -\RequirePackage{template,xparse} -% \RequirePackage{galley2} % this is required but needs to - % be loaded afterwards !!!! -% \end{macrocode} -% -% The primitives of the galley mechanism currently have ``:'' in their -% names so\ldots -% \begin{macrocode} -\IgnoreWhiteSpace -\catcode`\:=11\relax -% \end{macrocode} -% -% -% \subsection{Using Font Dimensions} -% -% Some helper functions to access information in a tfm file. -% They do not really belong here but right now we don't have a place -% for them. -% \begin{macro}{\@usefontdimen} -% A shorthand: -% \begin{macrocode} -\def\@usefontdimen#1{\fontdimen#1\font} -% \end{macrocode} -% \end{macro} -% -% \begin{macro}{\fontslant} -% \begin{macro}{\fontwordspace} -% \begin{macro}{\fontwordspacestretch} -% \begin{macro}{\fontwordspaceshrink} -% \begin{macro}{\fontex} -% \begin{macro}{\fontem} -% \begin{macro}{\fontextraspace} -% The following commands access dimension of the current font, -% e.g., |\fontwordspace| gives the width of a space between words -% in the current font. Typically these commands have to be used -% together with |\DelayEvaluation| so that they are applied at -% runtime rather than during the declaration of template -% instances. -% \begin{macrocode} -\def\fontslant {\@usefontdimen1} -\def\fontwordspace {\@usefontdimen2} -\def\fontwordspacestretch {\@usefontdimen3} -\def\fontwordspaceshrink {\@usefontdimen4} -\def\fontex {\@usefontdimen5} -\def\fontem {\@usefontdimen6} -\def\fontextraspace {\@usefontdimen7} -% \end{macrocode} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% \end{macro} -% -% -% \subsection{Templates for the second layer} -% -% \subsubsection{The template type `measure'} -% -% The `measure' type takes one argument (left margin or -% |\NoValue|), see discussion above. -% \begin{macrocode} -\DeclareTemplateType{measure}{1} -% \end{macrocode} -% -% \begin{macrocode} -\DeclareTemplate{measure}{absolute}{1}{ - leftmargin =l \leftmargin, - rightmargin =l \rightmargin, - }{ - \DoParameterAssignments -% \end{macrocode} -% -% User provided left margin is always relative to current -% indentation even if template does provide absolute values. -% \begin{macrocode} - \IfNoValueF{#1} { \setlength\leftmargin{ #1 + \@totalleftmargin } } - \setSGPVmeasure:nn \leftmargin {\hsize -\leftmargin -\rightmargin } -} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareTemplate{measure}{relative}{1}{ - leftmargin =l \leftmargin, - rightmargin =l \rightmargin, - }{ - \DoParameterAssignments - \IfNoValueF{#1} { \setlength\leftmargin{#1} } - \addSGPVmeasure:nn \leftmargin { -\leftmargin -\rightmargin } -} -% \end{macrocode} -% -% -% -% \subsection{Templates for the third layer} -% -% \subsubsection{The template type `pshape'} -% -% The template type `pshape' right now is mostly an interface to -% \TeX's |\parshape| primitive. This is probably going to be extended. -% -% \begin{macrocode} -\DeclareTemplateType{pshape}{0} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareTemplate{pshape}{cutout}{0}{ - no-page-break-boolean =s {\setGALbreak:n {-3}}{}, - left-side-boolean =s {}{\let\shape@side\setGALrightparshape:nnn}, - normal-lines-num =C \pshape@normalines, - parshape-list =f0 \pshape@parshape, - }{ - \let\pshape@normalines\z@ - \let\shape@side\setGALleftparshape:nnn - \DoParameterAssignments - \shape@side \pshape@normalines \z@ \pshape@parshape - } -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareInstance{pshape}{staggered}{cutout}{ - no-page-break-boolean = true, - normal-lines-num = 1, - parshape-list = { 20pt, 40pt, 60pt }, -} -% \end{macrocode} -% -% -% -% \begin{macrocode} -\DeclareInstance{pshape}{ltriangle}{cutout}{ - no-page-break-boolean = true, - normal-lines-num = 0, - parshape-list = { 60pt, 40pt, 20pt }, -} -% \end{macrocode} -% -% The next instance provides a ``noop'' or ``regular'' pshape instance, -% i.e., one -% that can be applied when a template requests to set up a pshape but -% the standard rectangular is desired (of course using using the -% cutout template for this task is very very inefficient so at some -% point this should be done differently). -% -% \begin{macrocode} -\DeclareInstance{pshape}{rectangle}{cutout}{ - no-page-break-boolean = false, - normal-lines-num = 0, - parshape-list = { }, -} -% \end{macrocode} -% -% -% \subsection{Templates for the forth layer} -% -% \subsubsection{The template type `justification'} -% -% How we justify the text within the measure: -% \begin{macrocode} -\DeclareTemplateType{justification}{0} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareTemplate{justification}{single}{0}{ - startskip =L \justification@a , - leftskip =L \justification@b , - rightskip =L \justification@c , - parfillskip =L \justification@d , - spaceskip =L \justification@e , - xspaceskip =L \justification@f , - linefillskip =L \justification@g , - parindent =L \justification@h , - }{ - \def\justification@a{\z@} - \def\justification@b{\leftskip} - \def\justification@c{\rightskip} - \def\justification@d{\parfillskip} - \def\justification@e{\spaceskip} - \def\justification@f{\xspaceskip} - \def\justification@g{\justification@d} - \def\justification@h{\parindent} -% - \DoParameterAssignments -% \end{macrocode} -% Next is a written out form of |\appendtoDGPVthing:nx| (more or less) -% \begin{macrocode} - \xdef \GAL@j@ - {{\justification@a} - {\justification@b} - {\justification@c} - {\justification@d} - {\justification@e} - {\justification@f} - {\justification@g} - {\justification@h} - } - \GAL@prepare@reassign:NN \GAL@j@ \GAL@j@s - } -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareTemplate{justification}{std}{0}{ - startskip =L \justification@a , - leftskip =L \justification@b , - rightskip =L \justification@c , - parfillskip =L \justification@d , - spaceskip =L \justification@e , - xspaceskip =L \justification@f , - linefillskip =L \justification@g , - parindent =L \justification@h , - } - { - \def\justification@a{\z@} - \def\justification@b{\leftskip} - \def\justification@c{\rightskip} - \def\justification@d{\parfillskip} - \def\justification@e{\spaceskip} - \def\justification@f{\xspaceskip} - \def\justification@g{\justification@d} -% - \def\justification@h{\parindent} - \DoParameterAssignments - \edef \@tempa {\noexpand \setSGPVthing:nn j - {{\justification@a} - {\justification@b} - {\justification@c} - {\justification@d} - {\justification@e} - {\justification@f} - {\justification@g} - {\justification@h} - } - } - \@tempa -% \end{macrocode} -% \begin{macrocode} - \expandafter \setup@paragraph@justification \GAL@j@ -} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareTemplate{justification}{complex}{0}{ - first-para-justification-setup =i {justification} - \justification@first, - other-para-justification-setup =i {justification} - \justification@other, - } - { - \DoParameterAssignments -% long term changes first! - \justification@other - \justification@first - } -% \end{macrocode} -% -% -% -% And some instances for testing \ldots -% \begin{macrocode} -\DeclareInstance{justification}{adjust}{std} - {rightskip =0pt, - leftskip =0pt, - startskip =0pt, - parfillskip=\fill -} -% \end{macrocode} -% -% -% -% Another name for the above: -% \begin{macrocode} -\DeclareInstance{justification}{default}{std} - {rightskip =0pt, - leftskip =0pt, - startskip =0pt, - parfillskip=\fill -} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareInstance{justification}{adjust2}{std} - {parindent = 0pt, - rightskip = 0pt, - leftskip = 0pt, - startskip = 0pt, - parfillskip= 20pt plus 1fil -} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareInstance{justification}{center}{std} - {parindent =0pt, - rightskip =\fill, - leftskip =\fill, - startskip =0pt, - parfillskip=0pt -} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareInstance{justification}{centermiddle}{std} - {parindent =0pt, - rightskip =36pt plus 1fill, - leftskip =36pt plus 1fill, - startskip =-36pt plus -1fill, - parfillskip=-36pt plus -1fill, - linefillskip= 0pt, -} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareInstance{justification}{raggedright}{std} - {rightskip = \DelayEvaluation 0pt plus 2em, - leftskip = 0pt, - startskip = 0pt, - parfillskip= \fill, - spaceskip = \DelayEvaluation \fontwordspace, - xspaceskip = \DelayEvaluation \fontwordspace + \fontextraspace, -} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareInstance{justification}{flushleft}{std} - {rightskip =\fill, - leftskip =0pt, - startskip =0pt, - parfillskip=\fill, -} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareInstance{justification}{raggedleft}{std} - {leftskip = \DelayEvaluation 0pt plus 2em, - rightskip = 0pt, - startskip = 0pt, - parfillskip= 0pt, - spaceskip = \DelayEvaluation \fontwordspace, - xspaceskip = \DelayEvaluation \fontwordspace + \fontextraspace, -} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareInstance{justification}{flushright}{std} - {leftskip = \fill, - rightskip = 0pt, - startskip = 0pt, - parfillskip= 0pt, -} -% \end{macrocode} -% -% -% \begin{macrocode} -% this does now work: -\DeclareInstance{justification}{centerfirst}{single} - {parindent = 0pt, - rightskip = \fill, - leftskip = -\fill, - parfillskip= 0pt, - startskip = 0pt plus 2fill, - linefillskip= 0pt, -} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareInstance{justification}{centerfirst-adjust}{complex} - { first-para-justification-setup = centerfirst, - other-para-justification-setup = adjust - } -% \end{macrocode} -% -% -% -% \subsubsection{The template `linebreak'} -% -% How we attempt to break the paragraph into lines: -% \begin{macrocode} -\DeclareTemplateType{linebreak}{0} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareTemplate{linebreak}{TeX}{0}{ - pretolerance =c [100] \pretolerance, - tolerance =c [200] \tolerance, - linepenalty =c [10] \linepenalty, - binoppenalty =c [700] \binoppenalty, - relpenalty =c [500] \relpenalty, - hbadness =c [1000] \hbadness, - adjdemerits =c [10000] \adjdemerits, - doublehyphendemerits =c [10000] \doublehyphendemerits, - finalhyphendemerits =c [5000] \finalhyphendemerits, -% - hfuzz =l [.1pt] \hfuzz, - emergencystretch =l [0pt] \emergencystretch, -% -} - {\DoParameterAssignments -%<*trace> - \GAL@typeout{Now~ changing~ linebreaking} -%</trace> - } -% \end{macrocode} -% -% -% -% -% -% \begin{macrocode} -\DeclareInstance{linebreak}{default}{TeX}{} -\DeclareInstance{linebreak}{fussy}{TeX}{} -\DeclareInstance{linebreak}{sloppy}{TeX} - { - tolerance = 9999, - hfuzz = .5pt, - emergencystretch = \DelayEvaluation 3em, - } -% \end{macrocode} -% -% -% \begin{macro}{\fussy} -% \begin{macro}{\sloppy} -% Two old friends from \LaTeX: -% \begin{macrocode} -\def\fussy {\UseInstance{linebreak}{fussy}} -\def\sloppy{\UseInstance{linebreak}{sloppy}} -% \end{macrocode} -% \end{macro} -% \end{macro} -% -% -% -% \subsubsection{The template type `hyphenation'} -% -% How do we handle the question of hyphenation: -% \begin{macrocode} -\DeclareTemplateType{hyphenation}{0} - -\DeclareTemplate{hyphenation}{TeX}{0}{ - uchyph =c [1] \uchyph, - hyphenpenalty =c [50] \hyphenpenalty, - exhyphenpenalty =c [50] \exhyphenpenalty, - lefthyphenmin =c \lefthyphenmin, - righthyphenmin =c \righthyphenmin, -} - {\DoParameterAssignments -%<*trace> - \GAL@typeout{Now~ changing~ hyphenation} -%</trace> - } -% \end{macrocode} -% -% -% -% -% -% \begin{macrocode} -\newcount\@@lefthyphenmin -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareTemplate{hyphenation}{std}{0}{ - hyphen-enable-boolean =s {\ifnum\@@lefthyphenmin>\z@ - \lefthyphenmin\@@lefthyphenmin - \fi} - {\@@lefthyphenmin\lefthyphenmin - \lefthyphenmin\@M}, - hyphen-uppercase-boolean =s {\uchyph\@ne}{\uchyph\z@}, - hyphen-discourage-boolean=s {\hyphenpenalty\@highpenalty - \exhyphenpenalty\@highpenalty}{}, - hyphen-encourage-boolean =s {\hyphenpenalty\@lowpenalty - \exhyphenpenalty\@lowpenalty}{}, -} - {\DoParameterAssignments -%<*trace> - \GAL@typeout{Now~ changing~ hyphenation} -%</trace> - } -% \end{macrocode} -% -% -% -% -% -% \begin{macrocode} -\DeclareInstance{hyphenation}{default}{TeX} - {} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareInstance{hyphenation}{off}{std} - {hyphen-enable-boolean = false} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareInstance{hyphenation}{on}{std} - {hyphen-enable-boolean = true} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareInstance{hyphenation}{discourage}{std} - {hyphen-enable-boolean = true, - hyphen-discourage-boolean = true} -% -%\ShowInstance{hyphenation}{off} -%\ShowInstance{hyphenation}{discourage} -% \end{macrocode} -% -% -% -% \subsubsection{The template type `hj'} -% -% \begin{macrocode} -\DeclareTemplateType{hj}{0} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareTemplate{hj}{std}{0}{ - justification-setup =i {justification} [default] \hj@justification, - linebreak-setup =i {linebreak} [default] \hj@linebreak, - hyphenation-setup =i {hyphenation} [default] \hj@hyphenation, -} - {\DoParameterAssignments - \hj@justification - \hj@linebreak - \hj@hyphenation - } -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareInstance{hj}{default}{std}{} -% \end{macrocode} -% -% -% \begin{macrocode} -%\ShowInstance{hj}{default} -% \end{macrocode} -% -% -% \begin{macrocode} -\catcode`\:=12\relax -\endinput -% \end{macrocode} -% -% \begin{macrocode} -%</package> -% \end{macrocode} -% -% -% \Finale -% -% \endinput -% -% -% -% \subsection{The template `pagebreak'} -% -% -% -% The rest doesn't belong here but i've already set it up I have to -% keep it somewhere until work on the page builder actually -% starts---so why not in this place. -% -% \begin{TemplateInterfaceDescription}{pagebreak} -% -% \TemplateArgument{1} -% {none} -% -% \TemplateSemantics -% -% \end{TemplateInterfaceDescription} -% -% -% \begin{TemplateDescription}{pagebreak}{TeX} -% -% \TemplateKey{clubpenalty}{c} -% {} -% {150} -% -% \TemplateKey{widowpenalty}{c} -% {} -% {150} -% -% \TemplateKey{displaywidowpenalty}{c} -% {} -% {50} -% -% \TemplateKey{predisplaypenalty}{c} -% {} -% {10000} -% -% \TemplateKey{postdisplaypenalty}{c} -% {} -% {0} -% -% \TemplateKey{brokenpenalty}{c} -% {} -% {100} -% -% \TemplateKey{interlinepenalty}{c} -% {} -% {0} -% -% \TemplateKey{vbadness}{c} -% {} -% {1000} -% -% \TemplateKey{vfuzz}{l} -% {} -% {.1pt} -% -% \TemplateSemantics -% -% \end{TemplateDescription} -% -% -% -% -% \begin{macrocode} -\DeclareTemplateType{pagebreak}{0} -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareTemplate{pagebreak}{TeX}{0}{ - clubpenalty =c [150] \clubpenalty, - widowpenalty =c [150] \widowpenalty, - displaywidowpenalty =c [50] \displaywidowpenalty, - predisplaypenalty =c [10000] \predisplaypenalty, - postdisplaypenalty =c [0] \postdisplaypenalty, - brokenpenalty =c [100] \brokenpenalty, - interlinepenalty =c [0] \interlinepenalty, -% - vbadness =c [1000] \vbadness, - vfuzz =l [.1pt] \vfuzz, -} - {\DoParameterAssignments -%<*trace> - \GAL@typeout{Now~ changing~ pagebreaking} -%</trace> - } -% \end{macrocode} -% -% -% \begin{macrocode} -\DeclareInstance{pagebreak}{default}{TeX}{} -% \end{macrocode} -% -% -% -% -% -% -% -% -% \begin{TemplateInterfaceDescription}{} -% -% \TemplateArgument{1} -% {} -% -% \TemplateSemantics -% -% \end{TemplateInterfaceDescription} -% -% diff --git a/Master/texmf-dist/tex/latex3/galley/galley2.sty b/Master/texmf-dist/tex/latex3/galley/galley2.sty deleted file mode 100644 index 4ccb050c6ff..00000000000 --- a/Master/texmf-dist/tex/latex3/galley/galley2.sty +++ /dev/null @@ -1,1724 +0,0 @@ -%% -%% This is file `galley2.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% galley2.dtx (with options: `package,trace') -%% -%% -%% $Header: /usr3/users/latex3/design/consolidation/CURRENT/RCS/galley2.dtx,v 1.15 2000/01/27 21:45:56 latex3 Exp $ -%% -%% (C) Copyright 1999-2000 Frank Mittelbach -%% All rights reserved. -%% -%% Not for general distribution. In its present form it is not allowed -%% to put this package onto CD or an archive without consulting the -%% the authors. -%% -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{galley2} - [2000/01/27 v0.2s galley structures] -\NeedsTeXFormat{LaTeX2e}[1998/12/01] -\RequirePackage{ldcsetup} -\RequirePackage{xhj} % taken out of this file -\IgnoreWhiteSpace -\catcode`\:=11\relax -\def\tracinggalleys{\afterassignment\@tracinggalleys\count@} -\def\@tracinggalleys{ - \ifcase \count@ - \let\GAL@typeout\@gobble - \or - \def\GAL@typeout ##1{ - \begingroup - \let\protect\@unexpandable@protect - \wlog {##1} - \endgroup - } - \or - \let\GAL@typeout\typeout - \else - \def\GAL@typeout ##1{ - \ifnum\tracingmacros>\z@ - \begingroup - \tracingassigns\z@ - \tracingcommands\z@ - \tracingrestores\z@ - \tracingmacros\z@ - \typeout{##1} - \endgroup - \else - \typeout{##1} - \fi - } - \fi -} -\let\GAL@typeout\@gobble -\let\GAL@@clubpenalty\clubpenalty -\newcount\clubpenalty -\let\GAL@@interlinepenalty\interlinepenalty -\newcount\interlinepenalty -\let\GAL@@everypar\everypar -\newtoks\everypar -\let\GAL@@parindent\parindent \GAL@@parindent\z@ -\newdimen\parindent -\let\GAL@@parskip\parskip \GAL@@parskip\z@ -\newskip\parskip -\let\GAL@@leftskip\leftskip -\newskip\leftskip -\let\GAL@@rightskip\rightskip -\newskip\rightskip -\let\GAL@@parfillskip\parfillskip -\newskip\parfillskip \parfillskip\@flushglue -\newskip\GAL@@startskip -\newskip\GAL@@linefillskip -\let\GAL@@spaceskip\spaceskip -\newskip\spaceskip -\let\GAL@@xspaceskip\xspaceskip -\newskip\xspaceskip -\let\GAL@@lineskip\lineskip -\newskip\lineskip -\newcount\GAL@cnta -\newskip\GAL@skipa -\newskip\GAL@skipb -\newbox\GAL@boxa -\def\GAL@init@static { - \gdef\GAL@b@s {\z@} - \gdef\GAL@p@s {\z@} - \gdef\GAL@v@s {-1sp} - \gdef\GAL@uv@s {\z@} - \gdef\GAL@up@s {} - \gdef\GAL@pw@s {} - \gdef\GAL@j@s {\z@\leftskip\rightskip\parfillskip - \spaceskip\xspaceskip\parfillskip\parindent} - \gdef\GAL@o@s {} - \gdef\GAL@ps@s {} - \gdef\GAL@i@s {\z@} - \gdef\GAL@nw@s {} - \gdef\GAL@q@s {} - \setGALnormalpar: - \GAL@init@dynamic@fully - \UseInstance{hj}{default} -%% alternative -%% \UseInstance{hyphenation}{default} -%% \UseInstance{linebreak}{default} -} -\def\GALsavegalleystate: { - \let\GAL@b@l \GAL@b@ - \let\GAL@p@l \GAL@p@ - \let\GAL@v@l \GAL@v@ - \let\GAL@uv@l \GAL@uv@ - \let\GAL@up@l \GAL@up@ - \let\GAL@pw@l \GAL@pw@ - \let\GAL@j@l \GAL@j@ - \let\GAL@o@l \GAL@o@ - \let\GAL@ps@l \GAL@ps@ - \let\GAL@i@l \GAL@i@ - \let\GAL@nw@l \GAL@nw@ - \let\GAL@q@l \GAL@q@ - \let\GAL@b@sl \GAL@b@s - \let\GAL@p@sl \GAL@p@s - \let\GAL@v@sl \GAL@v@s - \let\GAL@uv@sl \GAL@uv@s - \let\GAL@up@sl \GAL@up@s - \let\GAL@pw@sl \GAL@pw@s - \let\GAL@j@sl \GAL@j@s - \let\GAL@o@sl \GAL@o@s - \let\GAL@ps@sl \GAL@ps@s - \let\GAL@i@sl \GAL@i@s - \let\GAL@nw@sl \GAL@nw@s - \let\GAL@q@sl \GAL@q@s - \let\saved@GAL@par\par - \let\saved@GAL@reassign@list\GAL@reassign@list -} -\def\GALrestoregalleystate: { - \global\let\GAL@b@ \GAL@b@l - \global\let\GAL@p@ \GAL@p@l - \global\let\GAL@v@ \GAL@v@l - \global\let\GAL@uv@ \GAL@uv@l - \global\let\GAL@up@ \GAL@up@l - \global\let\GAL@pw@ \GAL@pw@l - \global\let\GAL@j@ \GAL@j@l - \global\let\GAL@o@ \GAL@o@l - \global\let\GAL@ps@ \GAL@ps@l - \global\let\GAL@i@ \GAL@i@l - \global\let\GAL@nw@ \GAL@nw@l - \global\let\GAL@q@ \GAL@q@l - \global\let\GAL@b@s \GAL@b@sl - \global\let\GAL@p@s \GAL@p@sl - \global\let\GAL@v@s \GAL@v@sl - \global\let\GAL@uv@s \GAL@uv@sl - \global\let\GAL@up@s \GAL@up@sl - \global\let\GAL@pw@s \GAL@pw@sl - \global\let\GAL@j@s \GAL@j@sl - \global\let\GAL@o@s \GAL@o@sl - \global\let\GAL@ps@s \GAL@ps@sl - \global\let\GAL@i@s \GAL@i@sl - \global\let\GAL@nw@s \GAL@nw@sl - \global\let\GAL@q@s \GAL@q@sl - \global\let\par\saved@GAL@par - \global\let\GAL@reassign@list\saved@GAL@reassign@list - \expandafter \setup@paragraph@justification \GAL@j@ -} -\def\saved@GAL@par{\ERROR\GAL@normal@par} -\def\GAL@init@dynamic@as@necessary { - \GAL@typeout{Reinit~ parameters \on@line} - \GAL@typeout{\@spaces \meaning \GAL@reassign@list} - \GAL@reassign@list - \global\let\GAL@reassign@list\@empty -} -\def\GAL@init@dynamic@fully { - \GAL@typeout{Reinit~ parameters \on@line} - \global\let\GAL@b@ \GAL@b@s - \global\let\GAL@p@ \GAL@p@s - \global\let\GAL@v@ \GAL@v@s - \global\let\GAL@uv@ \GAL@uv@s - \global\let\GAL@up@ \GAL@up@s - \global\let\GAL@pw@ \GAL@pw@s - \global\let\GAL@j@ \GAL@j@s - \global\let\GAL@o@ \GAL@o@s - \global\let\GAL@ps@ \GAL@ps@s - \global\let\GAL@i@ \GAL@i@s - \global\let\GAL@nw@ \GAL@nw@s - \global\let\GAL@q@ \GAL@q@s - \global\let\GAL@reassign@list\@empty -} -\let\GAL@reassign@list\@empty -\def\GAL@prepare@reassign:NN #1#2{ - \ifx#1#2 - \else - \appendtoDGPV@internal:Nn\GAL@reassign@list - {\global \let #1 #2 } - \fi -} -\def\GAL@prepare@reassign:n #1{ - \expandafter\ifx \csname GAL@#1@s\endcsname \relax - \GAL@typeout{Not~ reassigning~ for~ #1!} - \else - \expandafter - \GAL@prepare@reassign:NN - \csname GAL@#1@ \expandafter \endcsname - \csname GAL@#1@s \endcsname - \fi -} -\def\GAL@start@level{ - \GALsavegalleystate: - \bgroup - \advance\GAL@level@num\@ne - \GAL@typeout{Entering~ galley~ level:~ - \the\GAL@level@num~ \on@line} - \GAL@init@static - \@GAL@if@first@on@leveltrue % temp solution! - % see below - \aftergroup\GAL@cleanup@level} -\newcount\GAL@level@num -\newif\if@GAL@if@first@on@level -\def\GAL@cleanup@level{ - \par - \GAL@finish@typesetting - \GAL@typeout{Returning~ to~ galley~ level:~ \the\GAL@level@num~ \on@line} - \GALrestoregalleystate: - \egroup -} -\def\GAL@finish@typesetting {} -\everyvbox{\GAL@start@level} -\let\@@insert\insert -\long\def\insert #1#{\@insert{#1}} -\long\def\@insert #1#2{\@@insert#1{\GAL@start@level#2\par}} -\def\GAL@ignore@next@galley{ - \everyvbox{\global\everyvbox{\GAL@start@level}} -} -\def\GAL@ignore@next@galley@vbox{ - \everyvbox{\global\everyvbox{\GAL@start@level}}\vbox -} -\def \GAL@show@datastructure #1{ - \GAL@typeout{#1^^J - \@spaces nominal~ width~ =~ \the\hsize ^^J - \@spaces left~ indentation~ =~ \the\@totalleftmargin ^^J - \@spaces break~ switch~ (b)~ =~ \GAL@b@ \space (\GAL@b@s) ^^J - \@spaces v-penalty~ (p)~ =~ \GAL@p@ \space (\GAL@p@s) ^^J - \@spaces v-space~ (v)~ =~ \GAL@v@ \space (\GAL@v@s) ^^J - \@spaces user~ v-penalty~ (up)~ =~ \GAL@up@ ^^J - \@spaces user~v-space~ (uv)~ =~ \GAL@uv@ ^^J - \@spaces prev-whatits~ (pw)~ =~ \meaning \GAL@pw@ ^^J - \@spaces next-whatits~ (nw)~ =~ \meaning \GAL@nw@ ^^J - \@spaces parshape~spec~ (ps)~ =~ \GAL@ps@ \space (\GAL@ps@s) ^^J - \@spaces queries~ (q)~ =~ \meaning \GAL@q@ ^^J - \@spaces indent~ flag~ (i)~ =~ \GAL@i@ \space (\GAL@i@s) ^^J - \@spaces para~ object~ (o)~ =~ \meaning \GAL@o@ ^^J - \@spaces para~ justification~ (j)~ =~ \meaning \GAL@j@ } -} -\def\GAL@use@on@para{ - \GAL@show@datastructure{Para~ start~ for~ galley~ - level~ \the\GAL@level@num \on@line} - \if@GAL@if@first@on@level - \GAL@handle@first@para - \else - \begingroup - \global\setbox\GAL@boxa\lastbox - \endgraf - \GAL@set@vertical@objects - \GAL@@everypar{} - \noindent - \endgroup - \fi - \GAL@set@measure - \GAL@set@horizontal@objects - \GAL@init@dynamic@as@necessary -} -\def\GAL@handle@first@para { - \@GAL@if@first@on@levelfalse - \GAL@pw@ - \@tempskipa \GAL@uv@ \relax - \ifdim \@tempskipa =\z@ \else - \ifhmode - \begingroup - \global\setbox\GAL@boxa\lastbox - \endgraf - \vskip \@tempskipa - \GAL@@everypar{} - \noindent - \endgroup - \else - \vskip \@tempskipa - \fi - \fi -} -\def\GAL@use@on@vobject{ - \GAL@show@datastructure{V-object~ for~ galley~ - level~ \the\GAL@level@num \on@line} - \if@GAL@if@first@on@level - \GAL@handle@first@para - \else - \GAL@set@vertical@objects - \fi - \GAL@init@dynamic@as@necessary -} -\def \GAL@set@vertical@objects { - \GAL@pw@ - \penalty - \ifx \GAL@up@ \@empty - \ifnum \GAL@b@ > \z@ - \@M - \else - \GAL@p@ \relax - \fi - \else - \GAL@up@ \relax - \fi - \GAL@skipa \GAL@v@ \relax - \vskip \ifdim - \GAL@skipa = -1sp \parskip - \GAL@typeout{\parskip=\the\parskip\space applied} - \else - \GAL@skipa - \fi - \vskip \GAL@uv@ \relax -} -\def \GAL@set@measure { - \parshape - \ifx\GAL@ps@\@empty - \z@ - \else - \GAL@ps@ - \fi -} -\def \GAL@set@horizontal@objects { - \GAL@nw@ - \GAL@q@ - \expandafter \setup@paragraph@justification \GAL@j@ - \ifnum \GAL@i@ = \z@ - \ifvoid\GAL@boxa \else \hb@xt@ \GAL@@parindent{} \fi - \fi - \GAL@o@ \relax - \hskip \GAL@@startskip \relax - \setup@page@breaking@penalties \GAL@b@ -} -\def \setup@page@breaking@penalties #1{ - \GAL@@clubpenalty \clubpenalty - \GAL@@interlinepenalty \interlinepenalty - \ifcase #1 - \or - \or - \GAL@@clubpenalty \@M - \or - \GAL@@interlinepenalty \@M - \else - \setup@page@breaking@penalties {-#1} - \fi -} -\def \setup@paragraph@justification #1 #2 #3 #4 #5 #6 #7 #8{ - \global \GAL@@startskip #1 \relax - \global \GAL@@leftskip #2 \relax - \global \GAL@@rightskip #3 \relax - \global \GAL@@parfillskip #4 \relax - \global \GAL@@spaceskip #5 \relax - \global \GAL@@xspaceskip #6 \relax - \global \GAL@@linefillskip#7 \relax - \global \GAL@@parindent #8 \relax -} -\def \GAL@normal@par { - \begingroup - \ifvmode - \endgraf - \else %% For error-trapping needs - %% \ifinner \ifhmode etc cases - \endgraf - %%%% NOTE: this puts us into vmode with the para on the galley - %%%% AND rignt here we have stuff that has migrated - %%%% (eg vadjust stuff) from the last line!!! - \nobreak - \fi - \endgroup -} -\let\@@par\GAL@normal@par -\def\setGALnormalpar:{ - \global\let\par\GAL@normal@par -} -\def \setGALignoredpar:n #1 { - \ifvmode - \global \par@deathcycles \z@ - \global\let\par\GAL@ignored@par - \gdef\GAL@ignored@par@error{#1} - \appendtoDGPVthing:nn q \setGALnormalpar: - \else - \ERROR \setGALnormalpar: \par - \fi -} -\def\GAL@ignored@par{ - \global \advance\par@deathcycles \@ne - \ifnum \par@deathcycles > \thr@@ - \PackageError{galley2}\GAL@ignored@par@error\@ehd - \setGALnormalpar: - \par - \fi -} -\def \GALignorepars:n #1 { - \global \par@deathcycles \z@ - \global\let\par\GAL@ignore@next@pars - \gdef\GAL@ignored@par@error{#1} - \GAL@ignore@next@pars -} -\def\GAL@ignore@next@pars { - \global \advance\par@deathcycles \@ne - \ifnum \par@deathcycles > \thr@@ - \PackageError{galley2}\GAL@ignored@par@error\@ehd - \setGALnormalpar: - \par - \fi - \@ifnextchar\par{}{\setGALnormalpar:} -} -\long\def\GAL@for#1#2\do#3{% - \expandafter\def\expandafter\@fortmp\expandafter{#2}% - \ifx\@fortmp\@empty \else - \expandafter\@forloop#2,\@nil,\@nil\@@#1{#3}\fi} -\def \parshape@setup #1 #2 #3 #4 #5 #6{ - \setlength\@tempdima{#2} - \setlength\@tempdimb{#3} - \global\let\GAL@ps@\@gobble % remove upcoming space below - \parshape@linecnt \z@ - \@whilenum \parshape@linecnt < #4 \do - { \xdef\GAL@ps@{\GAL@ps@\space - \the\@tempdima\space \the\@tempdimb - } - \advance \parshape@linecnt \@ne - } - \GAL@for\parshape@next#6\do - { - \advance\parshape@linecnt\@ne - \setlength\parshape@lineindent{\@tempdima+#5+\parshape@next} - \setlength\parshape@linewidth - {\@tempdima+\@tempdimb-\parshape@lineindent} - - \ifnum\parshape@linecnt=\@ne - \@tempdimc \parshape@lineindent - \advance\@tempdimc -\@tempdima - \edef\parshape@firstlineindent{\the\@tempdimc} - \fi - \xdef\GAL@ps@{\GAL@ps@\space - #1\space - \the\parshape@linewidth} - } - \advance\parshape@linecnt\@ne - \xdef\GAL@ps@{\the\parshape@linecnt\space - \GAL@ps@\space - \the\@tempdima\space \the\@tempdimb} - \GAL@typeout{\space\space set~ ps = \GAL@ps@}% - \GAL@prepare@reassign:NN \GAL@ps@ \GAL@ps@s -} -\newcount\parshape@linecnt -\newlength\parshape@lineindent -\newlength\parshape@linewidth -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\setDGPVdimension:nn #1#2{% #1=v/h #2=value - \calc@assign@skip\GAL@skipb{#2} - \GAL@typeout{\space\space set~ #1 = #2 = \the\GAL@skipb}% - \expandafter \xdef - \csname GAL@#1@\endcsname - {\the\GAL@skipb} - \GAL@prepare@reassign:n{#1} -} -\def\addDGPVdimension:nn #1#2{% #1=v/h/... #2=value - \GAL@skipb\csname GAL@#1@ \endcsname\relax - \ifdim\GAL@skipb=-1sp - \calc@assign@skip\GAL@skipb{#2} - \else - \calc@assign@skip{\advance\GAL@skipb}{#2} - \fi - \GAL@typeout{\space\space set~ #1 =+ #2 = \the\GAL@skipb} - \expandafter - \xdef - \csname GAL@#1@\endcsname - {\the\GAL@skipb} - \GAL@prepare@reassign:n{#1} -} -\def\maxDGPVdimension:nn #1#2{ - \GAL@skipa\csname GAL@#1@\endcsname\relax - \calc@assign@skip\GAL@skipb{#2} - \ifdim\GAL@skipa<\GAL@skipb - \expandafter - \xdef - \csname GAL@#1@\endcsname - {\the\GAL@skipb} - \GAL@prepare@reassign:n{#1} - \fi - \GAL@typeout{\space\space set~ #1 = - max(\the\GAL@skipa,\the\GAL@skipb) ^^J\@spaces\@spaces - = \csname GAL@#1@\endcsname} -} -\def\setGALpenalty:n #1{% - \calc@assign@count\GAL@cnta{#1} - \xdef \GAL@p@ {\the\GAL@cnta} - \GAL@typeout{\space\space set~ p = #1 = \the\GAL@cnta} - \GAL@prepare@reassign:NN \GAL@p@ \GAL@p@s -} -\def\addGALpenalty:n #1{% - \GAL@cnta \GAL@p@ \relax - \calc@assign@count{\advance\GAL@cnta}{#1} - \xdef \GAL@p@ {\the\GAL@cnta} - \GAL@typeout{\space\space set~ p += #1 = \the\GAL@cnta} - \GAL@prepare@reassign:NN \GAL@p@ \GAL@p@s -} -\def\setGALbreak:n #1{% values 0, 1, 2, or 3 - \GAL@typeout{\space\space set~ b = #1 } - \gdef \GAL@b@ {#1} - \GAL@prepare@reassign:NN \GAL@b@ \GAL@b@s -} -\def\setGALobject:n #1{ - \gdef \GAL@o@ {#1} - \GAL@prepare@reassign:NN \GAL@o@ \GAL@o@s -} -\def\setDGPVthing:nn #1 #2{ - \expandafter \gdef \csname GAL@#1@\endcsname {#2} - \GAL@prepare@reassign:n{#1} -} -\def\appendtoDGPVthing:nn #1#2{ - \expandafter\appendtoDGPV@internal:Nn\csname GAL@#1@\endcsname {#2} - \GAL@prepare@reassign:n{#1} -} -\def\appendtoDGPVthing:no #1#2{ - \expandafter\appendtoDGPV@internal:No\csname GAL@#1@\endcsname {#2} - \GAL@prepare@reassign:n{#1} -} -\def\appendtoDGPV@internal:Nn #1 #2{ - \expandafter \gdef \expandafter #1 \expandafter - {#1 #2} -} -\def\appendtoDGPV@internal:No #1 #2{ - \expandafter\appendtoDGPV@internal:Nn\expandafter #1\expandafter {#2} -} -\def \setGALleftparshape:nnn { - \parshape@setup {\the\parshape@lineindent} \@totalleftmargin - \linewidth } -\def \setGALrightparshape:nnn { - \parshape@setup \@totalleftmargin \@totalleftmargin \linewidth -} -\def \GALhangfrom:n #1 { - \setbox\@tempboxa\hbox{{#1}} - \parshape@setup {\the\parshape@lineindent} - {\@totalleftmargin+\wd\@tempboxa} - {\linewidth-\wd\@tempboxa} - \z@ - \z@ - {-\wd\@tempboxa} - \noindent\box\@tempboxa} -\let \@hangfrom \GALhangfrom:n -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\setSGPVthing:nn #1 #2 { - \setDGPVthing:nn {#1} {#2} - \global\expandafter - \let\csname GAL@#1@s \expandafter\endcsname - \csname GAL@#1@ \endcsname -} -\def\setSGPVdimension:nn #1 #2 { - \setDGPVdimension:nn {#1} {#2} - \global\expandafter - \let\csname GAL@#1@s \expandafter\endcsname - \csname GAL@#1@ \endcsname -} -\def \setSGPVmeasure:nn #1 #2 { - \setlength\@totalleftmargin{#1} - \setlength\linewidth{#2} - \xdef\GAL@ps@s{\@ne\space - \the\@totalleftmargin\space \the\linewidth} - \global\let\GAL@ps@\GAL@ps@s -} -\def \addSGPVmeasure:nn #1 #2 { - \addtolength\@totalleftmargin{#1} - \addtolength\linewidth{#2} - \xdef\GAL@ps@s{\@ne\space - \the\@totalleftmargin\space \the\linewidth} - \global\let\GAL@ps@\GAL@ps@s -} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\DeclareDocumentCommand \vspace {s m } - { - \addDGPVdimension:nn{uv}{#2} - } -\def\addvspace#1{ - \maxDGPVdimension:nn{v}{#1} -} -\def\addpenalty#1{ - \addGALpenalty:n{#1} -} -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\RequirePackage{template} -\RequirePackage{xparse} -\DeclareTemplateType{endlist}{0} - -\DeclareTemplate{endlist}{std}{0}{ - penalty =+C \GAL@p@ , - vspace =+L \GAL@v@ , - parindent =+L \GAL@i@ , - par-penalty =+C [0] \GAL@p@X , - par-vspace =+L [\z@] \GAL@v@X , - par-parindent =+L [\z@] \GAL@i@X , - } - {\DoParameterAssignments - \setGALendlistpar:} - -\DeclareInstance{endlist}{list}{std}{ - penalty = 999 , - vspace = 10pt , - parindent = 0pt , - par-penalty = -1000 , - par-vspace = 5pt , - par-parindent = 10pt , - } -\GAL@init@static % this is to be after the templates by now - -\GAL@@everypar{\GAL@use@on@para\the\everypar} - -\AtBeginDocument { - \GAL@init@static % this is to be after the templates by now -} -\def\@@line#1{\GAL@use@on@vobject\hb@xt@\hsize{#1}\nobreak} - -\long\def \@savemarbox #1#2{% - \global\setbox #1% - \color@vbox - \vtop{% - \hsize\marginparwidth - \@parboxrestore - \@marginparreset - #2% - \par % needed nowadays! - \@minipagefalse - \outer@nobreak - }% - \color@endbox -} - -\long\def\@footnotetext#1{\insert\footins{% - \reset@font\footnotesize - \interlinepenalty\interfootnotelinepenalty - \splittopskip\footnotesep - \splitmaxdepth \dp\strutbox \floatingpenalty \@MM - \hsize\columnwidth \@parboxrestore - \protected@edef\@currentlabel{% - \csname p@footnote\endcsname\@thefnmark - }% - \color@begingroup - \@makefntext{% - \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox\par}% %ditto!!! - \color@endgroup}}% - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\def\showGALcmd#1{\GAL@typeout{In~#1: \the\GAL@level@num~ \on@line}} - -\def\@afterheading{ - \showGALcmd{@afterheading} - \if@afterindent \else - \setDGPVthing:nn i \@ne - \fi - \setGALbreak:n 2 -} - -\def\nofiles{% - \showGALcmd{} - \@fileswfalse - \typeout{No auxiliary output files.^^J}% - \long\def\protected@write##1##2##3% - {\write\m@ne{}% - } - \let\makeindex\relax - \let\makeglossary\relax} - -\long\def \protected@write#1#2#3{% - \showGALcmd{protected@write} - \begingroup - \let\thepage\relax - #2% - \let\protect\@unexpandable@protect - \edef\reserved@a{\write#1{#3}}% - \appendtoDGPVthing:no {nw} \reserved@a - \endgroup -} - -\def\markboth#1#2{\gdef\@themark{{#1}{#2}}{% - \showGALcmd{} - \let\protect\@unexpandable@protect - \let\label\relax \let\index\relax \let\glossary\relax - \mark{\@themark}}% -} - -\def\markright#1{{\let\protect\@unexpandable@protect - \showGALcmd{} - \let\label\relax \let\index\relax \let\glossary\relax - \expandafter\@markright\@themark - {#1}\mark{\@themark}}% -} - -\def \newpage {% - \showGALcmd{newpage} - \if@noskipsec - \ifx \@nodocument\relax - \leavevmode - \global \@noskipsecfalse - \fi - \fi - \if@inlabel - \leavevmode - \global \@inlabelfalse - \fi - \ifnum \GAL@b@ > \z@ - \setGALbreak:n 0 - \fi - \par - \vfil - \penalty -\@M} -\def\@arrayparboxrestore{% - \showGALcmd{@arrayparboxrestore} - \let\if@noskipsec\iffalse - \let\par\@@par - \let\-\@dischyph - \let\'\@acci\let\`\@accii\let\=\@acciii - \parindent\z@ \parskip\z@skip - \everypar{}% - \linewidth\hsize - \@totalleftmargin\z@ - \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip - \parfillskip\@flushglue \lineskip\normallineskip - \baselineskip\normalbaselineskip - \sloppy} - -\def\@startsection#1#2#3#4#5#6{% - \showGALcmd{@startsection} - \if@noskipsec \leavevmode \fi - \par - \@tempskipa #4\relax - \@afterindenttrue - \ifdim \@tempskipa <\z@ - \@tempskipa -\@tempskipa \@afterindentfalse - \fi - \ifnum \GAL@b@ = \z@ - \addpenalty\@secpenalty\addvspace\@tempskipa - \fi - \@ifstar - {\@ssect{#3}{#4}{#5}{#6}}% - {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}} - -\def\@xsect#1{% - \showGALcmd{@xsect} - \@tempskipa #1\relax - \ifdim \@tempskipa>\z@ - \par \nobreak - \vskip \@tempskipa - \@afterheading - \else - \global\@noskipsectrue - \setDGPVthing:nn i \@ne - \setGALbreak:n 2 - \setGALobject:n { \begingroup \@svsechd \endgroup - \unskip } - \@tempskipa #1\relax - \setDGPVdimension:nn h {-\@tempskipa} - \everypar{% - \if@noskipsec - \global\@noskipsecfalse - \else - \everypar{}% - \fi}% - \fi - \ignorespaces} - -\gdef\@specialoutput{% - \showGALcmd{@specialoutput} - \ifnum \outputpenalty>-\@Mii - \@doclearpage - \else - \GAL@ignore@next@galley - \ifnum \outputpenalty<-\@Miii - \ifnum \outputpenalty<-\@MM \deadcycles \z@ \fi - \global \setbox\@holdpg \vbox {\unvbox\@cclv}% - \else - \global \setbox\@holdpg \vbox{% - \unvbox\@holdpg - \unvbox\@cclv - \setbox\@tempboxa \lastbox - \unskip - }% - \@pagedp \dp\@holdpg - \@pageht \ht\@holdpg - \unvbox \@holdpg - \@next\@currbox\@currlist{% - \ifnum \count\@currbox>\z@ - \advance \@pageht \@pagedp - \ifvoid\footins \else - \advance \@pageht \ht\footins - \advance \@pageht \skip\footins - \advance \@pageht \dp\footins - \fi - \ifvbox \@kludgeins - \ifdim \wd\@kludgeins=\z@ - \advance \@pageht \ht\@kludgeins - \fi - \fi - \@reinserts - \@addtocurcol - \else - \@reinserts - \@addmarginpar - \fi - }\@latexbug - \ifnum \outputpenalty<\z@ - \addpenalty \interlinepenalty - \fi - \fi - \fi -} - -\def \@addtocurcol {% - \showGALcmd{@addtocurcol} - \@insertfalse - \@setfloattypecounts - \ifnum \@fpstype=8 - \else - \ifnum \@fpstype=24 - \else - \@flsettextmin - \advance \@textmin \@textfloatsheight - \@reqcolroom \@pageht - \ifdim \@textmin>\@reqcolroom - \@reqcolroom \@textmin - \fi - \advance \@reqcolroom \ht\@currbox - \ifdim \@colroom>\@reqcolroom - \@flsetnum \@colnum - \ifnum \@colnum>\z@ - \@bitor\@currtype\@deferlist - \if@test - \else - \@bitor\@currtype\@botlist - \if@test - \@addtobot - \else - \ifodd \count\@currbox - \advance \@reqcolroom \intextsep - \ifdim \@colroom>\@reqcolroom - \global \advance \@colnum \m@ne - \global \advance \@textfloatsheight \ht\@currbox - \global \advance \@textfloatsheight 2\intextsep - \@cons \@midlist \@currbox - \addpenalty \interlinepenalty - \vskip \intextsep - \box\@currbox - \penalty\interlinepenalty - \vskip\intextsep - \ifnum\outputpenalty <-\@Mii \vskip -\parskip\fi - \outputpenalty \z@ - \@inserttrue - \fi - \fi - \if@insert - \else - \@addtotoporbot - \fi - \fi - \fi - \fi - \fi - \fi - \fi - \if@insert - \else - \@resethfps - \@cons\@deferlist\@currbox - \fi -} - - -\def\@item[#1]{% - \showGALcmd{@item} - \if@noparitem - \@donoparitem - \else - \if@inlabel - \indent \par - \fi - \ifhmode - \unskip\unskip \par - \fi - \if@newlist - \if@nobreak - \@nbitem - \else - \addpenalty\@beginparpenalty - \addvspace\@topsep - \addvspace{-\parskip}% - \fi - \else - \addpenalty\@itempenalty - \addvspace\itemsep - \fi - \global\@inlabeltrue - \fi - \everypar{% - \@minipagefalse - \global\@newlistfalse - \if@inlabel - \global\@inlabelfalse - {\setbox\z@\lastbox - \ifvoid\z@ - \kern-\itemindent - \fi}% - \box\@labels - \penalty\z@ - \fi - \if@nobreak - \@nobreakfalse - \clubpenalty \@M - \else - \clubpenalty \@clubpenalty - \everypar{}% - \fi}% - \if@noitemarg - \@noitemargfalse - \if@nmbrlist - \refstepcounter\@listctr - \fi - \fi - \sbox\@tempboxa{\makelabel{#1}}% - \global\setbox\@labels\hbox{% - \unhbox\@labels - \hskip \itemindent - \hskip -\labelwidth - \hskip -\labelsep - \ifdim \wd\@tempboxa >\labelwidth - \box\@tempboxa - \else - \hbox to\labelwidth {\unhbox\@tempboxa}% - \fi - \hskip \labelsep}% - \ignorespaces} - -\DeclareRobustCommand{\LaTeX}{L\kern-.36em% - {\sbox\z@ T% - \GAL@ignore@next@galley@vbox to\ht\z@{\hbox{\check@mathfonts - \fontsize\sf@size\z@ - \math@fontsfalse\selectfont - A}% - \vss}% - }% - \kern-.15em% - \TeX} -\DeclareTextCommandDefault{\textunderscore}{% - \leavevmode \kern.06em\GAL@ignore@next@galley@vbox{\hrule\@width.3em}} -\DeclareTextCommandDefault{\textvisiblespace}{% - \mbox{\kern.06em\vrule \@height.3ex}% - \GAL@ignore@next@galley@vbox{\hrule \@width.3em}% - \hbox{\vrule \@height.3ex}} -\gdef\showhyphens#1{% - \setbox0\vbox{% - \color@begingroup - \everypar{}% - \parfillskip\z@skip\hsize\maxdimen - \normalfont - \pretolerance\m@ne\tolerance\m@ne\hbadness\z@\showboxdepth\z@\ #1% - \color@endgroup}} -\catcode`\:=12 -\long\def\@imakepicbox(#1,#2)[#3]#4{% - \GAL@ignore@next@galley@vbox to#2\unitlength - {\let\mb@b\vss \let\mb@l\hss\let\mb@r\hss - \let\mb@t\vss - \@tfor\reserved@a :=#3\do{% - \if s\reserved@a - \let\mb@l\relax\let\mb@r\relax - \else - \expandafter\let\csname mb@\reserved@a\endcsname\relax - \fi}% - \mb@t - \hb@xt@ #1\unitlength{\mb@l #4\mb@r}% - \mb@b - \kern\z@}} -\catcode`\:=11 -\long\def\frame#1{% - \leavevmode - \hbox{% - \hskip-\@wholewidth - \GAL@ignore@next@galley@vbox{% - \vskip-\@wholewidth - \hrule \@height\@wholewidth - \hbox{% - \vrule\@width\@wholewidth - #1% - \vrule\@width\@wholewidth}% - \hrule\@height\@wholewidth - \vskip-\@wholewidth}% - \hskip-\@wholewidth}} -\def\@frameb@x#1{% - \@tempdima\fboxrule - \advance\@tempdima\fboxsep - \advance\@tempdima\dp\@tempboxa - \hbox{% - \lower\@tempdima\hbox{% - \GAL@ignore@next@galley@vbox{% - \hrule\@height\fboxrule - \hbox{% - \vrule\@width\fboxrule - #1% - \GAL@ignore@next@galley@vbox{% - \vskip\fboxsep - \box\@tempboxa - \vskip\fboxsep}% - #1% - \vrule\@width\fboxrule}% - \hrule\@height\fboxrule}% - }% - }% -} -\typeout{****~ Careful:~ there~ is~ another~ rewrite~ for~ iiiparbox~ in~ coffins!} - -\long\def\@iiiparbox#1#2[#3]#4#5{% - \leavevmode - \@pboxswfalse - \setlength\@tempdima{#4}% - \@begin@tempboxa\vbox{\hsize\@tempdima\@parboxrestore#5\@@par}% - \ifx\relax#2\else - \setlength\@tempdimb{#2}% - \def\@parboxto{to\@tempdimb}% - \fi - \GAL@ignore@next@galley - \if#1b\vbox - \else\if #1t\vtop - \else\ifmmode\vcenter - \else\@pboxswtrue $\vcenter - \fi\fi\fi - \@parboxto{\let\hss\vss\let\unhbox\unvbox - \csname bm@#3\endcsname}% - \if@pboxsw \m@th$\fi - \@end@tempboxa} -\def\@iiiminipage#1#2[#3]#4{% - \leavevmode - \@pboxswfalse - \setlength\@tempdima{#4}% - \def\@mpargs{{#1}{#2}[#3]{#4}}% - \setbox\@tempboxa\vbox\bgroup - \color@begingroup - \hsize\@tempdima - \textwidth\hsize \columnwidth\hsize - \@parboxrestore - \def\@mpfn{mpfootnote}\def\thempfn{\thempfootnote}\c@mpfootnote\z@ - \let\@footnotetext\@mpfootnotetext - \let\@listdepth\@mplistdepth \@mplistdepth\z@ - \@minipagerestore - \@setminipage} -\long\def\@mpfootnotetext#1{% - \global\setbox\@mpfootins\vbox{% - \unvbox\@mpfootins - \reset@font\footnotesize - \hsize\columnwidth - \@parboxrestore - \protected@edef\@currentlabel - {\csname p@mpfootnote\endcsname\@thefnmark}% - \color@begingroup - \@makefntext{% - \rule\z@\footnotesep\ignorespaces#1\@finalstrut\strutbox}% - \color@endgroup}} -\def\@array[#1]#2{% - \GAL@ignore@next@galley - \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi - \bgroup - \setbox\@arstrutbox\hbox{% - \vrule \@height\arraystretch\ht\strutbox - \@depth\arraystretch \dp\strutbox - \@width\z@}% - \@mkpream{#2}% - \edef\@preamble{% - \ialign \noexpand\@halignto - \bgroup \@arstrut \@preamble \tabskip\z@skip \cr}% - \let\@startpbox\@@startpbox \let\@endpbox\@@endpbox - \let\tabularnewline\\% -%%%% \let\par\@empty - \let\@sharp##% - \set@typeset@protect - \lineskip\z@skip\baselineskip\z@skip - \ifhmode \@preamerr\z@ \@@par\fi - \@preamble} -\gdef\@shortstack[#1]{% - \leavevmode - \GAL@ignore@next@galley@vbox\bgroup - \baselineskip-\p@\lineskip 3\p@ - \let\mb@l\hss\let\mb@r\hss - \expandafter\let\csname mb@#1\endcsname\relax - \let\\\@stackcr - \@ishortstack} -\gdef\@ishortstack#1{\ialign{\mb@l {##}\unskip\mb@r\cr #1\crcr}\egroup} -\gdef\@stackcr{\@ifstar\@ixstackcr\@ixstackcr} -\gdef\@ixstackcr{\@ifnextchar[\@istackcr{\cr\ignorespaces}} -\gdef\@istackcr[#1]{\cr\noalign{\vskip #1}\ignorespaces} -\newif\if@negarg -\gdef\line(#1,#2)#3{\@xarg #1\relax \@yarg #2\relax - \@linelen #3\unitlength - \ifdim\@linelen<\z@\@badlinearg\else - \ifnum\@xarg =\z@ \@vline - \else \ifnum\@yarg =\z@ \@hline \else \@sline\fi - \fi - \fi} -\gdef\@sline{% - \ifnum\@xarg<\z@ \@negargtrue \@xarg -\@xarg \@yyarg -\@yarg - \else \@negargfalse \@yyarg \@yarg \fi -\ifnum \@yyarg >\z@ \@tempcnta\@yyarg \else \@tempcnta -\@yyarg \fi -\ifnum\@tempcnta>6 \@badlinearg\@tempcnta\z@ \fi -\ifnum\@xarg>6 \@badlinearg\@xarg \@ne \fi -\setbox\@linechar\hbox{\@linefnt\@getlinechar(\@xarg,\@yyarg)}% -\ifnum \@yarg >\z@ \let\@upordown\raise \@clnht\z@ - \else\let\@upordown\lower \@clnht \ht\@linechar\fi -\@clnwd \wd\@linechar -\if@negarg - \hskip -\wd\@linechar \def\reserved@a{\hskip -2\wd\@linechar}% -\else - \let\reserved@a\relax -\fi -\@whiledim \@clnwd <\@linelen \do - {\@upordown\@clnht\copy\@linechar - \reserved@a - \advance\@clnht \ht\@linechar - \advance\@clnwd \wd\@linechar}% -\advance\@clnht -\ht\@linechar -\advance\@clnwd -\wd\@linechar -\@tempdima\@linelen\advance\@tempdima -\@clnwd -\@tempdimb\@tempdima\advance\@tempdimb -\wd\@linechar -\if@negarg \hskip -\@tempdimb \else \hskip \@tempdimb \fi -\multiply\@tempdima \@m -\@tempcnta \@tempdima -\@tempdima \wd\@linechar \divide\@tempcnta \@tempdima -\@tempdima \ht\@linechar \multiply\@tempdima \@tempcnta -\divide\@tempdima \@m -\advance\@clnht \@tempdima -\ifdim \@linelen <\wd\@linechar - \hskip \wd\@linechar - \@picture@warn - \else\@upordown\@clnht\copy\@linechar\fi} -\gdef\@hline{\ifnum \@xarg <\z@ \hskip -\@linelen \fi -\vrule \@height \@halfwidth \@depth \@halfwidth \@width \@linelen -\ifnum \@xarg <\z@ \hskip -\@linelen \fi} -\gdef\@getlinechar(#1,#2){\@tempcnta#1\relax\multiply\@tempcnta 8% - \advance\@tempcnta -9\ifnum #2>\z@ \advance\@tempcnta #2\relax\else - \advance\@tempcnta -#2\relax\advance\@tempcnta 64 \fi - \char\@tempcnta} -\gdef\vector(#1,#2)#3{\@xarg #1\relax \@yarg #2\relax - \@tempcnta \ifnum\@xarg<\z@ -\@xarg\else\@xarg\fi - \ifnum\@tempcnta<5\relax - \@linelen #3\unitlength - \ifdim\@linelen<\z@\@badlinearg\else - \ifnum\@xarg =\z@ \@vvector - \else \ifnum\@yarg =\z@ \@hvector \else \@svector\fi - \fi - \fi - \else\@badlinearg\fi} -\gdef\@hvector{\@hline\hb@xt@\z@{\@linefnt - \ifnum \@xarg <\z@ \@getlarrow(1,0)\hss\else - \hss\@getrarrow(1,0)\fi}} -\gdef\@vvector{\ifnum \@yarg <\z@ \@downvector \else \@upvector \fi} -\gdef\@svector{\@sline - \@tempcnta\@yarg \ifnum\@tempcnta <\z@ \@tempcnta -\@tempcnta\fi - \ifnum\@tempcnta <5% - \hskip -\wd\@linechar - \@upordown\@clnht \hbox{\@linefnt \if@negarg - \@getlarrow(\@xarg,\@yyarg)\else \@getrarrow(\@xarg,\@yyarg)\fi}% - \else\@badlinearg\fi} -\gdef\@getlarrow(#1,#2){\ifnum #2=\z@ \@tempcnta'33 \else - \@tempcnta #1\relax\multiply\@tempcnta \sixt@@n \advance\@tempcnta - -9 \@tempcntb #2\relax\multiply\@tempcntb \tw@ - \ifnum \@tempcntb >\z@ \advance\@tempcnta \@tempcntb - \else\advance\@tempcnta -\@tempcntb\advance\@tempcnta 64 - \fi\fi\char\@tempcnta} -\gdef\@getrarrow(#1,#2){\@tempcntb #2\relax -\ifnum\@tempcntb <\z@ \@tempcntb -\@tempcntb\relax\fi -\ifcase \@tempcntb\relax \@tempcnta'55 \or -\ifnum #1<\thr@@ \@tempcnta #1\relax\multiply\@tempcnta -24\advance\@tempcnta -6 \else \ifnum #1=\thr@@ \@tempcnta 49 -\else\@tempcnta 58 \fi\fi\or -\ifnum #1<\thr@@ \@tempcnta=#1\relax\multiply\@tempcnta -24\advance\@tempcnta -\thr@@ \else \@tempcnta 51 \fi\or -\@tempcnta #1\relax\multiply\@tempcnta -\sixt@@n \advance\@tempcnta -\tw@ \else -\@tempcnta #1\relax\multiply\@tempcnta -\sixt@@n \advance\@tempcnta 7 \fi\ifnum #2<\z@ \advance\@tempcnta 64 \fi -\char\@tempcnta} -\gdef\@vline{\ifnum \@yarg <\z@ \@downline \else \@upline\fi} -\gdef\@upline{% - \hb@xt@\z@{\hskip -\@halfwidth \vrule \@width \@wholewidth - \@height \@linelen \@depth \z@\hss}} -\gdef\@downline{% - \hb@xt@\z@{\hskip -\@halfwidth \vrule \@width \@wholewidth - \@height \z@ \@depth \@linelen \hss}} -\gdef\@upvector{\@upline\setbox\@tempboxa\hbox{\@linefnt\char'66}\raise - \@linelen \hb@xt@\z@{\lower \ht\@tempboxa\box\@tempboxa\hss}} -\gdef\@downvector{\@downline\lower \@linelen - \hb@xt@\z@{\@linefnt\char'77\hss}} -\gdef\dashbox#1(#2,#3){\leavevmode\hb@xt@\z@{\baselineskip \z@skip -\lineskip \z@skip -\@dashdim #2\unitlength -\@dashcnt \@dashdim \advance\@dashcnt 200 -\@dashdim #1\unitlength\divide\@dashcnt \@dashdim -\ifodd\@dashcnt\@dashdim \z@ -\advance\@dashcnt \@ne \divide\@dashcnt \tw@ -\else \divide\@dashdim \tw@ \divide\@dashcnt \tw@ -\advance\@dashcnt \m@ne -\setbox\@dashbox \hbox{\vrule \@height \@halfwidth \@depth \@halfwidth -\@width \@dashdim}\put(0,0){\copy\@dashbox}% -\put(0,#3){\copy\@dashbox}% -\put(#2,0){\hskip-\@dashdim\copy\@dashbox}% -\put(#2,#3){\hskip-\@dashdim\box\@dashbox}% -\multiply\@dashdim \thr@@ -\fi -\setbox\@dashbox \hbox{\vrule \@height \@halfwidth \@depth \@halfwidth -\@width #1\unitlength\hskip #1\unitlength}\@tempcnta\z@ -\put(0,0){\hskip\@dashdim \@whilenum \@tempcnta <\@dashcnt -\do{\copy\@dashbox\advance\@tempcnta \@ne }}\@tempcnta\z@ -\put(0,#3){\hskip\@dashdim \@whilenum \@tempcnta <\@dashcnt -\do{\copy\@dashbox\advance\@tempcnta \@ne }}% -\@dashdim #3\unitlength -\@dashcnt \@dashdim \advance\@dashcnt 200 -\@dashdim #1\unitlength\divide\@dashcnt \@dashdim -\ifodd\@dashcnt \@dashdim \z@ -\advance\@dashcnt \@ne \divide\@dashcnt \tw@ -\else -\divide\@dashdim \tw@ \divide\@dashcnt \tw@ -\advance\@dashcnt \m@ne -\setbox\@dashbox\hbox{\hskip -\@halfwidth -\vrule \@width \@wholewidth -\@height \@dashdim}\put(0,0){\copy\@dashbox}% -\put(#2,0){\copy\@dashbox}% -\put(0,#3){\lower\@dashdim\copy\@dashbox}% -\put(#2,#3){\lower\@dashdim\copy\@dashbox}% -\multiply\@dashdim \thr@@ -\fi -\setbox\@dashbox\hbox{\vrule \@width \@wholewidth -\@height #1\unitlength}\@tempcnta\z@ -\put(0,0){\hskip -\@halfwidth \GAL@ignore@next@galley@vbox{\@whilenum \@tempcnta <\@dashcnt -\do{\vskip #1\unitlength\copy\@dashbox\advance\@tempcnta \@ne }% -\vskip\@dashdim}}\@tempcnta\z@ -\put(#2,0){\hskip -\@halfwidth \GAL@ignore@next@galley@vbox{\@whilenum \@tempcnta<\@dashcnt -\do{\vskip #1\unitlength\copy\@dashbox\advance\@tempcnta \@ne }% -\vskip\@dashdim}}}\@makepicbox(#2,#3)} -\gdef\@ovvert#1#2{\GAL@ignore@next@galley@vbox to\@ovyy{% - \if@ovb \@tempcntb \@tempcnta \advance \@tempcntb #1\relax - \kern -\@ovro \hbox{\char \@tempcntb}\nointerlineskip - \else \kern \@ovri \kern \@ovdy \fi - \leaders\vrule \@width \@wholewidth\vfil \nointerlineskip - \if@ovt \@tempcntb \@tempcnta \advance \@tempcntb #2\relax - \hbox{\char \@tempcntb}% - \else \kern \@ovdy \kern \@ovro \fi}} -\catcode`\:=12 -\def\@xfloat #1[#2]{% - \@nodocument - \def \@captype {#1}% - \def \@fps {#2}% - \@onelevel@sanitize \@fps - \def \reserved@b {!}% - \ifx \reserved@b \@fps - \@fpsadddefault - \else - \ifx \@fps \@empty - \@fpsadddefault - \fi - \fi - \ifhmode - \@bsphack - \@floatpenalty -\@Mii - \else - \@floatpenalty-\@Miii - \fi - \ifinner - \@parmoderr\@floatpenalty\z@ - \else - \@next\@currbox\@freelist - {% - \@tempcnta \sixt@@n - \expandafter \@tfor \expandafter \reserved@a - \expandafter :\expandafter =\@fps - \do - {% - \if \reserved@a h% - \ifodd \@tempcnta - \else - \advance \@tempcnta \@ne - \fi - \fi - \if \reserved@a t% - \@setfpsbit \tw@ - \fi - \if \reserved@a b% - \@setfpsbit 4% - \fi - \if \reserved@a p% - \@setfpsbit 8% - \fi - \if \reserved@a !% - \ifnum \@tempcnta>15 - \advance\@tempcnta -\sixt@@n\relax - \fi - \fi - }% - \@tempcntb \csname ftype@\@captype \endcsname - \multiply \@tempcntb \@xxxii - \advance \@tempcnta \@tempcntb - \global \count\@currbox \@tempcnta - }% - \@fltovf - \fi - \global \setbox\@currbox - \color@vbox - \normalcolor - \vbox \bgroup - \hsize\columnwidth - \@parboxrestore - \@floatboxreset -} -\catcode`\:=11 -\def\end@float{% - \@endfloatbox - \ifnum\@floatpenalty <\z@ - \@largefloatcheck - \@cons\@currlist\@currbox - \ifnum\@floatpenalty <-\@Mii - \penalty -\@Miv - \@tempdima\prevdepth - \GAL@ignore@next@galley@vbox{}% - \prevdepth\@tempdima - \penalty\@floatpenalty - \else - \vadjust{\penalty -\@Miv \GAL@ignore@next@galley@vbox{}\penalty\@floatpenalty}\@Esphack - \fi - \fi -} -\def \@xympar{% - \ifnum\@floatpenalty <\z@\@cons\@currlist\@marbox\fi - \setbox\@tempboxa - \color@vbox - \vbox \bgroup - \end@float - \@ignorefalse - \@esphack -} -\def \AtBeginDvi #1{% - \global \setbox \@begindvibox - \vbox{\unvbox \@begindvibox #1}% -} -\def\clearpage{% - \ifvmode - \ifnum \@dbltopnum =\m@ne - \ifdim \pagetotal <\topskip - \hbox{}% - \fi - \fi - \fi - \newpage - \write\m@ne{}% - \GAL@ignore@next@galley@vbox{}% - \penalty -\@Mi -} -\def \@emptycol {\GAL@ignore@next@galley@vbox{}\penalty -\@M} -\long\def \@topnewpage [#1]{% - \@nodocument - \@next\@currbox\@freelist{}{}% - \global \setbox\@currbox - \color@vbox - \normalcolor - \vbox {% - \hsize\textwidth - \@parboxrestore - \col@number \@ne - #1% - \vskip -\dbltextfloatsep - }% - \color@endbox - \ifdim \ht\@currbox>\textheight - \ht\@currbox \textheight - \fi - \global \count\@currbox \tw@ - \@tempdima -\ht\@currbox - \advance \@tempdima -\dbltextfloatsep - \global \advance \@colht \@tempdima - \ifx \@dbltoplist \@empty - \else - \@latexerr{Float(s) lost}\@ehb - \let \@dbltoplist \@empty - \fi - \@cons \@dbltoplist \@currbox - \global \@dbltopnum \m@ne - \ifdim \@colht<2.5\baselineskip - \@latex@warning@no@line {Optional argument of \noexpand\twocolumn - too tall on page \thepage}% - \@emptycol - \if@firstcolumn - \else - \@emptycol - \fi - \else - \global \vsize \@colht - \global \@colroom \@colht - \@floatplacement - \fi -} -\gdef\@specialoutput{% - \ifnum \outputpenalty>-\@Mii - \@doclearpage - \else - \ifnum \outputpenalty<-\@Miii - \ifnum \outputpenalty<-\@MM \deadcycles \z@ \fi - \global \setbox\@holdpg \vbox {\unvbox\@cclv}% - \else - \global \setbox\@holdpg \vbox{% - \unvbox\@holdpg - \unvbox\@cclv - \setbox\@tempboxa \lastbox - \unskip - }% - \@pagedp \dp\@holdpg - \@pageht \ht\@holdpg - \unvbox \@holdpg - \@next\@currbox\@currlist{% - \ifnum \count\@currbox>\z@ - \advance \@pageht \@pagedp - \ifvoid\footins \else - \advance \@pageht \ht\footins - \advance \@pageht \skip\footins - \advance \@pageht \dp\footins - \fi - \ifvbox \@kludgeins - \ifdim \wd\@kludgeins=\z@ - \advance \@pageht \ht\@kludgeins - \fi - \fi - \@reinserts - \@addtocurcol - \else - \@reinserts - \@addmarginpar - \fi - }\@latexbug - \ifnum \outputpenalty<\z@ - \if@nobreak - \nobreak - \else - \addpenalty \interlinepenalty - \fi - \fi - \fi - \fi -} -\def \@doclearpage {% - \ifvoid\footins - \setbox\@tempboxa\vsplit\@cclv to\z@ \unvbox\@tempboxa - \setbox\@tempboxa\box\@cclv - \xdef\@deferlist{\@toplist\@botlist\@deferlist}% - \global \let \@toplist \@empty - \global \let \@botlist \@empty - \global \@colroom \@colht - \ifx \@currlist\@empty - \else - \@latexerr{Float(s) lost}\@ehb - \global \let \@currlist \@empty - \fi - \@makefcolumn\@deferlist - \@whilesw\if@fcolmade \fi{\@opcol\@makefcolumn\@deferlist}% - \if@twocolumn - \if@firstcolumn - \xdef\@dbldeferlist{\@dbltoplist\@dbldeferlist}% - \global \let \@dbltoplist \@empty - \global \@colht \textheight - \begingroup - \@dblfloatplacement - \@makefcolumn\@dbldeferlist - \@whilesw\if@fcolmade \fi{\@outputpage - \@makefcolumn\@dbldeferlist}% - \endgroup - \else - \GAL@ignore@next@galley@vbox{}\clearpage - \fi - \fi - \else - \setbox\@cclv\vbox{\box\@cclv\vfil}% - \@makecol\@opcol - \clearpage - \fi -} -\gdef \@makecol {% - \ifvoid\footins - \setbox\@outputbox \box\@cclv - \else - \setbox\@outputbox \vbox {% - \boxmaxdepth \@maxdepth - \@tempdima\dp\@cclv - \unvbox \@cclv - \vskip-\@tempdima - \vskip \skip\footins - \color@begingroup - \normalcolor - \footnoterule - \unvbox \footins - \color@endgroup - }% - \fi - \xdef\@freelist{\@freelist\@midlist}% - \global \let \@midlist \@empty - \@combinefloats - \ifvbox\@kludgeins - \@makespecialcolbox - \else - \setbox\@outputbox \vbox to\@colht {% - \@texttop - \dimen@ \dp\@outputbox - \unvbox \@outputbox - \vskip -\dimen@ - \@textbottom - }% - \fi - \global \maxdepth \@maxdepth -} -\gdef \@makespecialcolbox {% - \setbox\@outputbox \vbox {% - \@texttop - \dimen@ \dp\@outputbox - \unvbox\@outputbox - \vskip-\dimen@ - }% - \@tempdima \@colht - \ifdim \wd\@kludgeins>\z@ - \advance \@tempdima -\ht\@outputbox - \advance \@tempdima \pageshrink - \setbox\@outputbox \vbox to \@colht {% - \unvbox\@outputbox - \vskip \@tempdima - \@textbottom - }% - \else - \advance \@tempdima -\ht\@kludgeins - \setbox \@outputbox \vbox to \@colht {% - \GAL@ignore@next@galley@vbox to \@tempdima {% - \unvbox\@outputbox - \@textbottom}% - \vss}% - \fi - {\setbox \@tempboxa \box \@kludgeins}% -} -\def\@outputpage{% -\begingroup % the \endgroup is put in by \aftergroup - \@resetactivechars - \@parboxrestore - \let \protect \noexpand % <- this moved after parboxrestore!!!! - \shipout \vbox{% - \set@typeset@protect - \aftergroup \endgroup - \aftergroup \set@typeset@protect - % correct? or just restore by ending - % the group? - \if@specialpage - \global\@specialpagefalse\@nameuse{ps@\@specialstyle}% - \fi - \if@twoside - \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot - \let\@themargin\oddsidemargin - \else \let\@thehead\@evenhead - \let\@thefoot\@evenfoot \let\@themargin\evensidemargin - \fi - \fi - \reset@font - \normalsize - \normalsfcodes - \let\label\@gobble - \let\index\@gobble - \let\glossary\@gobble - \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@ - \@begindvi - \vskip \topmargin - \moveright\@themargin \vbox {% - \setbox\@tempboxa \vbox to\headheight{% - \vfil - \color@hbox - \normalcolor - \hb@xt@\textwidth{\@thehead}% - \color@endbox - }% %% 22 Feb 87 - \dp\@tempboxa \z@ - \box\@tempboxa - \vskip \headsep - \box\@outputbox - \baselineskip \footskip - \color@hbox - \normalcolor - \hb@xt@\textwidth{\@thefoot}% - \color@endbox - }% - }% - \global \@colht \textheight - \stepcounter{page}% - \let\firstmark\botmark -} -\def \@cflt{% - \let \@elt \@comflelt - \setbox\@tempboxa \vbox{}% - \@toplist - \setbox\@outputbox \vbox{% - \boxmaxdepth \maxdepth - \unvbox\@tempboxa - \vskip -\floatsep - \topfigrule - \vskip \textfloatsep - \unvbox\@outputbox - }% - \let\@elt\relax - \xdef\@freelist{\@freelist\@toplist}% - \global\let\@toplist\@empty -} -\def\@comflelt#1{\setbox\@tempboxa - \vbox{\unvbox\@tempboxa\box #1\vskip\floatsep}} -\def \@combinedblfloats{% - \ifx \@dbltoplist \@empty - \else - \setbox\@tempboxa \vbox{}% - \let \@elt \@comdblflelt - \@dbltoplist - \let \@elt \relax - \xdef \@freelist {\@freelist\@dbltoplist}% - \global\let \@dbltoplist \@empty - \setbox\@outputbox \vbox to\textheight - {%\boxmaxdepth\maxdepth %% probably not needed, CAR - \unvbox\@tempboxa\vskip-\dblfloatsep - \ifnum \@dbltopnum>\m@ne - \dblfigrule - \fi - \vskip \dbltextfloatsep - \box\@outputbox - }% - \fi -} -\def\@vtryfc #1{% - \global\setbox\@outputbox\vbox{}% - \let\@elt\@wtryfc - \@flsucceed - \global\setbox\@outputbox \vbox to\@colht{% - \vskip \@fptop - \vskip -\@fpsep - \unvbox \@outputbox - \vskip \@fpbot}% - \let\@elt\relax - \xdef #1{\@failedlist\@flfail}% - \xdef\@freelist{\@freelist\@flsucceed}} -\def\@wtryfc #1{% - \global\setbox\@outputbox\vbox{% - \unvbox\@outputbox - \vskip\@fpsep - \box #1}} -\def\@addmarginpar{\@next\@marbox\@currlist{\@cons\@freelist\@marbox - \@cons\@freelist\@currbox}\@latexbug\@tempcnta\@ne - \if@twocolumn - \if@firstcolumn \@tempcnta\m@ne \fi - \else - \if@mparswitch - \ifodd\c@page \else\@tempcnta\m@ne \fi - \fi - \if@reversemargin \@tempcnta -\@tempcnta \fi - \fi - \ifnum\@tempcnta <\z@ \global\setbox\@marbox\box\@currbox \fi - \@tempdima\@mparbottom - \advance\@tempdima -\@pageht - \advance\@tempdima\ht\@marbox - \ifdim\@tempdima >\z@ - \@latex@warning@no@line {Marginpar on page \thepage\space moved}% - \else - \@tempdima\z@ - \fi - \global\@mparbottom\@pageht - \global\advance\@mparbottom\@tempdima - \global\advance\@mparbottom\dp\@marbox - \global\advance\@mparbottom\marginparpush - \advance\@tempdima -\ht\@marbox - \global\setbox \@marbox - \vbox {\vskip \@tempdima - \box \@marbox}% - \global \ht\@marbox \z@ - \global \dp\@marbox \z@ - \kern -\@pagedp - \nointerlineskip - \hb@xt@\columnwidth - {\ifnum \@tempcnta >\z@ - \hskip\columnwidth \hskip\marginparsep - \else - \hskip -\marginparsep \hskip -\marginparwidth - \fi - \box\@marbox \hss}% - \nointerlineskip - \hbox{\vrule \@height\z@ \@width\z@ \@depth\@pagedp}} -\def\@outputdblcol{% - \if@firstcolumn - \global \@firstcolumnfalse - \global \setbox\@leftcolumn \box\@outputbox - \else - \global \@firstcolumntrue - \setbox\@outputbox \vbox {% - \hb@xt@\textwidth {% - \hb@xt@\columnwidth {% - \box\@leftcolumn \hss}% - \hfil - \vrule \@width\columnseprule - \hfil - \hb@xt@\columnwidth {% - \box\@outputbox \hss}% - }% - }% - \@combinedblfloats - \@outputpage - \begingroup - \@dblfloatplacement - \@startdblcolumn - \@whilesw\if@fcolmade \fi - {\@outputpage - \@startdblcolumn}% - \endgroup - \fi -} - -\catcode`\:=12\relax -\endinput -%% -%% End of file `galley2.sty'. diff --git a/Master/texmf-dist/tex/latex3/galley/xhj.sty b/Master/texmf-dist/tex/latex3/galley/xhj.sty deleted file mode 100644 index b8196755c76..00000000000 --- a/Master/texmf-dist/tex/latex3/galley/xhj.sty +++ /dev/null @@ -1,313 +0,0 @@ -%% -%% This is file `xhj.sty', -%% generated with the docstrip utility. -%% -%% The original source files were: -%% -%% xhj.dtx (with options: `package,trace') -%% -%% -%% $Header: /usr3/users/latex3/design/consolidation/CURRENT/RCS/xhj.dtx,v 1.8 2000/01/14 15:24:24 latex3 Exp $ -%% -%% (C) Copyright 1999-2000 Frank Mittelbach -%% All rights reserved. -%% -%% Not for general distribution. In its present form it is not allowed -%% to put this package onto CD or an archive without consulting the -%% the authors. -%% -%% This module only works in conjunction with the galley2 module. -%% -\NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{xhj} - [2000/01/14 v0.3c hyphenation & justification] - -%% -\NeedsTeXFormat{LaTeX2e}[1998/12/01] -\RequirePackage{template,xparse} - % be loaded afterwards !!!! -\IgnoreWhiteSpace -\catcode`\:=11\relax -\def\@usefontdimen#1{\fontdimen#1\font} -\def\fontslant {\@usefontdimen1} -\def\fontwordspace {\@usefontdimen2} -\def\fontwordspacestretch {\@usefontdimen3} -\def\fontwordspaceshrink {\@usefontdimen4} -\def\fontex {\@usefontdimen5} -\def\fontem {\@usefontdimen6} -\def\fontextraspace {\@usefontdimen7} -\DeclareTemplateType{measure}{1} -\DeclareTemplate{measure}{absolute}{1}{ - leftmargin =l \leftmargin, - rightmargin =l \rightmargin, - }{ - \DoParameterAssignments - \IfNoValueF{#1} { \setlength\leftmargin{ #1 + \@totalleftmargin } } - \setSGPVmeasure:nn \leftmargin {\hsize -\leftmargin -\rightmargin } -} -\DeclareTemplate{measure}{relative}{1}{ - leftmargin =l \leftmargin, - rightmargin =l \rightmargin, - }{ - \DoParameterAssignments - \IfNoValueF{#1} { \setlength\leftmargin{#1} } - \addSGPVmeasure:nn \leftmargin { -\leftmargin -\rightmargin } -} -\DeclareTemplateType{pshape}{0} -\DeclareTemplate{pshape}{cutout}{0}{ - no-page-break-boolean =s {\setGALbreak:n {-3}}{}, - left-side-boolean =s {}{\let\shape@side\setGALrightparshape:nnn}, - normal-lines-num =C \pshape@normalines, - parshape-list =f0 \pshape@parshape, - }{ - \let\pshape@normalines\z@ - \let\shape@side\setGALleftparshape:nnn - \DoParameterAssignments - \shape@side \pshape@normalines \z@ \pshape@parshape - } -\DeclareInstance{pshape}{staggered}{cutout}{ - no-page-break-boolean = true, - normal-lines-num = 1, - parshape-list = { 20pt, 40pt, 60pt }, -} -\DeclareInstance{pshape}{ltriangle}{cutout}{ - no-page-break-boolean = true, - normal-lines-num = 0, - parshape-list = { 60pt, 40pt, 20pt }, -} -\DeclareInstance{pshape}{rectangle}{cutout}{ - no-page-break-boolean = false, - normal-lines-num = 0, - parshape-list = { }, -} -\DeclareTemplateType{justification}{0} -\DeclareTemplate{justification}{single}{0}{ - startskip =L \justification@a , - leftskip =L \justification@b , - rightskip =L \justification@c , - parfillskip =L \justification@d , - spaceskip =L \justification@e , - xspaceskip =L \justification@f , - linefillskip =L \justification@g , - parindent =L \justification@h , - }{ - \def\justification@a{\z@} - \def\justification@b{\leftskip} - \def\justification@c{\rightskip} - \def\justification@d{\parfillskip} - \def\justification@e{\spaceskip} - \def\justification@f{\xspaceskip} - \def\justification@g{\justification@d} - \def\justification@h{\parindent} - \DoParameterAssignments - \xdef \GAL@j@ - {{\justification@a} - {\justification@b} - {\justification@c} - {\justification@d} - {\justification@e} - {\justification@f} - {\justification@g} - {\justification@h} - } - \GAL@prepare@reassign:NN \GAL@j@ \GAL@j@s - } -\DeclareTemplate{justification}{std}{0}{ - startskip =L \justification@a , - leftskip =L \justification@b , - rightskip =L \justification@c , - parfillskip =L \justification@d , - spaceskip =L \justification@e , - xspaceskip =L \justification@f , - linefillskip =L \justification@g , - parindent =L \justification@h , - } - { - \def\justification@a{\z@} - \def\justification@b{\leftskip} - \def\justification@c{\rightskip} - \def\justification@d{\parfillskip} - \def\justification@e{\spaceskip} - \def\justification@f{\xspaceskip} - \def\justification@g{\justification@d} - \def\justification@h{\parindent} - \DoParameterAssignments - \edef \@tempa {\noexpand \setSGPVthing:nn j - {{\justification@a} - {\justification@b} - {\justification@c} - {\justification@d} - {\justification@e} - {\justification@f} - {\justification@g} - {\justification@h} - } - } - \@tempa - \expandafter \setup@paragraph@justification \GAL@j@ -} -\DeclareTemplate{justification}{complex}{0}{ - first-para-justification-setup =i {justification} - \justification@first, - other-para-justification-setup =i {justification} - \justification@other, - } - { - \DoParameterAssignments - \justification@other - \justification@first - } -\DeclareInstance{justification}{adjust}{std} - {rightskip =0pt, - leftskip =0pt, - startskip =0pt, - parfillskip=\fill -} -\DeclareInstance{justification}{default}{std} - {rightskip =0pt, - leftskip =0pt, - startskip =0pt, - parfillskip=\fill -} -\DeclareInstance{justification}{adjust2}{std} - {parindent = 0pt, - rightskip = 0pt, - leftskip = 0pt, - startskip = 0pt, - parfillskip= 20pt plus 1fil -} -\DeclareInstance{justification}{center}{std} - {parindent =0pt, - rightskip =\fill, - leftskip =\fill, - startskip =0pt, - parfillskip=0pt -} -\DeclareInstance{justification}{centermiddle}{std} - {parindent =0pt, - rightskip =36pt plus 1fill, - leftskip =36pt plus 1fill, - startskip =-36pt plus -1fill, - parfillskip=-36pt plus -1fill, - linefillskip= 0pt, -} -\DeclareInstance{justification}{raggedright}{std} - {rightskip = \DelayEvaluation 0pt plus 2em, - leftskip = 0pt, - startskip = 0pt, - parfillskip= \fill, - spaceskip = \DelayEvaluation \fontwordspace, - xspaceskip = \DelayEvaluation \fontwordspace + \fontextraspace, -} -\DeclareInstance{justification}{flushleft}{std} - {rightskip =\fill, - leftskip =0pt, - startskip =0pt, - parfillskip=\fill, -} -\DeclareInstance{justification}{raggedleft}{std} - {leftskip = \DelayEvaluation 0pt plus 2em, - rightskip = 0pt, - startskip = 0pt, - parfillskip= 0pt, - spaceskip = \DelayEvaluation \fontwordspace, - xspaceskip = \DelayEvaluation \fontwordspace + \fontextraspace, -} -\DeclareInstance{justification}{flushright}{std} - {leftskip = \fill, - rightskip = 0pt, - startskip = 0pt, - parfillskip= 0pt, -} -\DeclareInstance{justification}{centerfirst}{single} - {parindent = 0pt, - rightskip = \fill, - leftskip = -\fill, - parfillskip= 0pt, - startskip = 0pt plus 2fill, - linefillskip= 0pt, -} -\DeclareInstance{justification}{centerfirst-adjust}{complex} - { first-para-justification-setup = centerfirst, - other-para-justification-setup = adjust - } -\DeclareTemplateType{linebreak}{0} -\DeclareTemplate{linebreak}{TeX}{0}{ - pretolerance =c [100] \pretolerance, - tolerance =c [200] \tolerance, - linepenalty =c [10] \linepenalty, - binoppenalty =c [700] \binoppenalty, - relpenalty =c [500] \relpenalty, - hbadness =c [1000] \hbadness, - adjdemerits =c [10000] \adjdemerits, - doublehyphendemerits =c [10000] \doublehyphendemerits, - finalhyphendemerits =c [5000] \finalhyphendemerits, - hfuzz =l [.1pt] \hfuzz, - emergencystretch =l [0pt] \emergencystretch, -} - {\DoParameterAssignments - \GAL@typeout{Now~ changing~ linebreaking} - } -\DeclareInstance{linebreak}{default}{TeX}{} -\DeclareInstance{linebreak}{fussy}{TeX}{} -\DeclareInstance{linebreak}{sloppy}{TeX} - { - tolerance = 9999, - hfuzz = .5pt, - emergencystretch = \DelayEvaluation 3em, - } -\def\fussy {\UseInstance{linebreak}{fussy}} -\def\sloppy{\UseInstance{linebreak}{sloppy}} -\DeclareTemplateType{hyphenation}{0} - -\DeclareTemplate{hyphenation}{TeX}{0}{ - uchyph =c [1] \uchyph, - hyphenpenalty =c [50] \hyphenpenalty, - exhyphenpenalty =c [50] \exhyphenpenalty, - lefthyphenmin =c \lefthyphenmin, - righthyphenmin =c \righthyphenmin, -} - {\DoParameterAssignments - \GAL@typeout{Now~ changing~ hyphenation} - } -\newcount\@@lefthyphenmin -\DeclareTemplate{hyphenation}{std}{0}{ - hyphen-enable-boolean =s {\ifnum\@@lefthyphenmin>\z@ - \lefthyphenmin\@@lefthyphenmin - \fi} - {\@@lefthyphenmin\lefthyphenmin - \lefthyphenmin\@M}, - hyphen-uppercase-boolean =s {\uchyph\@ne}{\uchyph\z@}, - hyphen-discourage-boolean=s {\hyphenpenalty\@highpenalty - \exhyphenpenalty\@highpenalty}{}, - hyphen-encourage-boolean =s {\hyphenpenalty\@lowpenalty - \exhyphenpenalty\@lowpenalty}{}, -} - {\DoParameterAssignments - \GAL@typeout{Now~ changing~ hyphenation} - } -\DeclareInstance{hyphenation}{default}{TeX} - {} -\DeclareInstance{hyphenation}{off}{std} - {hyphen-enable-boolean = false} -\DeclareInstance{hyphenation}{on}{std} - {hyphen-enable-boolean = true} -\DeclareInstance{hyphenation}{discourage}{std} - {hyphen-enable-boolean = true, - hyphen-discourage-boolean = true} -\DeclareTemplateType{hj}{0} -\DeclareTemplate{hj}{std}{0}{ - justification-setup =i {justification} [default] \hj@justification, - linebreak-setup =i {linebreak} [default] \hj@linebreak, - hyphenation-setup =i {hyphenation} [default] \hj@hyphenation, -} - {\DoParameterAssignments - \hj@justification - \hj@linebreak - \hj@hyphenation - } -\DeclareInstance{hj}{default}{std}{} -\catcode`\:=12\relax -\endinput -%% -%% End of file `xhj.sty'. diff --git a/Master/tlpkg/tlpsrc/galley.tlpsrc b/Master/tlpkg/tlpsrc/galley.tlpsrc deleted file mode 100644 index 6f4a9e03438..00000000000 --- a/Master/tlpkg/tlpsrc/galley.tlpsrc +++ /dev/null @@ -1,2 +0,0 @@ -name galley -category Package |