| 1 |
\documentclass[parskip=half, pagesize=auto, 12pt]{scrartcl} |
| 2 |
|
| 3 |
\usepackage{fixltx2e} |
| 4 |
\usepackage{etex} |
| 5 |
\usepackage{xspace} |
| 6 |
\usepackage{lmodern} |
| 7 |
\usepackage[T1]{fontenc} |
| 8 |
\usepackage{textcomp} |
| 9 |
\usepackage{microtype} |
| 10 |
%\usepackage{hyperref} |
| 11 |
\usepackage{shortvrb} |
| 12 |
|
| 13 |
\newcommand*{\mail}[1]{\href{mailto:#1}{\texttt{#1}}} |
| 14 |
\newcommand*{\pkg}[1]{\textsf{#1}} |
| 15 |
\newcommand*{\cs}[1]{\texttt{\textbackslash#1}} |
| 16 |
\newcommand*{\meta}[1]{\ensuremath{\langle}\textsl{#1}\ensuremath{\rangle}} |
| 17 |
\makeatletter |
| 18 |
\newcommand*{\cmd}[1]{\cs{\expandafter\@gobble\string#1}} |
| 19 |
\g@addto@macro\@listI{\itemsep\z@skip} |
| 20 |
\makeatother |
| 21 |
\addtokomafont{title}{\rmfamily} |
| 22 |
|
| 23 |
\MakeShortVerb" |
| 24 |
\frenchspacing |
| 25 |
|
| 26 |
\sloppy |
| 27 |
|
| 28 |
\title{The \pkg{magaz} package\thanks{This manual corresponds to \pkg{magaz}~v0.4, dated~24--Nov--2011.}} |
| 29 |
\author{Donald Arseneau, \texttt{[email protected]}, Vancouver, Canada} |
| 30 |
\date{24--Nov--2011} |
| 31 |
|
| 32 |
|
| 33 |
\begin{document} |
| 34 |
|
| 35 |
\maketitle |
| 36 |
|
| 37 |
\begin{quote} |
| 38 |
\small |
| 39 |
This software may be freely used, transmitted, reproduced, or modified |
| 40 |
provided that the copyright notice and this permission is retained. |
| 41 |
\end{quote} |
| 42 |
|
| 43 |
This package was intended to eventually be a collection of tools to aid |
| 44 |
magazine-style document formatting, but this version is just a single |
| 45 |
tool I first wrote in 1999 in response to a request on \texttt{comp.text.tex}: |
| 46 |
How to apply a formatting choice (font) the the first line of a paragraph. |
| 47 |
The full list of features is: |
| 48 |
|
| 49 |
\begin{center} |
| 50 |
\begin{tabular}{@{}rl@{}} |
| 51 |
Yes & Special formatting for first line of text in a paragraph \\ |
| 52 |
Maybe & Special formatting for for first $n$ lines (allow each different) \\ |
| 53 |
Maybe & Also for first character (drop caps) (working together) \\ |
| 54 |
No & ``Continued on''/``continued from'' markers (like varioref marks) \\ |
| 55 |
No & wrapfig spanning columns \\ |
| 56 |
No & wrapfig placed at fixed location on page \\ |
| 57 |
No & Integration with shapepar, especially cutouts \\ |
| 58 |
No & Piecing together fragments of gallies to fit page (maybe flowfram) |
| 59 |
\end{tabular} |
| 60 |
\end{center} |
| 61 |
|
| 62 |
Most of those features are very unlikely to ever be added to this package. |
| 63 |
|
| 64 |
\section*{First-Line Formatting} |
| 65 |
|
| 66 |
\noindent \cmd{\FirstLine}"{"\meta{text}"}" |
| 67 |
|
| 68 |
\medskip |
| 69 |
|
| 70 |
The "\FirstLine" command is placed at the beginning of a paragraph, |
| 71 |
and takes one argument: Some text. The first line of this text will |
| 72 |
be formatted according to "\FirstLineFont"; but if the text occupies |
| 73 |
less than a full line of the paragraph, all that text (and no more) |
| 74 |
will be affected by "\FirstLineFont". |
| 75 |
|
| 76 |
You should define "\FirstLineFont" appropriately as either a switch |
| 77 |
or a text-command; as in "\renewcommand\FirstLineFont{\MakeUppercase}". |
| 78 |
The defult definition performed in \pkg{magaz.sty} is |
| 79 |
"\providecommand\FirstLineFont{\scshape}". |
| 80 |
|
| 81 |
The parameter for "\FirstLine" should be ordinary text, not containing |
| 82 |
lists or displayed equations -- such things will give you a ``Bad text'' |
| 83 |
error. If the parameter text ends with a space, that space will be |
| 84 |
removed. A line break may sometimes be permitted after the parameter |
| 85 |
text even if the ensuing text prohibits one (using "~"). Furthermore, |
| 86 |
the text should be constant, or else the successive measurements made |
| 87 |
internally will not be consistent, and the output may be corrupted |
| 88 |
(with words missing or duplicated). Some subtle sources of inconstant |
| 89 |
text are: |
| 90 |
\begin{itemize} |
| 91 |
\item Incrementing a counter (and printing the value). |
| 92 |
\item "\everypar" that executes once and is cleared. (This occurs after |
| 93 |
section heads and inside list/quotation/center/etc. environments, |
| 94 |
but those cases are handled, somewhat.) |
| 95 |
\item A "\FirstLineFont" that affects hyphenation (as "\texttt" or a |
| 96 |
language setting will). |
| 97 |
\item Changing paragraph-layout parameters in "\FirstLineFont". |
| 98 |
\end{itemize} |
| 99 |
Other deviations from simple text can give poor formatting. Here are some |
| 100 |
`advanced' tips: |
| 101 |
\begin{itemize} |
| 102 |
\item Using "\FirstLine" in the middle of a paragraph will make a mess. |
| 103 |
(It should be used to start a paragraph, or placed at the beginning |
| 104 |
of one started with "\noindent". Using it after "\\" should also |
| 105 |
work.) |
| 106 |
\item Multiple "\vspace" or "\\*" or "\\[]" will cause failure; |
| 107 |
a single "\vspace" will be ignored. |
| 108 |
\item Although there is no corruption if used immediately after a |
| 109 |
"\section" command (or similar) that suppresses indentation, |
| 110 |
the paragraph will likely be indented anyway. The fix for |
| 111 |
this (and similar problems) is to begin the paragraph with |
| 112 |
"\noindent" before "\FirstLine". |
| 113 |
\item Using an inflexible "\parfillskip" might cause some highlighted |
| 114 |
first-line text to be dragged down to the second line. (Providing |
| 115 |
more text in the argument will usually solve this.) (If you |
| 116 |
don't know about "\parfillskip" you probably don't have to worry.) |
| 117 |
\item A large font for "\FirstLineFont" may be too crowded with the |
| 118 |
second line, and inserting "\vspace" will not help (this should |
| 119 |
be improved) so you may need to resort to a "\strut", as with\\ |
| 120 |
"\renewcommand\FirstLineFont{\large\strut\MakeUppercase}" |
| 121 |
\end{itemize} |
| 122 |
|
| 123 |
The "\FirstLine" system is intended to be used in a replacement for |
| 124 |
a normal sectioning command in a document class; "\paragraph" would be |
| 125 |
appropriate. In particular, this "\paragraph" (or whatever) should |
| 126 |
insert vertical space and penalties etc., and probably "\noindent" |
| 127 |
at the start of the argument. The document class should also define |
| 128 |
"\FirstLineFont" appropriately as either a switch or a text-command; |
| 129 |
as in "\renewcommand\FirstLineFont{\scshape\textcolor{blue}}". The |
| 130 |
defult definition is "\providecommand\FirstLineFont{\scshape}". |
| 131 |
|
| 132 |
\section*{All Other Features} |
| 133 |
|
| 134 |
Not implemented. |
| 135 |
|
| 136 |
\end{document} |