diff options
Diffstat (limited to 'Master/texmf-dist/tex/latex/ltxdockit/ltxdockit.sty')
-rw-r--r-- | Master/texmf-dist/tex/latex/ltxdockit/ltxdockit.sty | 84 |
1 files changed, 25 insertions, 59 deletions
diff --git a/Master/texmf-dist/tex/latex/ltxdockit/ltxdockit.sty b/Master/texmf-dist/tex/latex/ltxdockit/ltxdockit.sty index ad17a1057fc..9d1c6183daa 100644 --- a/Master/texmf-dist/tex/latex/ltxdockit/ltxdockit.sty +++ b/Master/texmf-dist/tex/latex/ltxdockit/ltxdockit.sty @@ -1,4 +1,4 @@ -% $Id: ltxdockit.sty,v 1.2b 2010/11/19 12:04:25 lehman stable $ +% $Id: ltxdockit.sty,v 1.2c 2010/12/10 17:19:43 lehman stable $ % % Copyright (c) 2008-2010 Philipp Lehman. % @@ -18,7 +18,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{ltxdockit} -[\ltd@rcsid $Id: ltxdockit.sty,v 1.2b 2010/11/19 12:04:25 lehman stable $ +[\ltd@rcsid $Id: ltxdockit.sty,v 1.2c 2010/12/10 17:19:43 lehman stable $ LaTeX documentation kit] \RequirePackage{etoolbox} @@ -29,16 +29,13 @@ \RequirePackage{hyperref} \newcount\ltd@tempcnta -\newdimen\ltd@tempdima +\newlength{\ltd@tempdima} \newlength{\marglistwidth} \newlength{\marglistsep} -\newif\ifpdfbookmarks \AtEndPreamble{% - \setlength{\marglistwidth}{\oddsidemargin}% - \addtolength{\marglistwidth}{1in}% - \setlength{\marglistwidth}{0.85\marglistwidth}% - \setlength{\marglistsep}{10pt}} + \deflength{\marglistwidth}{(\oddsidemargin+1in)*85/100}% + \deflength{\marglistsep}{10pt}} \newcommand*{\marglistfont}{\bfseries} \newcommand*{\margnotefont}{} @@ -60,14 +57,7 @@ % markup \newrobustcmd*{\cs}[1]{\mbox{\verbatimfont\textbackslash#1}} -\newrobustcmd*{\cmd}{\@ifstar\ltd@scmd\ltd@cmd} -\def\ltd@cmd#1{\mbox{\verbatimfont\textbackslash#1}} -\begingroup -\catcode`\ =\active% -\gdef\ltd@scmd#1{\mbox{\verbatimfont% -\catcode`\ =\active\let \textvisiblespace% -\textbackslash\scantokens{#1\relax}}}% -\endgroup +\newrobustcmd*{\cmd}[1]{\mbox{\verbatimfont\textbackslash#1}} \newrobustcmd*{\env}[1]{\mbox{\verbatimfont#1}} \newrobustcmd*{\len}[1]{\mbox{\verbatimfont\textbackslash#1}} \newrobustcmd*{\cnt}[1]{\mbox{\verbatimfont#1}} @@ -80,13 +70,11 @@ \ensuremath\rangle}}} \newrobustcmd*{\mprm}[1]{% \mbox{% - {\verbatimfont\{}% - \prm{#1}% + {\verbatimfont\{}\prm{#1}% {\verbatimfont\}}}} \newrobustcmd*{\oprm}[1]{% \mbox{% - {\verbatimfont[}% - \prm{#1}% + {\verbatimfont[}\prm{#1}% {\verbatimfont]}}} \newrobustcmd*{\opt}[1]{\mbox{\verbatimfont#1}} \newrobustcmd*{\kvopt}[2]{{% @@ -95,6 +83,7 @@ =\penalty\hyphenpenalty \hskip 0em plus 0.15em\relax #2}} +\csdef{*}{\textasteriskcentered} \newrobustcmd*{\file}[1]{\mbox{\verbatimfont#1}} \newrobustcmd*{\sty}[1]{\mbox{\verbatimfont#1}} \newrobustcmd*{\bin}[1]{\mbox{\verbatimfont#1}} @@ -104,7 +93,6 @@ \else #1% \fi}} -\csdef{*}{\textasteriskcentered} \newrobustcmd*{\keyval}{% \begingroup\verbatimfont \prm{key}=\penalty\hyphenpenalty @@ -112,7 +100,6 @@ \xspace} \ifpdf - \pdfbookmarkstrue \pdfstringdefDisableCommands{% \def\cs#1{\textbackslash#1}% \def\cmd#1{\textbackslash#1}% @@ -129,28 +116,14 @@ \let\sty\@firstofone \let\bin\@firstofone \let\acr\@firstofone}% - \def\ltd@pdfinit{% - \ifpdfbookmarks - \let\ltd@pdflast\Hy@currentbookmarklevel - \numdef\ltd@pdflevel{\Hy@currentbookmarklevel+1} - \fi} - \def\ltd@pdfrestore{% - \ifpdfbookmarks - \global\let\Hy@currentbookmarklevel\ltd@pdflast - \fi} \def\ltd@pdfbookmark#1#2{% - \ifpdfbookmarks - \def\ltd@pdfanchor{% - \the\c@part\ifundef\c@chapter{}{\the\c@chapter}% - \the\c@section\the\c@subsection\the\c@subsubsection - \the\c@paragraph\the\c@subparagraph - \string:\detokenize{#1}}% - \pdfbookmark[\ltd@pdflevel]{#2}{\ltd@pdfanchor}% - \fi} + \edef\ltd@pdfanchor{% + \the\c@part\ifundef\c@chapter{}{\the\c@chapter}% + \the\c@section\the\c@subsection\the\c@subsubsection + \the\c@paragraph\the\c@subparagraph + \string:\detokenize{#1}}% + \belowpdfbookmark{#2}{\ltd@pdfanchor}} \else - \pdfbookmarksfalse - \let\ltd@pdfinit\relax - \let\ltd@pdfrestore\relax \let\ltd@pdfbookmark\@gobbletwo \fi @@ -193,8 +166,7 @@ % syntax \newenvironment*{ltxsyntax} - {\ltd@pdfinit - \list{}{% + {\list{}{% \setlength{\labelwidth}{\marglistwidth}% \setlength{\labelsep}{0pt}% \setlength{\leftmargin}{0pt}% @@ -207,8 +179,7 @@ \let\boolitem\ltd@boolitem \let\cntitem\ltd@item \let\optitem\ltd@item} - {\endlist - \ltd@pdfrestore} + {\endlist} \def\ltd@itemsave{% \ltd@tempcnta\@itempenalty @@ -369,28 +340,25 @@ % options \newenvironment*{optionlist} - {\ltd@pdfinit - \list{}{% + {\list{}{% \setlength{\labelwidth}{\marglistwidth}% \setlength{\labelsep}{\z@}% \setlength{\leftmargin}{0pt}% \renewcommand*{\makelabel}[1]{\hss\optionlistfont##1}}% \ltd@optionlist} - {\endlist - \ltd@pdfrestore} + {\endlist} \newenvironment*{optionlist*} - {\ltd@pdfinit - \list{}{% + {\list{}{% \setlength{\labelwidth}{0pt}% \setlength{\labelsep}{0pt}% \setlength{\leftmargin}{0pt}% \renewcommand*{\makelabel}[1]{\hss\optionlistfont##1}}% \ltd@optionlist + \let\ltd@pdfbookmark\@gobbletwo \let\ltd@option@i\ltd@option@ii \def\legitem##1{\item[##1]\item\relax}} - {\endlist - \ltd@pdfrestore} + {\endlist} \def\ltd@optionlist{% \let\optitem\ltd@ol@optitem @@ -530,8 +498,7 @@ % changelog \newenvironment*{changelog} - {\ltd@pdfinit - \list{}{% + {\list{}{% \setlength{\leftmargin}{0pt}% \setlength{\itemsep}{0pt}% \renewcommand*{\makelabel}[1]{##1\hss}% @@ -555,9 +522,8 @@ \endgroup} \def\see##1{% \leaders\hbox{$\m@th\mkern4.5mu\hbox{.}\mkern4.5mu$}% - \hfill\makebox[2.75em][l]{\ref{##1}}}} - {\endlist - \ltd@pdfrestore} + \hfill\makebox[3em][l]{\ref{##1}}}} + {\endlist} % verbatim |