\RequirePackage{etex} \documentclass[11pt,oneside,a4paper,oldfontcommands,danish,english,article]{memoir} \usepackage[T1]{fontenc} \usepackage[widespace]{fourier} \usepackage{babel} \usepackage{calc,amsmath} \usepackage[round]{natbib} \makeatletter \DeclareRobustCommand{\LaTeX}{L\kern-.28em% {\sbox\z@ T% \vbox to\ht\z@{\hbox{\check@mathfonts \fontsize\sf@size\z@ \math@fontsfalse\selectfont A}% \vss}% }% \kern-.15em% \TeX} \makeatother \setlxvchars[\normalfont] \settypeblocksize{*}{1.3\lxvchars}{1.618} \setlrmargins{*}{*}{0.7} \setulmargins{*}{*}{1} \setlength\marginparwidth{4cm} \checkandfixthelayout \hfuzz=30pt \usepackage{color} \usepackage[colorlinks,breaklinks]{hyperref} \definecolor{linkcolour}{rgb}{0,0.2,0.6} \definecolor{citecolour}{rgb}{0,0.6,0.2} \definecolor{urlcolour} {rgb}{0.8,0,0.8} \hypersetup{ pdftitle={The dlfltxbmisc package}, pdfauthor={Copyright \textcopyright\ \number\year\ Lars Madsen}, linkcolor=linkcolour,citecolor=citecolour, filecolor=urlcolour,urlcolor=urlcolour, plainpages=false, } \ifpdf\else\usepackage{breakurl}\fi \usepackage{memhfixc} \clubpenalty=300 \widowpenalty=300 \usepackage{microtype} \usepackage[loadsampleconfig]{dlfltxbmarkup} \usepackage{dlfltxbmisc} \renewcommand\felineMarginAdjustment{\RaggedLeft} \setlength\marginparsep{2em} \setlength\marginparwidth{3cm} \chapterstyle{article} \setsecheadstyle{\normalfont\large\bfseries\raggedright} \reversemarginpar \reversesidepartrue \twocolumnfootnotes \setsecnumdepth{part} \pagestyle{plain} \begin{document} \title{The \textsf{dlfltxbmisc} package\thanks{Version: 0.3}} \author{Lars Madsen\thanks{Email: daleif@imf.au.dk}} \maketitle \noindent This package provides a variety of macros that are used for \cite{ltxb}. \section{For typesetting arguments} \begin{flushleft} \NoMarginparAvailtrue \begin{tabularx}{\textwidth}{XX} \markup{Arg}\marg{text} & \Arg{text} \\ \markup{Arg*}\marg{text} & \Arg*{text} \\ \markup{marg}\marg{text} & \marg{text} \\ \markup{marg*}\marg{text} & \marg*{text} \\ \markup{oarg}\marg{text} & \oarg{text} \\ \markup{oarg*}\marg{text} & \oarg*{text} \\ \markup{parg}\marg{text} & \parg{text} \\ \markup{parg*}\marg{text} & \parg*{text} \\ \end{tabularx} \end{flushleft} \section{Syntax} \label{sec:syntax} Environments \markup[env]{syntax} and \markup[env]{syntax*} for explaining syntax. In the unstared version \markup[nomk]{obeylines} is in effect and \cs{}\cs{} is disabled. In the stared version we are in a normal situation and \cs{}\cs{} has its normal line changing behavior. Text contents of the two environments are indented by \markup[nomk,length]{parindent}. \section{Special wrapping urls in bibliographies} \label{sec:spec-wrapp-urls} In the bibliography of \cite{ltxb} we refer to a lot of \LaTeX\ packages and their URLs on \textsc{ctan}. In order to make those URLs look nice and space some space the URL wraps it self up into the bibliography item above. The effect can be seen here: \medskip \noindent \begin{adjustwidth}{\bibhang}{0pt} text text text text text text text text text text text\qquad \addurl{http://www.imf.au.dk/system/latex/bog/}{} \end{adjustwidth} The effect is achieved with the macro \begin{syntax} \markup{addurl}\oarg{pre text}\marg{url}\marg{see below} \end{syntax} \markup[nomk]{addurl} is only intended to be used in bibliographies, i.e. inside the \markup[nomk]{thebibliography} environment (it uses \markup[nomk,length]{bibhang} internally). The macro was created to be used with Bib\TeX, where one adds it as the very last item in the >>\texttt{note}<< field. As most Bib\TeX\ styles add a >>\texttt{.}<< at the end of the entry we simply let \markup[nomk]{addurl} `eat' that >>\texttt{.}<< by just specifying the first argument. So if you use this macro by hand (i.e.\ not using Bib\TeX), you will need to specify the last argument as an empty argument. By default \oarg{pre text} is set to >>\verb+\textsc{url}:+<<. \markup[nomk]{addurl} works this way: \begin{enumerate}[(i)] \item \label{item:1} We start a new paragraph and measure the length of the last line in the preceding paragraph. \item In the new paragraph we set everything \markup[nomk]{RaggedLeft}, and start the text by setting a phantom-like width corresponding to the measured length found in~\eqref{item:1}. If the measured length is larger than 0.6\markup[nomk]{linewidth}, then we do not activate the wrapping, instead the URL is just typeset ragged left below the bibliographic entry. \item Then we simply typeset the URL using \markup[nomk]{url}. \end{enumerate} There is one small problem with \markup[nomk]{addurl}: If we get close to a page break the wrapping URL may be moved to the next page. One method for fixing this is to make \markup[nomk,length]{itemsep} more flexible inside the \markup[nomk,env]{thebibliography}, for example using \begin{verbatim} \let\oldthebibliography\thebibliography \renewcommand\thebibliography[1]{% \oldthebibliography{#1}% \setlength\itemsep{10pt plus 3pt minus 5pt} } \end{verbatim} Additionally, we also have a \markup[nomk]{addCTAN} macro where the argument will be replaced by (if using \markup[nomk,sty]{hyperref}) \begin{verbatim} \href{http://mirror.ctan.org/#2}{#1\path{#2}} \end{verbatim} e.g. \verb+\addCTAN{/fonts/kpfonts/}+ $\to$ \begin{verbatim} \href{http://mirror.ctan.org/fonts/kpfonts}{\textsc{ctan}:\path{#2}} \end{verbatim} Since \verb?\addCTAN? is also useful in the regular text, we also support a \markup{CTAN}\marg{path} macro. \section{Example text in math} \label{sec:example-text-math} In \cite{ltxb} we use the macro \markup{dbx}\oarg{width} to illustrate some math instead of writing random formulas. It just typesets \dbx\ where the width is adjustable using the optional argument. \section{Acknowledgement} \label{sec:acknodlegement} Special thanks to Morten H\o gholm and Dan Luecking for their help with various parts of \markup[nomk]{addurl}. \bibliographystyle{plainnat} \bibliography{package_doc} \end{document} %%% Local Variables: %%% mode: latex %%% TeX-master: t %%% End: