| 1 |
% \iffalse meta-comment |
| 2 |
% |
| 3 |
% hanging.dtx |
| 4 |
% Author: Peter Wilson, Herries Press |
| 5 |
% Maintainer: Will Robertson (will dot robertson at latex-project dot org) |
| 6 |
% Copyright 1998--2004 Peter R. Wilson |
| 7 |
% |
| 8 |
% This work may be distributed and/or modified under the |
| 9 |
% conditions of the LaTeX Project Public License, either |
| 10 |
% version 1.3c of this license or (at your option) any |
| 11 |
% later version: <http://www.latex-project.org/lppl.txt> |
| 12 |
% |
| 13 |
% This work has the LPPL maintenance status "maintained". |
| 14 |
% The Current Maintainer of this work is Will Robertson. |
| 15 |
% |
| 16 |
% This work consists of the files listed in the README file. |
| 17 |
% |
| 18 |
% |
| 19 |
%<*driver> |
| 20 |
\documentclass{ltxdoc} |
| 21 |
\usepackage{url} |
| 22 |
\EnableCrossrefs |
| 23 |
\CodelineIndex |
| 24 |
\setcounter{StandardModuleDepth}{1} |
| 25 |
\begin{document} |
| 26 |
\DocInput{hanging.dtx} |
| 27 |
\end{document} |
| 28 |
%</driver> |
| 29 |
% |
| 30 |
% \fi |
| 31 |
% |
| 32 |
% \CheckSum{308} |
| 33 |
% |
| 34 |
% \DoNotIndex{\',\.,\@M,\@@input,\@addtoreset,\@arabic,\@badmath} |
| 35 |
% \DoNotIndex{\@centercr,\@cite} |
| 36 |
% \DoNotIndex{\@dotsep,\@empty,\@float,\@gobble,\@gobbletwo,\@ignoretrue} |
| 37 |
% \DoNotIndex{\@input,\@ixpt,\@m} |
| 38 |
% \DoNotIndex{\@minus,\@mkboth,\@ne,\@nil,\@nomath,\@plus,\@set@topoint} |
| 39 |
% \DoNotIndex{\@tempboxa,\@tempcnta,\@tempdima,\@tempdimb} |
| 40 |
% \DoNotIndex{\@tempswafalse,\@tempswatrue,\@viipt,\@viiipt,\@vipt} |
| 41 |
% \DoNotIndex{\@vpt,\@warning,\@xiipt,\@xipt,\@xivpt,\@xpt,\@xviipt} |
| 42 |
% \DoNotIndex{\@xxpt,\@xxvpt,\\,\ ,\addpenalty,\addtolength,\addvspace} |
| 43 |
% \DoNotIndex{\advance,\Alph,\alph} |
| 44 |
% \DoNotIndex{\arabic,\ast,\begin,\begingroup,\bfseries,\bgroup,\box} |
| 45 |
% \DoNotIndex{\bullet} |
| 46 |
% \DoNotIndex{\cdot,\cite,\CodelineIndex,\cr,\day,\DeclareOption} |
| 47 |
% \DoNotIndex{\def,\DisableCrossrefs,\divide,\DocInput,\documentclass} |
| 48 |
% \DoNotIndex{\DoNotIndex,\egroup,\ifdim,\else,\fi,\em,\endtrivlist} |
| 49 |
% \DoNotIndex{\EnableCrossrefs,\end,\end@dblfloat,\end@float,\endgroup} |
| 50 |
% \DoNotIndex{\endlist,\everycr,\everypar,\ExecuteOptions,\expandafter} |
| 51 |
% \DoNotIndex{\fbox} |
| 52 |
% \DoNotIndex{\filedate,\filename,\fileversion,\fontsize,\framebox,\gdef} |
| 53 |
% \DoNotIndex{\global,\halign,\hangindent,\hbox,\hfil,\hfill,\hrule} |
| 54 |
% \DoNotIndex{\hsize,\hskip,\hspace,\hss,\if@tempswa,\ifcase,\or,\fi,\fi} |
| 55 |
% \DoNotIndex{\ifhmode,\ifvmode,\ifnum,\iftrue,\ifx,\fi,\fi,\fi,\fi,\fi} |
| 56 |
% \DoNotIndex{\input} |
| 57 |
% \DoNotIndex{\jobname,\kern,\leavevmode,\let,\leftmark} |
| 58 |
% \DoNotIndex{\list,\llap,\long,\m@ne,\m@th,\mark,\markboth,\markright} |
| 59 |
% \DoNotIndex{\month,\newcommand,\newcounter,\newenvironment} |
| 60 |
% \DoNotIndex{\NeedsTeXFormat,\newdimen} |
| 61 |
% \DoNotIndex{\newlength,\newpage,\nobreak,\noindent,\null,\number} |
| 62 |
% \DoNotIndex{\numberline,\OldMakeindex,\OnlyDescription,\p@} |
| 63 |
% \DoNotIndex{\pagestyle,\par,\paragraph,\paragraphmark,\parfillskip} |
| 64 |
% \DoNotIndex{\penalty,\PrintChanges,\PrintIndex,\ProcessOptions} |
| 65 |
% \DoNotIndex{\protect,\ProvidesClass,\raggedbottom,\raggedright} |
| 66 |
% \DoNotIndex{\refstepcounter,\relax,\renewcommand,\reset@font} |
| 67 |
% \DoNotIndex{\rightmargin,\rightmark,\rightskip,\rlap,\rmfamily,\roman} |
| 68 |
% \DoNotIndex{\roman,\secdef,\selectfont,\setbox,\setcounter,\setlength} |
| 69 |
% \DoNotIndex{\settowidth,\sfcode,\skip,\sloppy,\slshape,\space} |
| 70 |
% \DoNotIndex{\symbol,\the,\trivlist,\typeout,\tw@,\undefined,\uppercase} |
| 71 |
% \DoNotIndex{\usecounter,\usefont,\usepackage,\vfil,\vfill,\viiipt} |
| 72 |
% \DoNotIndex{\viipt,\vipt,\vskip,\vspace} |
| 73 |
% \DoNotIndex{\wd,\xiipt,\year,\z@} |
| 74 |
% |
| 75 |
% \changes{v1.0}{1998/11/29}{First public release} |
| 76 |
% \changes{v1.1}{1999/05/01}{Made compatible with ltugboat.cls} |
| 77 |
% \changes{v1.1a}{1999/07/28}{Added text from Stefan Ulrich} |
| 78 |
% \changes{v1.2}{2001/03/15}{Added hanging punctuation from Stefan Ulrich} |
| 79 |
% \changes{v1.2a}{2004/04/22}{Updated license and contact info} |
| 80 |
% \changes{v1.2b}{2009/09/02}{New maintainer (Will Robertson)} |
| 81 |
% |
| 82 |
% \def\dtxfile{hanging.dtx} |
| 83 |
% \def\fileversion{v1.1a} \def\filedate{1999/07/28} |
| 84 |
% \def\fileversion{v1.2} \def\filedate{2001/03/15} |
| 85 |
% \def\fileversion{v1.2a} \def\filedate{2004/04/22} |
| 86 |
% \def\fileversion{v1.2b} \def\filedate{2009/09/02} |
| 87 |
% \newcommand*{\Lpack}[1]{\textsf {#1}} ^^A typeset a package |
| 88 |
% \newcommand*{\Lopt}[1]{\textsf {#1}} ^^A typeset an option |
| 89 |
% \newcommand*{\file}[1]{\texttt {#1}} ^^A typeset a file |
| 90 |
% \newcommand*{\Lcount}[1]{\textsl {\small#1}} ^^A typeset a counter |
| 91 |
% \newcommand*{\pstyle}[1]{\textsl {#1}} ^^A typeset a pagestyle |
| 92 |
% \newcommand*{\Lenv}[1]{\texttt {#1}} ^^A typeset an environment |
| 93 |
% ^^A fake a hangpara for demo purposes |
| 94 |
% \newcommand{\hpdemo}[2]{\hangindent#1\hangafter#2\noindent} |
| 95 |
% \newcommand{\Han}{H\`{a}n \ensuremath{\mathrm{Th\acute{\hat{e}}}} Th\`{a}nh} |
| 96 |
% |
| 97 |
% \title{The \Lpack{hanging} package\thanks{This |
| 98 |
% file (\texttt{\dtxfile}) has version number \fileversion, last revised |
| 99 |
% \filedate.}} |
| 100 |
% |
| 101 |
% \author{ |
| 102 |
% Author: Peter Wilson, Herries Press \\ |
| 103 |
% Maintainer: Will Robertson \\ |
| 104 |
% \texttt{will dot robertson at latex-project dot org} |
| 105 |
% } |
| 106 |
% \date{\filedate} |
| 107 |
% \maketitle |
| 108 |
% \begin{abstract} |
| 109 |
% The \Lpack{hanging} package provides facilities for defining hanging |
| 110 |
% paragraphs and hanging punctuation. |
| 111 |
% \end{abstract} |
| 112 |
% \tableofcontents |
| 113 |
% |
| 114 |
% \StopEventually{} |
| 115 |
% |
| 116 |
% |
| 117 |
% |
| 118 |
% \section{Introduction} |
| 119 |
% |
| 120 |
% \hpdemo{3em}{2}Some authors may wish to use hanging paragraphs in |
| 121 |
% their documents. |
| 122 |
% Normally only the first line of a paragraph is indented. A hanging paragraph |
| 123 |
% is a paragraph like this one where lines other than the first have indentation. |
| 124 |
% Other authors might wish to use hanging punctuation. |
| 125 |
% In this style of typesetting punctuation marks that come at either the |
| 126 |
% start or end of a line are typeset outside the normal text block. |
| 127 |
% |
| 128 |
% The \Lpack{hanging} package provides facilities for both hanging paragraphs |
| 129 |
% and hanging punctuation. |
| 130 |
% |
| 131 |
% This manual is typeset according to the conventions of the |
| 132 |
% \LaTeX{} \textsc{docstrip} utility which enables the automatic |
| 133 |
% extraction of the \LaTeX{} macro source files~\cite{GOOSSENS94}. |
| 134 |
% |
| 135 |
% Section~\ref{sec:usc} describes the usage of the package. |
| 136 |
% Commented source code for the package is in Section~\ref{sec:code}. |
| 137 |
% |
| 138 |
% \section{The \Lpack{hanging} package} \label{sec:usc} |
| 139 |
% |
| 140 |
% \subsection{Hanging paragraphs} |
| 141 |
% |
| 142 |
% The \Lpack{hanging} package provides a command for producing |
| 143 |
% a single hanging paragraph and an environment for typesetting |
| 144 |
% a series of hanging paragraphs. |
| 145 |
% |
| 146 |
% \DescribeMacro{\hangpara} |
| 147 |
% The command |\hangpara{|\meta{indent}|}{|\meta{afternum}|}| |
| 148 |
% placed at the start of a paragraph will cause it to be typeset |
| 149 |
% as a hanging paragraph. |
| 150 |
% |
| 151 |
% The \meta{indent} argument specifies the |
| 152 |
% amount of indentation. The value must be a length. A positive |
| 153 |
% value will indent the left hand side of the paragraph and a negative |
| 154 |
% value will cause the right hand side of the text to be indented. |
| 155 |
% |
| 156 |
% \hpdemo{3em}{-2}The \meta{afternum} argument controls the number of |
| 157 |
% lines that will |
| 158 |
% be indented. The value can be a positive or negative integer, say $N$. |
| 159 |
% If $N > 0$ then lines \emph{after} the $N^{th}$ line (i.e., lines $N+1$ |
| 160 |
% and onwards) will be indented. If $N < 0$ |
| 161 |
% then the first $N$ lines will be indented. This paragraph has been |
| 162 |
% typeset according to the specification |\hangpara{3em}{-2}| whereas |
| 163 |
% the first paragraph in the Introduction was typeset according |
| 164 |
% to |\hangpara{3em}{2}|. |
| 165 |
% |
| 166 |
% A word of caution: There must be no linebreak between the |\hangpara| |
| 167 |
% command and the start of the paragraph text. Either put the command |
| 168 |
% at the start of the paragraph text, or on the previous line with a |
| 169 |
% following \%. |
| 170 |
% |
| 171 |
% \DescribeEnv{hangparas} |
| 172 |
% The |hangparas| environment can be used for typeseting a sequence of |
| 173 |
% hanging paragraphs. The environment takes the same two arguments as the |
| 174 |
% |\hangpara| command. That is,\\ |
| 175 |
% |\begin{hangparas}{|\meta{indent}|}{|\meta{afternum}|}|. |
| 176 |
% |
| 177 |
% Another word of caution: The |hangparas| environment changes the definition |
| 178 |
% of |\everypar| and may have unexpected interactions with any enclosed |
| 179 |
% commands or environments that also change |\everypar|. If this does happen, |
| 180 |
% then use the |\hangpara| command for the problematic paragraph(s) instead |
| 181 |
% of the |hangparas| environment. |
| 182 |
% |
| 183 |
% \subsection{Hanging punctuation} |
| 184 |
% |
| 185 |
% \DescribeEnv{hangpunct} |
| 186 |
% Text within the |hangpunct| environment will be typeset with hanging |
| 187 |
% punctuation. Personally, I think that this is more of a curiosity than |
| 188 |
% anything else. Others disagree and think it is an essential part |
| 189 |
% of fine typography. |
| 190 |
% |
| 191 |
% Use of the environment may have unpleasant side effects as the punctuation |
| 192 |
% characters are made active (i.e., they act as commands rather than as |
| 193 |
% glyphs). The hanging punctuation characters are left and right single |
| 194 |
% and double quotes (|`'|), period (or full stop) (|.|), exclamation |
| 195 |
% mark (|!|), question mark (|?|), colon and semicolon (|:;|), and |
| 196 |
% the comma (|,|). |
| 197 |
% |
| 198 |
% If you really care about hanging punctuation, \Han's |
| 199 |
% \texttt{pdf(La)TeX} has built in support via |\pdfprotrudechars|. This |
| 200 |
% is implemented in the \texttt{pdfTeX} program itself~\cite{HTHESIS}, |
| 201 |
% so is robust. The \texttt{pdf(La)TeX} system is available from CTAN but |
| 202 |
% the latest version, if not on CTAN, can be obtained from |
| 203 |
% \url{ftp://ftp.cstug.cz/pub/tex/lo9cal/cstug/thanh/pdftex}. |
| 204 |
% |
| 205 |
% The package takes several options which stop punctuation characters from |
| 206 |
% being hung. The available options include: |
| 207 |
% \begin{itemize} |
| 208 |
% \item[\Lopt{notcomma}] don't hang the comma (|,|) |
| 209 |
% \item[\Lopt{notperiod}] don't hang the period (full stop) (|.|) |
| 210 |
% \item[\Lopt{notquote}] don't hang any quote marks (|` `` '' '|) |
| 211 |
% \item[\Lopt{notquery}] don't hang the question mark (|?|) |
| 212 |
% \item[\Lopt{notexcl}] don't hang the exclamation mark (|!|) |
| 213 |
% \item[\Lopt{notcolon}] don't hang the colon (|:|) |
| 214 |
% \item[\Lopt{notscolon}] don't hang the semicolon (|;|) |
| 215 |
% \end{itemize} |
| 216 |
% If none of these options are given then all the available punctuation |
| 217 |
% marks will be hung. |
| 218 |
% |
| 219 |
% There is one other option: |
| 220 |
% \begin{itemize} |
| 221 |
% \item[\Lopt{fine}] The default settings for the amount of punctuation |
| 222 |
% hang correspond to those given by Donald Knuth in the |
| 223 |
% \textit{TeXbook}~\cite{KNUTH84a}, and are independent of the local |
| 224 |
% font in use (use \texttt{pdfLaTeX} for font-dependent settings). |
| 225 |
% Stefan Ulrich\footnote{Private email on 2001/03/14 |
| 226 |
% (\texttt{[email protected]}).} |
| 227 |
% suggested a less aggresive hang, which is provided by |
| 228 |
% the \Lopt{fine} option. This option also stops hanging question and |
| 229 |
% exclamation marks. |
| 230 |
% \end{itemize} |
| 231 |
% |
| 232 |
% \DescribeMacro{\nhpt} |
| 233 |
% \DescribeMacro{\nhlq} |
| 234 |
% \DescribeMacro{\nhrq} |
| 235 |
% If a non-hanging period, or left or right quote character is required |
| 236 |
% in it's character form within the |hangpunct| environment, then |
| 237 |
% respectively the |
| 238 |
% |\nhpt|, |\nhlq| and |\nhrq| commands can be used. For example, if a |
| 239 |
% length is to be changed you cannot write: \\ |
| 240 |
% |\setlength{\mylength}{2.76cm}|. Instead you must code this as: \\ |
| 241 |
% |\setlength{\mylength}{2\nhpt76cm}|. |
| 242 |
% |
| 243 |
% |
| 244 |
% \section{The package code} \label{sec:code} |
| 245 |
% |
| 246 |
% |
| 247 |
% Announce the name and version of the package, which requires |
| 248 |
% \LaTeXe. |
| 249 |
% \begin{macrocode} |
| 250 |
%<*usc> |
| 251 |
\NeedsTeXFormat{LaTeX2e} |
| 252 |
\ProvidesPackage{hanging}[2009/09/02 v1.2b hanging paragraphs and punctuation] |
| 253 |
% \end{macrocode} |
| 254 |
% |
| 255 |
% \subsection{Hanging paragraphs} |
| 256 |
% |
| 257 |
% \begin{macro}{\hangpara} |
| 258 |
% The command for a single hanging paragraph. |
| 259 |
% Just package up the \TeX{} |\hang...| commands, together with |
| 260 |
% |\noindent| to switch off any existing |\parindent| indentation. |
| 261 |
% \begin{macrocode} |
| 262 |
\newcommand{\hangpara}[2]{\hangindent#1\hangafter#2\noindent} |
| 263 |
% \end{macrocode} |
| 264 |
% \end{macro} |
| 265 |
% |
| 266 |
% \begin{environment}{hangparas} |
| 267 |
% The environment for typesetting multiple hanging paragraphs. It takes |
| 268 |
% the same arguments as the |\hangpara| command. At the start, set the |
| 269 |
% paragraph indent to zero, then change |\everypar| to |\hangpara|. |
| 270 |
% At the end of the environment make sure that the last paragraph was |
| 271 |
% finished via |\par|, otherwise the user would have to leave a blank line |
| 272 |
% or use |\par| explicitly. |
| 273 |
% \begin{macrocode} |
| 274 |
\newenvironment{hangparas}[2]{\setlength{\parindent}{\z@} |
| 275 |
\everypar={\hangpara{#1}{#2}}}{\par} |
| 276 |
% \end{macrocode} |
| 277 |
% \end{environment} |
| 278 |
% |
| 279 |
% \subsection{Hanging punctuation} |
| 280 |
% |
| 281 |
% The code for hanging punctuation is based on the Dirty Tricks example |
| 282 |
% on page 395 of the \TeX book~\cite{KNUTH84a}. |
| 283 |
% |
| 284 |
% I made an experimental attempt to include hanging hyphens, |
| 285 |
% but this broke too many other things all over the place to be of |
| 286 |
% practical use. I believe Knuth when he says that |
| 287 |
% hanging hyphens require a font with a zero-width hyphen. I think that |
| 288 |
% the basic problem is that the `-' character, as input, represents both |
| 289 |
% a hyphen and a minus sign; diddling with a hyphen means that the minus |
| 290 |
% sign is similarly diddled. This package is meant to be independent of the |
| 291 |
% font, and following Knuth, providing a hanging hyphen is font-dependent. |
| 292 |
% Fortunately, most of the time \TeX{} manages to avoid hyphens at line ends. |
| 293 |
% |
| 294 |
% Stefan Ulrich (\texttt{[email protected]}) pointed out that |
| 295 |
% the EC fonts include a hyphen with a smaller, but non-zero, width. Using |
| 296 |
% this then the last non-hyphen character at the end of a hyphenated line |
| 297 |
% will be a little closer to the margin. To use the smaller EC hyphen, |
| 298 |
% Stefan suggested doing: |
| 299 |
% \begin{verbatim} |
| 300 |
% \usepackage[T1]{fontenc} |
| 301 |
% \hyphenchar\font=127 |
| 302 |
% \end{verbatim} |
| 303 |
% |
| 304 |
% \begin{macro}{\ifh@ngcomma} |
| 305 |
% \begin{macro}{\ifh@ngfstop} |
| 306 |
% \begin{macro}{\ifh@ngquote} |
| 307 |
% \begin{macro}{\ifh@ngquery} |
| 308 |
% \begin{macro}{\ifh@ngexcl} |
| 309 |
% \begin{macro}{\ifh@ngcolon} |
| 310 |
% \begin{macro}{\ifh@ngscolon} |
| 311 |
% \begin{macro}{\ifh@ngfine} |
| 312 |
% We need some booleans for the options. |
| 313 |
% \changes{v1.1}{1999/05/01}{Added options to switch off hanging particular characters} |
| 314 |
% \changes{v1.2}{2001/03/15}{Added the fine option.} |
| 315 |
% \begin{macrocode} |
| 316 |
\newif\ifh@ngcomma \h@ngcommatrue |
| 317 |
\newif\ifh@ngfstop \h@ngfstoptrue |
| 318 |
\newif\ifh@ngquote \h@ngquotetrue |
| 319 |
\newif\ifh@ngquery \h@ngquerytrue |
| 320 |
\newif\ifh@ngexcl \h@ngexcltrue |
| 321 |
\newif\ifh@ngcolon \h@ngcolontrue |
| 322 |
\newif\ifh@ngscolon \h@ngscolontrue |
| 323 |
\newif\ifh@ngfine \h@ngfinefalse |
| 324 |
% \end{macrocode} |
| 325 |
% \end{macro} |
| 326 |
% \end{macro} |
| 327 |
% \end{macro} |
| 328 |
% \end{macro} |
| 329 |
% \end{macro} |
| 330 |
% \end{macro} |
| 331 |
% \end{macro} |
| 332 |
% \end{macro} |
| 333 |
% |
| 334 |
% Now do the options. |
| 335 |
% |
| 336 |
% \begin{macrocode} |
| 337 |
\DeclareOption{notcomma}{\h@ngcommafalse} |
| 338 |
\DeclareOption{notperiod}{\h@ngfstopfalse} |
| 339 |
\DeclareOption{notquote}{\h@ngquotefalse} |
| 340 |
\DeclareOption{notquery}{\h@ngqueryfalse} |
| 341 |
\DeclareOption{notexcl}{\h@ngexclfalse} |
| 342 |
\DeclareOption{notcolon}{\h@ngcolonfalse} |
| 343 |
\DeclareOption{notscolon}{\h@ngscolonfalse} |
| 344 |
\DeclareOption{fine}{\h@ngfinetrue} |
| 345 |
\ProcessOptions\relax |
| 346 |
\ifh@ngfine |
| 347 |
\h@ngqueryfalse \h@ngexclfalse |
| 348 |
\fi |
| 349 |
% \end{macrocode} |
| 350 |
% |
| 351 |
% \begin{macro}{\h@ngcommawd} |
| 352 |
% \begin{macro}{\h@ngfstopwd} |
| 353 |
% \begin{macro}{\h@ngquotewd} |
| 354 |
% \begin{macro}{\h@ngdquotewd} |
| 355 |
% \begin{macro}{\h@ngquerywd} |
| 356 |
% \begin{macro}{\h@ngexclwd} |
| 357 |
% \begin{macro}{\h@ngcolonwd} |
| 358 |
% \begin{macro}{\h@ngscolonwd} |
| 359 |
% We need some lengths for kerning for each punctuation mark that might be |
| 360 |
% hung. These are set to the width of the character. |
| 361 |
% \begin{macrocode} |
| 362 |
\newlength{\h@ngcommawd} \settowidth{\h@ngcommawd}{,} |
| 363 |
\newlength{\h@ngfstopwd} \settowidth{\h@ngfstopwd}{.} |
| 364 |
\newlength{\h@ngquotewd} \settowidth{\h@ngquotewd}{`} |
| 365 |
\newlength{\h@ngdquotewd} \settowidth{\h@ngdquotewd}{``} |
| 366 |
\newlength{\h@ngquerywd} \settowidth{\h@ngquerywd}{?} |
| 367 |
\newlength{\h@ngexclwd} \settowidth{\h@ngexclwd}{!} |
| 368 |
\newlength{\h@ngcolonwd} \settowidth{\h@ngcolonwd}{:} |
| 369 |
\newlength{\h@ngscolonwd} \settowidth{\h@ngscolonwd}{;} |
| 370 |
% \end{macrocode} |
| 371 |
% |
| 372 |
% These values are changed if the \Lopt{fine} option is given. The following |
| 373 |
% is by courtesy of Stefan Ulrich. |
| 374 |
% \begin{macrocode} |
| 375 |
\ifh@ngfine |
| 376 |
\setlength{\h@ngcommawd}{0.35\h@ngcommawd} |
| 377 |
\setlength{\h@ngfstopwd}{0.30\h@ngfstopwd} |
| 378 |
\setlength{\h@ngquotewd}{0.30\h@ngquotewd} |
| 379 |
\setlength{\h@ngdquotewd}{0.35\h@ngdquotewd} |
| 380 |
\setlength{\h@ngcolonwd}{0.20\h@ngcolonwd} |
| 381 |
\setlength{\h@ngscolonwd}{0.20\h@ngscolonwd} |
| 382 |
\fi |
| 383 |
|
| 384 |
% \end{macrocode} |
| 385 |
% \end{macro} |
| 386 |
% \end{macro} |
| 387 |
% \end{macro} |
| 388 |
% \end{macro} |
| 389 |
% \end{macro} |
| 390 |
% \end{macro} |
| 391 |
% \end{macro} |
| 392 |
% \end{macro} |
| 393 |
% |
| 394 |
% \begin{macro}{\h@ngallowhyphens} |
| 395 |
% An incantation to be used to allow hyphenation in a `word' beginning |
| 396 |
% with a quote mark.\footnote{Hubert Gaesslein |
| 397 |
% (\texttt{[email protected]}) |
| 398 |
% pointed out that the definition of \texttt{h@ngallowhyphens} should end |
| 399 |
% with \texttt{z@skip} rather than my original \texttt{z@}, in case it was used |
| 400 |
% in situations I hadn't thought of.} |
| 401 |
% \changes{v1.1}{1999/05/01}{Changed allowhyphens to h@ngallowhyphens for compatibility with ltugboat.cls} |
| 402 |
% \changes{v1.1a}{1999/05/01}{Made h@ngallowhyphens more robust} |
| 403 |
% \begin{macrocode} |
| 404 |
\newcommand{\h@ngallowhyphens}{\nobreak\hskip\z@skip} |
| 405 |
% \end{macrocode} |
| 406 |
% \end{macro} |
| 407 |
% |
| 408 |
% \begin{macro}{\nhpt} |
| 409 |
% \begin{macro}{\nhlq} |
| 410 |
% \begin{macro}{\nhrq} |
| 411 |
% As the punctuation is going to be made active, we need commands for |
| 412 |
% some of the characters when they will be used in constants. |
| 413 |
% \begin{macrocode} |
| 414 |
\newcommand{\nhpt}{.} |
| 415 |
\newcommand{\nhlq}{`} |
| 416 |
\newcommand{\nhrq}{'} |
| 417 |
% \end{macrocode} |
| 418 |
% \end{macro} |
| 419 |
% \end{macro} |
| 420 |
% \end{macro} |
| 421 |
% |
| 422 |
% \begin{macro}{\h@nglqq} |
| 423 |
% \begin{macro}{\h@ngrqq} |
| 424 |
% \begin{macro}{\h@ngrquote} |
| 425 |
% \begin{macro}{\h@nglquote} |
| 426 |
% \begin{macro}{\h@ngcomma} |
| 427 |
% \begin{macro}{\h@ngfstop} |
| 428 |
% \begin{macro}{\h@ngquery} |
| 429 |
% \begin{macro}{\h@ngexcl} |
| 430 |
% \begin{macro}{\h@ngcolon} |
| 431 |
% \begin{macro}{\h@ngscolon} |
| 432 |
% Commands for punctuation with kerning. |
| 433 |
% \begin{macrocode} |
| 434 |
\newcommand{\h@nglqq}{``} |
| 435 |
\newcommand{\h@ngrqq}{''} |
| 436 |
\newcommand{\h@ngrquote}{'\kern-\h@ngquotewd\kern\h@ngquotewd} |
| 437 |
\newcommand{\h@nglquote}{\ifhmode\kern\h@ngquotewd\vadjust{}\else\leavevmode\fi |
| 438 |
\kern-\h@ngquotewd`\h@ngallowhyphens} |
| 439 |
\newcommand{\h@ngcomma}{,\kern-\h@ngcommawd\kern\h@ngcommawd} |
| 440 |
\newcommand{\h@ngfstop}{.\kern-\h@ngfstopwd\kern\h@ngfstopwd} |
| 441 |
\newcommand{\h@ngquery}{?\kern-\h@ngquerywd\kern\h@ngquerywd} |
| 442 |
\newcommand{\h@ngexcl}{!\kern-\h@ngexclwd\kern\h@ngexclwd} |
| 443 |
\newcommand{\h@ngcolon}{:\kern-\h@ngcolonwd\kern\h@ngcolonwd} |
| 444 |
\newcommand{\h@ngscolon}{;\kern-\h@ngscolonwd\kern\h@ngscolonwd} |
| 445 |
% \end{macrocode} |
| 446 |
% \end{macro} |
| 447 |
% \end{macro} |
| 448 |
% \end{macro} |
| 449 |
% \end{macro} |
| 450 |
% \end{macro} |
| 451 |
% \end{macro} |
| 452 |
% \end{macro} |
| 453 |
% \end{macro} |
| 454 |
% \end{macro} |
| 455 |
% \end{macro} |
| 456 |
% |
| 457 |
% \begin{macro}{\activatepunct} |
| 458 |
% At this point we make the punctuation characters |
| 459 |
% active.\footnote{My thanks to Harald Hanche-Olsen |
| 460 |
% \texttt{[email protected]} |
| 461 |
% for showing me how to do this instead of my initial hack of putting |
| 462 |
% all the following code into a file to be input by the environment.} |
| 463 |
% |
| 464 |
% Activate the punctuation characters, leaving the left quote till last. |
| 465 |
% \begin{macrocode} |
| 466 |
\def\activatepunct{% |
| 467 |
\ifh@ngcomma \catcode`\,=\active \fi |
| 468 |
\ifh@ngfstop \catcode`\.=\active \fi |
| 469 |
\ifh@ngquote \catcode`\'=\active \fi |
| 470 |
\ifh@ngquery \catcode`\?=\active \fi |
| 471 |
\ifh@ngexcl \catcode`\!=\active \fi |
| 472 |
\ifh@ngcolon \catcode`\:=\active \fi |
| 473 |
\ifh@ngscolon \catcode`\;=\active \fi |
| 474 |
\ifh@ngquote \catcode`\`=\active \fi |
| 475 |
} |
| 476 |
% \end{macrocode} |
| 477 |
% \end{macro} |
| 478 |
% Define the simple punctuation macros in terms of the respective |
| 479 |
% |\h@ng...| commands, using |\gdef| as they are instantiated |
| 480 |
% in a group. |
| 481 |
% \begin{macrocode} |
| 482 |
\begingroup |
| 483 |
\activatepunct |
| 484 |
\ifh@ngcomma \gdef,{\h@ngcomma} \fi |
| 485 |
\ifh@ngfstop \gdef.{\h@ngfstop} \fi |
| 486 |
\ifh@ngquery \gdef?{\h@ngquery} \fi |
| 487 |
\ifh@ngexcl \gdef!{\h@ngexcl} \fi |
| 488 |
\ifh@ngcolon \gdef:{\h@ngcolon} \fi |
| 489 |
\ifh@ngscolon \gdef;{\h@ngscolon} \fi |
| 490 |
% \end{macrocode} |
| 491 |
% Life is more complicated for quote marks as they have to check for |
| 492 |
% ligatures. |
| 493 |
% \begin{macrocode} |
| 494 |
\ifh@ngquote |
| 495 |
\gdef'{\futurelet\next\h@ngrqtest} |
| 496 |
\gdef`{\futurelet\next\h@nglqtest} |
| 497 |
% \end{macrocode} |
| 498 |
% |
| 499 |
% \begin{macro}{\h@ngrqtest} |
| 500 |
% \begin{macro}{\h@nglqtest} |
| 501 |
% \begin{macro}{\h@ngrquotes} |
| 502 |
% \begin{macro}{\h@nglquotes} |
| 503 |
% Commands for left and right quotes ligature tests. |
| 504 |
% \begin{macrocode} |
| 505 |
\gdef\h@ngrqtest{\ifx\next'\let\next=\h@ngrquotes\else\let\next=\h@ngrquote\fi\next} |
| 506 |
\gdef\h@nglqtest{\ifx\next`\let\next=\h@nglquotes\else\let\next=\h@nglquote\fi\next} |
| 507 |
\gdef\h@ngrquotes'{\h@ngrqq\kern-\h@ngdquotewd\kern\h@ngdquotewd} |
| 508 |
\gdef\h@nglquotes`{\ifhmode\kern\h@ngdquotewd\vadjust{}\else\leavevmode\fi |
| 509 |
\kern-\h@ngdquotewd\h@nglqq\h@ngallowhyphens} |
| 510 |
\fi |
| 511 |
% \end{macrocode} |
| 512 |
% Finally, end the group started earlier. |
| 513 |
% \begin{macrocode} |
| 514 |
\endgroup |
| 515 |
% \end{macrocode} |
| 516 |
% \end{macro} |
| 517 |
% \end{macro} |
| 518 |
% \end{macro} |
| 519 |
% \end{macro} |
| 520 |
% |
| 521 |
% |
| 522 |
% \begin{environment}{hangpunct} |
| 523 |
% The definition of the hanging punctuation environment is now very simple. |
| 524 |
% It just calls |\activatepunct|. |
| 525 |
% \begin{macrocode} |
| 526 |
\newenvironment{hangpunct}{\activatepunct}{} |
| 527 |
% \end{macrocode} |
| 528 |
% \end{environment} |
| 529 |
% |
| 530 |
% The end of this package. |
| 531 |
% \begin{macrocode} |
| 532 |
%</usc> |
| 533 |
% \end{macrocode} |
| 534 |
% |
| 535 |
% |
| 536 |
% \bibliographystyle{alpha} |
| 537 |
% |
| 538 |
% \begin{thebibliography}{GMS94} |
| 539 |
% |
| 540 |
% \bibitem[GMS94]{GOOSSENS94} |
| 541 |
% Michel Goossens, Frank Mittelbach, and Alexander Samarin. |
| 542 |
% \newblock {\em The LaTeX Companion}. |
| 543 |
% \newblock Addison-Wesley Publishing Company, 1994. |
| 544 |
% |
| 545 |
% \bibitem[Knu84]{KNUTH84a} |
| 546 |
% Donald~E. Knuth. |
| 547 |
% \newblock {\em The TeXbook}. |
| 548 |
% \newblock Addison-Wesley Publishing Company, 1984. |
| 549 |
% |
| 550 |
% \bibitem[Tha00]{HTHESIS} |
| 551 |
% \Han. |
| 552 |
% \newblock \emph{Micro-typographic extensions to the TeX typesetting system}. |
| 553 |
% \newblock Dissertation. |
| 554 |
% \newblock Masaryk University Brno, Faculty of Informatics, October 2000. |
| 555 |
% \newblock (Available as \url{http://www.fi-muni.cz/~thanh/download/thesis.pdf}) |
| 556 |
% |
| 557 |
% |
| 558 |
% \end{thebibliography} |
| 559 |
% |
| 560 |
% |
| 561 |
% \Finale |
| 562 |
% \PrintIndex |
| 563 |
% |
| 564 |
\endinput |
| 565 |
|
| 566 |
%% \CharacterTable |
| 567 |
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z |
| 568 |
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z |
| 569 |
%% Digits \0\1\2\3\4\5\6\7\8\9 |
| 570 |
%% Exclamation \! Double quote \" Hash (number) \# |
| 571 |
%% Dollar \$ Percent \% Ampersand \& |
| 572 |
%% Acute accent \' Left paren \( Right paren \) |
| 573 |
%% Asterisk \* Plus \+ Comma \, |
| 574 |
%% Minus \- Point \. Solidus \/ |
| 575 |
%% Colon \: Semicolon \; Less than \< |
| 576 |
%% Equals \= Greater than \> Question mark \? |
| 577 |
%% Commercial at \@ Left bracket \[ Backslash \\ |
| 578 |
%% Right bracket \] Circumflex \^ Underscore \_ |
| 579 |
%% Grave accent \` Left brace \{ Vertical bar \| |
| 580 |
%% Right brace \} Tilde \~} |
| 581 |
|
| 582 |
|