| 1 |
\RequirePackage{etex} |
| 2 |
\documentclass[11pt,oneside,a4paper,oldfontcommands,danish,english,article]{memoir} |
| 3 |
\usepackage[T1]{fontenc} |
| 4 |
\usepackage[widespace]{fourier} |
| 5 |
\usepackage{babel} |
| 6 |
\usepackage{calc,amsmath} |
| 7 |
\usepackage[round]{natbib} |
| 8 |
|
| 9 |
\makeatletter |
| 10 |
\DeclareRobustCommand{\LaTeX}{L\kern-.28em% |
| 11 |
{\sbox\z@ T% |
| 12 |
\vbox to\ht\z@{\hbox{\check@mathfonts |
| 13 |
\fontsize\sf@size\z@ |
| 14 |
\math@fontsfalse\selectfont |
| 15 |
A}% |
| 16 |
\vss}% |
| 17 |
}% |
| 18 |
\kern-.15em% |
| 19 |
\TeX} |
| 20 |
\makeatother |
| 21 |
|
| 22 |
\setlxvchars[\normalfont] |
| 23 |
|
| 24 |
\settypeblocksize{*}{1.3\lxvchars}{1.618} |
| 25 |
|
| 26 |
\setlrmargins{*}{*}{0.7} |
| 27 |
\setulmargins{*}{*}{1} |
| 28 |
\setlength\marginparwidth{4cm} |
| 29 |
|
| 30 |
\checkandfixthelayout |
| 31 |
|
| 32 |
\hfuzz=30pt |
| 33 |
|
| 34 |
\usepackage{color} |
| 35 |
\usepackage[colorlinks,breaklinks]{hyperref} |
| 36 |
\definecolor{linkcolour}{rgb}{0,0.2,0.6} |
| 37 |
\definecolor{citecolour}{rgb}{0,0.6,0.2} |
| 38 |
\definecolor{urlcolour} {rgb}{0.8,0,0.8} |
| 39 |
|
| 40 |
\hypersetup{ |
| 41 |
pdftitle={The dlfltxbmisc package}, |
| 42 |
pdfauthor={Copyright \textcopyright\ \number\year\ Lars Madsen}, |
| 43 |
linkcolor=linkcolour,citecolor=citecolour, |
| 44 |
filecolor=urlcolour,urlcolor=urlcolour, |
| 45 |
plainpages=false, |
| 46 |
} |
| 47 |
|
| 48 |
\ifpdf\else\usepackage{breakurl}\fi |
| 49 |
\usepackage{memhfixc} |
| 50 |
|
| 51 |
\clubpenalty=300 |
| 52 |
\widowpenalty=300 |
| 53 |
|
| 54 |
\usepackage{microtype} |
| 55 |
|
| 56 |
|
| 57 |
\usepackage[loadsampleconfig]{dlfltxbmarkup} |
| 58 |
\usepackage{dlfltxbmisc} |
| 59 |
|
| 60 |
\renewcommand\felineMarginAdjustment{\RaggedLeft} |
| 61 |
|
| 62 |
\setlength\marginparsep{2em} |
| 63 |
\setlength\marginparwidth{3cm} |
| 64 |
|
| 65 |
\chapterstyle{article} |
| 66 |
|
| 67 |
\setsecheadstyle{\normalfont\large\bfseries\raggedright} |
| 68 |
|
| 69 |
\reversemarginpar |
| 70 |
\reversesidepartrue |
| 71 |
\twocolumnfootnotes |
| 72 |
|
| 73 |
\setsecnumdepth{part} |
| 74 |
|
| 75 |
\pagestyle{plain} |
| 76 |
|
| 77 |
|
| 78 |
\begin{document} |
| 79 |
|
| 80 |
\title{The \textsf{dlfltxbmisc} package\thanks{Version: 0.3}} |
| 81 |
\author{Lars Madsen\thanks{Email: [email protected]}} |
| 82 |
\maketitle |
| 83 |
|
| 84 |
\noindent |
| 85 |
This package provides a variety of macros that are used for |
| 86 |
\cite{ltxb}. |
| 87 |
|
| 88 |
\section{For typesetting arguments} |
| 89 |
|
| 90 |
\begin{flushleft} |
| 91 |
\NoMarginparAvailtrue |
| 92 |
\begin{tabularx}{\textwidth}{XX} |
| 93 |
\markup{Arg}\marg{text} & \Arg{text} \\ |
| 94 |
\markup{Arg*}\marg{text} & \Arg*{text} \\ |
| 95 |
\markup{marg}\marg{text} & \marg{text} \\ |
| 96 |
\markup{marg*}\marg{text} & \marg*{text} \\ |
| 97 |
\markup{oarg}\marg{text} & \oarg{text} \\ |
| 98 |
\markup{oarg*}\marg{text} & \oarg*{text} \\ |
| 99 |
\markup{parg}\marg{text} & \parg{text} \\ |
| 100 |
\markup{parg*}\marg{text} & \parg*{text} \\ |
| 101 |
\end{tabularx} |
| 102 |
\end{flushleft} |
| 103 |
|
| 104 |
\section{Syntax} |
| 105 |
\label{sec:syntax} |
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
Environments \markup[env]{syntax} and \markup[env]{syntax*} for |
| 110 |
explaining syntax. In the unstared version \markup[nomk]{obeylines} is |
| 111 |
in effect and \cs{}\cs{} is disabled. In the stared version we are in |
| 112 |
a normal situation and \cs{}\cs{} has its normal line changing |
| 113 |
behavior. Text contents of the two environments are indented by |
| 114 |
\markup[nomk,length]{parindent}. |
| 115 |
|
| 116 |
\section{Special wrapping urls in bibliographies} |
| 117 |
\label{sec:spec-wrapp-urls} |
| 118 |
|
| 119 |
In the bibliography of \cite{ltxb} we refer to a lot of \LaTeX\ |
| 120 |
packages and their URLs on \textsc{ctan}. In order to make those URLs |
| 121 |
look nice and space some space the URL wraps it self up into the |
| 122 |
bibliography item above. The effect can be seen here: |
| 123 |
\medskip |
| 124 |
\noindent |
| 125 |
\begin{adjustwidth}{\bibhang}{0pt} |
| 126 |
text text text text text text |
| 127 |
text text text text text\qquad |
| 128 |
\addurl{http://www.imf.au.dk/system/latex/bog/}{} |
| 129 |
\end{adjustwidth} |
| 130 |
|
| 131 |
The effect is achieved with the macro |
| 132 |
\begin{syntax} |
| 133 |
\markup{addurl}\oarg{pre text}\marg{url}\marg{see below} |
| 134 |
\end{syntax} |
| 135 |
\markup[nomk]{addurl} is only intended to be used in bibliographies, |
| 136 |
i.e. inside the \markup[nomk]{thebibliography} environment (it uses |
| 137 |
\markup[nomk,length]{bibhang} internally). The macro was created to |
| 138 |
be used with Bib\TeX, where one adds it as the very last item in the |
| 139 |
>>\texttt{note}<< field. As most Bib\TeX\ styles add a >>\texttt{.}<< |
| 140 |
at the end of the entry we simply let \markup[nomk]{addurl} `eat' that |
| 141 |
>>\texttt{.}<< by just specifying the first argument. So if you use |
| 142 |
this macro by hand (i.e.\ not using Bib\TeX), you will need to specify |
| 143 |
the last argument as an empty argument. By default \oarg{pre text} is |
| 144 |
set to >>\verb+\textsc{url}:+<<. |
| 145 |
|
| 146 |
\markup[nomk]{addurl} works this way: |
| 147 |
\begin{enumerate}[(i)] |
| 148 |
\item \label{item:1} We start a new paragraph and measure the length |
| 149 |
of the last line in the preceding paragraph. |
| 150 |
\item In the new paragraph we set everything |
| 151 |
\markup[nomk]{RaggedLeft}, and start the text by setting a |
| 152 |
phantom-like width corresponding to the measured length found |
| 153 |
in~\eqref{item:1}. If the measured length is larger than |
| 154 |
0.6\markup[nomk]{linewidth}, then we do not activate the wrapping, |
| 155 |
instead the URL is just typeset ragged left below the bibliographic |
| 156 |
entry. |
| 157 |
\item Then we simply typeset the URL using \markup[nomk]{url}. |
| 158 |
\end{enumerate} |
| 159 |
|
| 160 |
There is one small problem with \markup[nomk]{addurl}: If we get close |
| 161 |
to a page break the wrapping URL may be moved to the next page. One |
| 162 |
method for fixing this is to make \markup[nomk,length]{itemsep} more |
| 163 |
flexible inside the \markup[nomk,env]{thebibliography}, for example |
| 164 |
using |
| 165 |
\begin{verbatim} |
| 166 |
\let\oldthebibliography\thebibliography |
| 167 |
\renewcommand\thebibliography[1]{% |
| 168 |
\oldthebibliography{#1}% |
| 169 |
\setlength\itemsep{10pt plus 3pt minus 5pt} |
| 170 |
} |
| 171 |
\end{verbatim} |
| 172 |
|
| 173 |
Additionally, we also have a \markup[nomk]{addCTAN} macro where the |
| 174 |
argument will be replaced by (if using \markup[nomk,sty]{hyperref}) |
| 175 |
\begin{verbatim} |
| 176 |
\href{http://mirror.ctan.org/#2}{#1\path{#2}} |
| 177 |
\end{verbatim} |
| 178 |
e.g. \verb+\addCTAN{/fonts/kpfonts/}+ $\to$ |
| 179 |
\begin{verbatim} |
| 180 |
\href{http://mirror.ctan.org/fonts/kpfonts}{\textsc{ctan}:\path{#2}} |
| 181 |
\end{verbatim} |
| 182 |
|
| 183 |
Since \verb?\addCTAN? is also useful in the regular text, we also |
| 184 |
support a \markup{CTAN}\marg{path} macro. |
| 185 |
|
| 186 |
|
| 187 |
\section{Example text in math} |
| 188 |
\label{sec:example-text-math} |
| 189 |
|
| 190 |
In \cite{ltxb} we use the macro \markup{dbx}\oarg{width} to illustrate |
| 191 |
some math instead of writing random formulas. It just typesets \dbx\ |
| 192 |
where the width is adjustable using the optional argument. |
| 193 |
|
| 194 |
|
| 195 |
\section{Acknowledgement} |
| 196 |
\label{sec:acknodlegement} |
| 197 |
|
| 198 |
Special thanks to Morten H\o gholm and Dan Luecking for their help |
| 199 |
with various parts of \markup[nomk]{addurl}. |
| 200 |
|
| 201 |
|
| 202 |
\bibliographystyle{plainnat} |
| 203 |
\bibliography{package_doc} |
| 204 |
|
| 205 |
|
| 206 |
\end{document} |
| 207 |
|
| 208 |
|
| 209 |
%%% Local Variables: |
| 210 |
%%% mode: latex |
| 211 |
%%% TeX-master: t |
| 212 |
%%% End: |
| 213 |
|