summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty')
-rw-r--r--Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty109
1 files changed, 109 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty b/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty
new file mode 100644
index 00000000000..80878531cb2
--- /dev/null
+++ b/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty
@@ -0,0 +1,109 @@
+\ProvidesPackage{dlfltxbmisc}[2007/05/15 v0.1 by Lars Madsen]
+
+% if memoir is not loaded we will need the chngpage to get adjustwidth
+\@ifclassloaded{memoir}{}{
+ \RequirePackage{chngpage}
+}
+
+\RequirePackage{ragged2e}
+\RequirePackage{url}
+\RequirePackage{calc}
+
+\newcommand*\Arg@s[1]{\textnormal{\texttt{#1}}}%
+\newcommand*\Arg@n[1]{\textnormal{$\langle$\textit{#1}$\rangle$}}%
+\newcommand*\Arg{\@ifstar{\Arg@s}{\Arg@n}}%
+
+\newcommand*\marg@s[1]{\textnormal{\texttt{\{#1\}}}}
+\newcommand*\marg@n[1]{%
+ \textnormal{\texttt{\{}$\langle$\textit{#1}$\rangle$\texttt{\}}}%
+}
+\newcommand*\marg{\@ifstar{\marg@s}{\marg@n}}
+
+\newcommand*\oarg@s[1]{\textnormal{\texttt{[#1]}}}
+\newcommand*\oarg@n[1]{%
+ \textnormal{\texttt{[}$\langle$\textit{#1}$\rangle$\texttt{]}}%
+}
+\newcommand*\oarg{\@ifstar{\oarg@s}{\oarg@n}}
+
+\newcommand*\parg@s[1]{\textnormal{\texttt{(#1)}}}
+\newcommand*\parg@n[1]{%
+ \textnormal{\texttt{(}$\langle$\textit{#1}$\rangle$\texttt{)}}%
+}
+\newcommand*\parg{\@ifstar{\parg@s}{\parg@n}}
+
+\newcommand\malign[2][2pt]{%
+ \makebox[0pt][l]{\kern#1\smash{\rule[-1.5mm-#2\baselineskip]{0.01pt}{5mm+#2\baselineskip}}}%
+}
+
+
+\newenvironment{syntax}{%
+ \vskip.5\baselineskip\allowbreak%
+ \begin{adjustwidth}{\parindent}{0pt}
+ \parindent=0pt%
+ \obeylines%
+ \let\\=\relax%
+ }{%
+ \end{adjustwidth}%
+ \vskip.5\baselineskip%
+}
+\newenvironment{syntax*}{%
+ \vskip.5\baselineskip%
+ \begin{adjustwidth}{\parindent}{0pt}
+ \parindent=0pt%
+ }{%
+ \end{adjustwidth}%
+ \vskip.5\baselineskip%
+}
+
+\let\syntaks=\syntax
+\let\endsyntaks=\endsyntax
+
+% macro used in several math examples to show the structure. It acts
+% like some text but only displays a box.
+\newcommand\@dbx[1]{{\fboxsep=0pt\fboxrule=0.4pt\,\fbox{\phantom{\rule[-0.6mm]{#1}{3mm}}}\,}}
+\newcommand\dbx[1][5mm]{\ifmmode\mathord{\@dbx{#1}}\else\@dbx{#1}\fi}
+
+
+% powerfull macro by Morten Høgholm, this enables you to measure the
+% length of the previous paragraf.
+\newdimen\lastlinedim
+\def\getlastlinesize{%
+ \begingroup\frozen@everydisplay{}%
+ $$
+ \abovedisplayskip=\z@skip \abovedisplayshortskip=\z@skip
+ \belowdisplayskip=\z@skip \belowdisplayshortskip=\z@skip
+ \global\lastlinedim=\dimexpr\predisplaysize-2em\relax
+ \halign{##\cr}%
+ $$
+ \mbox{}%
+ \endgroup%
+}
+
+% this is a very special little macro to be used in the 'note' field
+% of bibtex entries. It eats up the added '.' and typesets the main
+% argument (an URL) in a raggedright manner, wrapped up into the
+% previous paragraph. It looks pretty cool.
+\newcommand\addurl[3][\textsc{url}:]{%
+ \getlastlinesize{}%
+ \vskip-2\baselineskip%
+ \begingroup%
+ \def\UrlNoBreaks{\do\(\do\[\do\{\do\<\do\:\do\.}%\]
+ \RaggedLeft%
+ \fussy%
+ \addtolength\lastlinedim{-\bibhang}%
+ \fboxsep=0pt%
+ \fboxrule=0pt%
+ \fbox{\hbox to \lastlinedim{\hfill \footnotesize \strut \hfill}}%
+ \ifdim \lastlinedim > 0.6\linewidth\relax% we break
+ \nopagebreak\vskip-3pt%
+ \else%
+ % special thanks to Dan Luecking for this, since my original
+ % \hspace{\fill} failed miserably
+ \hskip1em plus 5em minus .5em
+ \fi%
+ {\footnotesize #1~~{\url{#2}}} %
+ \par%
+ \endgroup%
+}
+
+