diff options
author | Karl Berry <karl@freefriends.org> | 2010-03-06 01:07:33 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2010-03-06 01:07:33 +0000 |
commit | f276a23ea2fc902e50521314bd7378a95c9e4de9 (patch) | |
tree | 9f038067b71488e8e592c76a3e74951011666199 /Master/texmf-dist/tex/latex | |
parent | 48e45d82921aca1f3b8fe0bfc9ff3abbb4bb81b4 (diff) |
dlfltxb update (4mar10)
git-svn-id: svn://tug.org/texlive/trunk@17337 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex')
5 files changed, 464 insertions, 137 deletions
diff --git a/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbcodetips.sty b/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbcodetips.sty index e8f143c468a..1e6af371804 100644 --- a/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbcodetips.sty +++ b/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbcodetips.sty @@ -1,4 +1,4 @@ -\ProvidesPackage{dlfltxbcodetips}[2008/08/05 v0.4 by Lars 'daleif' Madsen] +\ProvidesPackage{dlfltxbcodetips}[2010/03/04 v0.5 by Lars 'daleif' Madsen] % this pacakge collects some macros presented as code tips in my LaTeX % book: "Introduktion til LaTeX". As the macros might be useful for @@ -37,7 +37,7 @@ % 20080617 added \DeclareMathSymbolShorthand and \DeclareMathSet % 20080618 redesigned and renamed \PullBack to \MoveEqLeft % 20080828 added better implementation of \MakeDeclareMathSetCommand - +% 20100304 updated for latest release \newif\ifdlf@do@load@amssymb \dlf@do@load@amssymbtrue @@ -61,31 +61,6 @@ \endgroup% }} -% macro made on request by Morten H\o gholm -% \ArrowBetweenLines adds arrow on the left -% \ArrowBetweenLines* on the right -% more information is needed -% requires the amsmath package -% Now including a fix explained by Jean-Côme Charpentier -% only create ArrowBetweenLines if it does not already exist -\@ifundefined{ArrowBetweenLines}{ - \def\ArrowBetweenLines{\relax - \iffalse{\fi\ifnum0=`}\fi - \@ifstar{\ArrowBetweenLines@auxI{00}}{\ArrowBetweenLines@auxI{01}}} - \def\ArrowBetweenLines@auxI#1{% - \@ifnextchar[% - {\ArrowBetweenLines@auxII{#1}}% - {\ArrowBetweenLines@auxII{#1}[\Updownarrow]}} - \def\ArrowBetweenLines@auxII#1[#2]{% - \ifnum0=`{\fi \iffalse}\fi - \crcr - \noalign{\nobreak\vskip-\baselineskip\vskip-\lineskip}% - \noalign{\expandafter\in@\expandafter{\@currenvir}% - {alignedat,aligned,gathered}% - \ifin@ \else\notag\fi}% - \if#1 &&\quad #2\else #2\quad\fi - \\\noalign{\nobreak\vskip-\lineskip}} -}{} % for making theorems with shaded background @@ -136,21 +111,6 @@ }{\end{#1@inner}\endtrivlist\@endparenv}% } -% Mathematics into Type by Ellen Swanson recommends that line-broken -% displayed alignments should be indented by 2em (and other rules) -% instead of aligning ti the left and indenting all subsequent lines, -% it is easier to just pull back the first line. Just align all lines -% to the left and replace the & on the fist line with \MoveEqLeft -% The indentation amount can be changed by \MoveEqLeft[3], i.e. no unit, -% 'em will be used automatically - -\@ifundefined{MoveEqLeft}{% -\newcommand\MoveEqLeft[1][2]{% - \global\@tempdima=#1em% - \kern\@tempdima% - & - \kern-\@tempdima} -}{} @@ -210,29 +170,24 @@ \dp0=\dimen0 \box0 \mkern2.3965mu } -\@ifundefined{nrightarrow}{% - \PackageWarning{dlfltxbcodetips}{\string\nrightarrow\space not found,^^J - \string\nuparrow\space will not be defined} -}{ - \def\nuparrow{\mathrel{\mathpalette\dlf@nrotarrow\nrightarrow}} -} - -\@ifundefined{nleftarrow}{% - \PackageWarning{dlfltxbcodetips}{\string\nleftarrow\space not found,^^J - \string\ndownarrow\space will not be defined} -}{ - \def\ndownarrow{\mathrel{\mathpalette\dlf@nrotarrow\nleftarrow}} +% needs to delay things +\AtBeginDocument{ + \@ifundefined{nrightarrow}{% + \PackageWarning{dlfltxbcodetips}{\string\nrightarrow\space not found,^^J + \string\nuparrow\space will not be defined} + }{ + \def\nuparrow{\mathrel{\mathpalette\dlf@nrotarrow\nrightarrow}} + } + + \@ifundefined{nleftarrow}{% + \PackageWarning{dlfltxbcodetips}{\string\nleftarrow\space not found,^^J + \string\ndownarrow\space will not be defined} + }{ + \def\ndownarrow{\mathrel{\mathpalette\dlf@nrotarrow\nleftarrow}} + } } -% this can be used as the first thing in an amsmath alignment -% environments for displayed math. It switches \abovedisplayskip and -% \abovedisplayshortskip before the display, usefull in some cases to -% save some space -\newcommand\SwapDeadSpace{% - \noalign{\vskip-\abovedisplayskip\vskip\abovedisplayshortskip} -} - \newcommand\ProvidePGFPagesFourOnOneWithSpaceForNotes{% \@ifpackageloaded{pgfpages}{% diff --git a/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmarkup.sty b/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmarkup.sty index 3b41a420677..a94d4e30118 100644 --- a/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmarkup.sty +++ b/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmarkup.sty @@ -243,7 +243,7 @@ } % standard key er lavet ned i \setkeys, da \markup[notxt]{...} ellers ikke vil -% være det samme som \markup[macro,notxt]{...} +% vaere det samme som \markup[macro,notxt]{...} % this is the main macro, take two arguments, a optional argument for % key controls and the mandatory arguments for the think we want to diff --git a/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmarkupbookkeys.sty b/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmarkupbookkeys.sty index 9b09a2765fc..f26039444ee 100644 --- a/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmarkupbookkeys.sty +++ b/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmarkupbookkeys.sty @@ -1,4 +1,4 @@ -\ProvidesPackage{dlfltxbmarkupbookkeys}[2008/10/30 by Lars madsen] +\ProvidesPackage{dlfltxbmarkupbookkeys}[20101/03/04 by Lars madsen] % the original name for the dlfltxbmarkup package was 'felinemarkup', % and in my book I use the following generated keys @@ -25,6 +25,7 @@ % 2007/06/20 added acronym key % 2008/06/27 fixed some settings % 2008/20/30 file renamed because of problems regarding TeXLive +% 2010/03/04 several new keys added since last release \@ifpackageloaded{dlfltxbmarkup}{}{ @@ -61,6 +62,15 @@ {\felineIndexCmd{#1 (pakke)@#1 (pakke)}\felineIndexCmd{pakker!#1}}% {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} +\felineKeyGenerator{nsty}% + {non-recommended packages}% + {\felineWriteInMargin{\foreignlanguage{english}{#1}}}% + {\felineIndexCmd{#1 (pakke, brug ikke)@#1 (pakke, brug ikke)}% + \felineIndexCmd{pakker!#1 (brug ikke)}% + \felineIndexCmd{ikke anbefalede pakker!#1}}% + {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} + + % dokumentklasser \felineKeyGenerator{cls}% @@ -115,6 +125,18 @@ }% {\ENcs{#1}} + +% textcomp symboler +\felineKeyGenerator{tcsym}% + {textcomp symbols} + {\felineWriteInMargin{\ENcs{#1} \textnormal{(\@nameuse{#1})}}}% + {% + \felineIndexCmd{#1 (textcomp)@\protect\css{#1} (\protect\felinenameuse{#1}, textcomp)}% + \felineIndexCmd{textcomp (pakke)@textcomp (pakke)!@\protect\css{#1} (\protect\felinenameuse{#1})}% + }% + {\ENcs{#1}} + + % store matematiske symboler \felineKeyGenerator{bigmsym}% {operator symbols, like sum etc.} @@ -393,7 +415,7 @@ \felineIndexCmd{dokumentklasser!KOMA-script@\textsf{KOMA}-script!#1}}% {\textsf{\textit{\mbox{#1}}}} -% grafik format (hmm, dem er det så to af????) +% grafik format (hmm, dem er det saa to af????) \felineKeyGenerator{grffmt}% {graphics format (hmm, two of these???)} {\felineWriteInMargin{#1}}% @@ -429,25 +451,25 @@ \felineKeyGenerator{counter}% {name of counters} {\felineWriteInMargin{#1}}% - {\felineIndexCmd{tæller!#1}% - \felineIndexCmd{#1 (tæller)}}% + {\felineIndexCmd{t\ae ller!#1}% + \felineIndexCmd{#1 (t\ae ller)}}% {\texttt{#1}} % memoir counter options \felineKeyGenerator{mcounter}% {name of memoir counters} {\felineWriteInMargin{#1}}% - {\felineIndexCmd{tæller!#1 (memoir)}% - \felineIndexCmd{#1 (tæller, memoir)}}% + {\felineIndexCmd{t\ae ller!#1 (memoir)}% + \felineIndexCmd{#1 (t\ae ller, memoir)}}% {\texttt{#1}} -% længde options +% laengde options \felineKeyGenerator{length}% {name of lengths} {\felineWriteInMargin{\ENcs{#1}}}% - {\felineIndexCmd{længde!#1@\protect\css{#1}}% - \felineIndexCmd{#1 (længde)@\protect\css{#1} (længde)}}% + {\felineIndexCmd{l\ae ngde!#1@\protect\css{#1}}% + \felineIndexCmd{#1 (l\ae ngde)@\protect\css{#1} (l\ae ngde)}}% {\ENcs{#1}} \felineKeyGenerator{gauss}% @@ -460,8 +482,8 @@ \felineKeyGenerator{tabs}% {column specifiers for tabular etc.} {\felineWriteInMargin{#1}}% - {\felineIndexCmd{#1 (søjle specifier)}% - \felineIndexCmd{søjle specifier!#1}}% + {\felineIndexCmd{#1 (s\o jle specifier)}% + \felineIndexCmd{s\o jle specifier!#1}}% {\texttt{#1}} \felineKeyGenerator{mltbib}% @@ -493,6 +515,52 @@ \felineIndexCmd{sistyle (pakke)!#1@\protect\css{#1}}}% {\ENcs{#1}} +\felineKeyGenerator{sux}% + {macros from the siunitx package}% + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1 (siunitx)@\protect\css{#1} (siunitx)}% + \felineIndexCmd{siunitx (pakke)!#1@\protect\css{#1}}}% + {\ENcs{#1}} + +\felineKeyGenerator{suxu}% + {unit from the siunitx package}% + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1 (siunitx enhed)@\protect\css{#1} (siunitx enhed)}% + \felineIndexCmd{siunitx (pakke)!enhed!#1@\protect\css{#1}}% + \felineIndexCmd{enhed (siunitx)!#1@\protect\css{#1}}% + }% + {\ENcs{#1}} + +\felineKeyGenerator{suxsu}% + {short unit from the siunitx package}% + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1 (siunitx enhed)@\protect\css{#1} (siunitx enhed)}% + \felineIndexCmd{siunitx (pakke)!forkortet enhed!#1@\protect\css{#1}}% + \felineIndexCmd{enhed (siunitx)!forkortet!#1@\protect\css{#1}}% + }% + {\ENcs{#1}} + + + +\felineKeyGenerator{suxp}% + {prefixes from the siunitx package}% + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1 (siunitx prefix)@\protect\css{#1} (siunitx prefix)}% + \felineIndexCmd{siunitx (pakke)!prefix!#1@\protect\css{#1}}% + \felineIndexCmd{enhedsprefix (siunitx)!#1@\protect\css{#1}}% + }% + {\ENcs{#1}} + +\felineKeyGenerator{suxpp}% + {power from the siunitx package}% + {\felineWriteInMargin{\ENcs{#1}}}% + {\felineIndexCmd{#1 (siunitx potens)@\protect\css{#1} (siunitx prefix)}% + \felineIndexCmd{siunitx (pakke)!potens!#1@\protect\css{#1}}% + \felineIndexCmd{enhedspotens (siunitx)!#1@\protect\css{#1}}% + }% + {\ENcs{#1}} + + \felineKeyGenerator{acronym}% {macros from the acronym package}% {\felineWriteInMargin{\ENcs{#1}}}% @@ -536,7 +604,41 @@ \felineIndexCmd{xifthen (pakke)!#1@\protect\css{#1}}}% {\ENcs{#1}} +\felineKeyGenerator{tl}% + {program from TeX Live} + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (program, texlive)@\texttt{#1} (program, texlive)}\felineIndexCmd{programmer!#1@\texttt{#1}}}% + {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} + +\felineKeyGenerator{editor}% + {editors}% + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (editor)@\texttt{#1} (editor)}\felineIndexCmd{editorer!#1@\texttt{#1}}}% + {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} +\felineKeyGenerator{leditor}% + {linux editors}% + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (editor, linux)@\texttt{#1} (editor, linux)}% + \felineIndexCmd{editorer!#1 (linux)@\texttt{#1} (linux)}}% + {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} +\felineKeyGenerator{weditor}% + {windows editors}% + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (editor, windows)@\texttt{#1} (editor, windows)}% + \felineIndexCmd{editorer!#1 (windows)@\texttt{#1} (windows)}}% + {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} +\felineKeyGenerator{meditor}% + {mac editors}% + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (editor, mac)@\texttt{#1} (editor, mac)}% + \felineIndexCmd{editorer!#1 (mac)@\texttt{#1} (mac)}}% + {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} +\felineKeyGenerator{viewer}% + {viewers}% + {\felineWriteInMargin{#1}}% + {\felineIndexCmd{#1 (fremviser)@\texttt{#1} (fremviser)}\felineIndexCmd{fremvisere!#1@\texttt{#1}}}% + {\foreignlanguage{english}{\texttt{\hyphenchar\font=`\-#1}}} diff --git a/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty b/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty index ae7cd5ce1b7..5788d06adbf 100644 --- a/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty +++ b/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbmisc.sty @@ -1,4 +1,4 @@ -\ProvidesPackage{dlfltxbmisc}[2008/01/01 v0.2 by Lars Madsen] +\ProvidesPackage{dlfltxbmisc}[2010/03/04 v0.3 by Lars Madsen] % This package be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -84,7 +84,7 @@ \newcommand\dbx[1][5mm]{\ifmmode\mathord{\@dbx{#1}}\else\@dbx{#1}\fi} -% powerfull macro by Morten Høgholm, this enables you to measure the +% powerfull macro by Morten H\o gholm, this enables you to measure the % length of the previous paragraf. \newdimen\lastlinedim \def\getlastlinesize{% @@ -103,10 +103,11 @@ % 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}:]{% +\newcommand\addurl[3][\textsf{URL}:]{% \getlastlinesize{}% \vskip-2\baselineskip% \begingroup% + \urlstyle{sf} \def\UrlNoBreaks{\do\(\do\[\do\{\do\<\do\:\do\.}%\] \RaggedLeft% \fussy% @@ -127,4 +128,35 @@ \endgroup% } +\AtBeginDocument{\providecommand\href[2]{#2}} +\DeclareUrlCommand\mypath{\urlstyle{sf}} +%\urlstyle{rm} +\newcommand\addCTAN[3][\textsf{CTAN}:]{% + \getlastlinesize{}% + \vskip-2\baselineskip% + \begingroup% +% \urlstyle{rm} + \def\UrlNoBreaks{\do\(\do\[\do\{\do\<\do\:\do\.}%\] + \RaggedLeft% + \fussy% + \hbadness=10000% cheating + \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 .7em + \fi% + {\footnotesize + \href{http://mirror.ctan.org/#2}{#1~~{\mypath{#2}}}} % + \par% + \endgroup% +} + +\newcommand\CTAN[1]{% + {\footnotesize\href{http://mirror.ctan.org/#1}{\textsf{CTAN:}~{\mypath{#1}}}}} diff --git a/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbtocconfig.sty b/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbtocconfig.sty index 07bac330fdb..c0ae6d04b5c 100644 --- a/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbtocconfig.sty +++ b/Master/texmf-dist/tex/latex/dlfltxb/dlfltxbtocconfig.sty @@ -1,4 +1,4 @@ -\ProvidesPackage{dlfltxbtocconfig}[2008/08/05 v0.65 by Lars Madsen] +\ProvidesPackage{dlfltxbtocconfig}[2010/03/04 v0.7 by Lars Madsen] % This package be distributed and/or modified under the %% conditions of the LaTeX Project Public License, either version 1.3 @@ -25,7 +25,8 @@ % 20080207 bugfix, \spart renamed to \specialpart, end the bookmark % for it is removed % 20080708 small cosmetic changes - +% 20081121 tried a look with a line under the part entries in the toc +% 20100304 updated to use undocumented features from the memoir class % we need to be running under the memoir class \@ifclassloaded{memoir}{}{% @@ -51,23 +52,168 @@ % apparently a bookmark level of 100 removes it from the list of book marks \newcommand\toclevel@specialpart{100}% -% this is now directly included in memoir -% % the command inserted into the ToC holding the hook -% \newcommand\cftdlfinsert[1]{\@nameuse{cftdlfinsert#1}} -% % creates a hook to be executed in the ToC, since we use \@nameuse it -% % does not matter if the hook does not exist -% \newcommand\cftdlfinsertcode[2]{\@namedef{cftdlfinsert#1}{#2}} -% % inserts a hook into the ToC file -% \newcommand\cftdlfinserthook[1]{\addtocontents{toc}{\protect\cftdlfinsert\protect{#1\protect}}} + +% trick with new memoir + + +\newcommand\mem@cft@alt@indents@setter[3]{% + % #1 = level (section, and down, chapter is special) + % #2 = name of level above + % #3 = numwidth + \expandafter\setlength{\@nameuse{cft#1numwidth}}{#3} + \expandafter\setlength{\@nameuse{cft#1indent}}{\@nameuse{cft#2indent}} + \expandafter\addtolength{\@nameuse{cft#1indent}}{\@nameuse{cft#2numwidth}} +} + +% \newlength\maxpnumformatted +% \newcommand\checkwidest[1]{% +% \expandafter\renewcommand\csname cft#1formatpnumhook\endcsname[1]{% +% \settowidth\@tempdimc{{\@nameuse{cft#1pagefont}##1}}% +% \ifdim\@tempdimc>\maxpnumformatted\global\maxpnumformatted=\@tempdimc\fi}% +% } +% \checkwidest{chapter} + +\newlength\widestchapter +\renewcommand\chapternumberlinehook[1]{% + \settowidth\@tempdimc{\@nameuse{cftchapterfont}#1}% + \ifdim\@tempdimc>\widestchapter\global\widestchapter=\@tempdimc\fi% +} +\newlength\widestsection +\newlength\widestsubsection +\newlength\widestsubsubsection +\newlength\widestfigure +\newlength\widesttable + +\def\mem@list{section,subsection,subsubsection,paragraph,subparagraph,figure,table} + +\newcommand\mem@wrec[2]{% + \expandafter\nametest\expandafter{\cftwhatismyname}{#1}% + \ifsamename% + \settowidth\@tempdimc{\@nameuse{cft\cftwhatismyname font}#2}% + \@ifundefined{widest#1}{% + %\typeout{\string\widest#1 not defined, ignoring} + }{% + \ifdim\dimexpr\@tempdimc>\@nameuse{widest#1}\relax% + \global\@nameuse{widest#1}=\@tempdimc\fi% + }% + \fi% +} + +\renewcommand\numberlinehook[1]{% + \@for\hest:=\mem@list\do{% + \expandafter\mem@wrec\expandafter{\hest}{#1}% + }% +} + +\def\@mem@storer#1#2{\global\@namedef{mem@stored@#1}{#2}} +\newcommand\memStoreValue[2]{% + \@bsphack% + \immediate\write\@mainaux{% + \string\@mem@storer{#1}{#2}}% + \@esphack} + +\newcommand\memRetrieveStored[1]{% + \@ifundefined{mem@stored@#1}{0pt}{\@nameuse{mem@stored@#1}}}% + +\newcommand\memRetrieveStoredInto[2]{% + \edef#1{\@ifundefined{mem@stored@#2}{}{\@nameuse{mem@stored@#2}}}} + +\AtBeginDocument{ + \AtEndDocument{ + \typeout{widest chapter: \the\widestchapter} + \typeout{widest section: \the\widestsection} + \typeout{widest subsection: \the\widestsubsection} + \typeout{widest subsubsection: \the\widestsubsubsection} + \memStoreValue{wchapter}{\the\widestchapter} + \memStoreValue{wsection}{\the\widestsection} + \memStoreValue{wsubsection}{\the\widestsubsection} + \memStoreValue{wsubsubsection}{\the\widestsubsubsection} + \memStoreValue{wfigure}{\the\widestfigure} + % \memStoreValue{wpnum}{\the\maxpnumformatted} + } +} + +\newcommand\cftsetindenttoedge[2]{% + % #1 = name of level + % #2 = numwidth + % this sets the indent to zero for this level, just a call to + % \cftsetindents + \cftsetindents{#1}{0pt}{#2}% +} + +\newcommand\cftsetindentsalt[2]{% + % #1 = name of entry + % #2 = numwidth + % we will create the indent with the data from the level above + % supported: chapter, section, subsection, subsubsection, paragraph + % and subparagraph + % indents above chapter is set to zero + \nametest{#1}{chapter} + \ifsamename + \cftsetindenttoedge{#1}{#2} + \else + \nametest{#1}{section} + \ifsamename + \mem@cft@alt@indents@setter{#1}{chapter}{#2} + \else + \nametest{#1}{subsection} + \ifsamename + \mem@cft@alt@indents@setter{#1}{section}{#2} + \else + \nametest{#1}{subsubsection} + \ifsamename + \mem@cft@alt@indents@setter{#1}{subsection}{#2} + \else + \nametest{#1}{paragraph} + \ifsamename + \mem@cft@alt@indents@setter{#1}{subsubsection}{#2} + \else + \nametest{#1}{subparagraph} + \ifsamename + \mem@cft@alt@indents@setter{#1}{paragraph}{#2} + \else + \@memerror{'#1' is not (yet) supported}{} + \fi + \fi + \fi + \fi + \fi + \fi +} + + + + + +%\newlength\dlf + + + + +% \AtBeginDocument{ +% \newcommand\dlf{\ifdim\dimexpr \memRetrieveStored{wchapter}+0pt > +% \memRetrieveStored{wsection}+0pt\relax% +% \memRetrieveStored{wchapter}\else\memRetrieveStored{wsection}\fi} +% \cftsetindentsalt{chapter}{\dlf+0.5em} +% \cftsetindenttoedge{section}{\dlf+0.5em} +% \cftsetindentsalt{subsection}{\memRetrieveStored{wsubsection}+0.5em} +% \cftsetindentsalt{subsubsection}{\memRetrieveStored{wsubsubsection}+0.5em} +% \cftsetindents{figure}{0pt}{\memRetrieveStored{wfigure}+0.5em} +% \setpnumwidth{\memRetrieveStored{wpnum}} +% % \setlength\@tempdima{\memRetrieveStored{wpnum}+0pt} +% % \addtolength\@tempdima{1em} +% % \setrmarg{\the\@tempdima} +% } + % used for calculating the widest section and sunsection numbers % we reset them back to zero in the ToC preprocessor \newlength\secwidest -\settowidth\secwidest{99.99} +%\settowidth\secwidest{999.999} \newlength\subsecwidest -\settowidth\subsecwidest{99.99} +%\settowidth\subsecwidest{999.999} % the name of the ToC file, just such that one can use it on sample % data by just redefining this macro @@ -93,14 +239,27 @@ % This macro is used to print the two ToCs \newcommand\MakeShortToC{ \begingroup + + \DeclareRobustCommand{\LaTeX}{L\kern-.25em% + {\sbox\z@ T% + \vbox to\ht\z@{\hbox{\check@mathfonts + \fontsize\sf@size\z@ + \math@fontsfalse\selectfont + A}% + \vss}% + }% + \kern-.05em% + \TeX} + + \renewcommand{\contentsname}{\shortcontentsname} \setcounter{tocdepth}{0} % no precis' \renewcommand\precistoctext[1]{} % mess with internal command \renewcommand\changetocdepth[1]{} - \renewcommand\cftchapterfont{\normalfont\itshape} - \renewcommand\cftchapterpagefont{\normalfont\itshape} + \renewcommand\cftchapterfont{\normalfont\itshape\sffamily} + \renewcommand\cftchapterpagefont{\normalfont\itshape\sffamily} \renewcommand\cftchapterleader{\enspace\textperiodcentered\enspace} % no part numbers \renewcommand\partnumberline[1]{} @@ -114,7 +273,8 @@ \noindent% % \raisebox{-3pt}[0pt][0pt]{\qquad\qquad\parbox[t]{0.35\textwidth}{\itshape\bfseries ##1}}% % \raisebox{-4pt}[0pt][0pt]{\qquad\qquad\parbox[t]{0.35\textwidth}{##1}}% - \raisebox{-4pt}[0pt][0pt]{\parbox[t]{0.35\textwidth}{\raggedleft##1} \qquad\qquad}% + \raisebox{-4pt}[0pt][0pt]{\parbox[t]{0.35\textwidth}{% + \raggedleft\bfseries\sffamily ##1} \qquad\qquad}% \vskip-\baselineskip \par } @@ -176,21 +336,60 @@ \@ifundefined{aldinesmall}{% , \hskip .5em plus 3pt minus 3pt% }{% - \hskip .5em plus 3pt minus 3pt\aldinesmall\nolinebreak% - \hskip .5em plus 3pt minus 3pt\nopagebreak% +% \hskip .5em plus 3pt minus 3pt\aldinesmall\nolinebreak% +\hskip .3em plus 2pt minus 2pt\textperiodcentered%\nolinebreak% + \hskip .3em plus 2pt minus 2pt\nopagebreak% }} +\newcommand\NormalTocPartFont{\Large\bfseries\itshape\sffamily} +\newcommand\NormalTocPartPrefix{% + \@ifundefined{aldinesmall}{}{ + {\hbox to \cftsectionnumwidth{\aldinesmall}}}} % This macro is used to print the two ToCs \newcommand\MakeNormalToC{ \begingroup + \DeclareRobustCommand{\LaTeX}{L\kern-.25em% + {\sbox\z@ T% + \vbox to\ht\z@{\hbox{\check@mathfonts + \fontsize\sf@size\z@ + \math@fontsfalse\selectfont + A}% + \vss}% + }% + \kern-.05em% + \TeX} + + + + + % if someone wrote \bfseries or similar in the title of a + % subsubsection, we will remove it + \let\feline@oldnumberline\numberline + \let\oldbfseries=\bfseries + \let\oldem=\em + \let\oldttfamily=\ttfamily + \renewcommand{\cftsubsubsectionfont}{\footnotesize\itshape\sffamily} + \renewcommand{\cftsubsubsectionpagefont}{\footnotesize\sffamily} + \renewcommand{\cftsubsectionfont}{\sffamily} + \renewcommand{\cftsubsectionpagefont}{\sffamily} + \let\cftsectionfont\cftsubsectionfont + \let\cftsectionpagefont\cftsubsectionpagefont + \renewcommand\cftchapterfont{\sffamily\bfseries} + \renewcommand\cftchapterpagefont{\sffamily\bfseries} + + + \newcommand\feline@partToCtext[1]{% \begingroup% \fboxsep=2pt% {\parbox{\linewidth-2\fboxsep-2\fboxrule}% -% {\itshape\LARGE \strut\hfill {##1} \hfill\strut}}% - {\scshape\Large \strut\hfill {##1} \hfill\strut}}% + {\NormalTocPartFont\strut{\NormalTocPartPrefix ##1}\hfill\strut}}% + \par\vskip-0.35\baselineskip% + \settowidth\@tempdimc{\Large\itshape ##1}% +% \strut\hfill\rule{3.5cm}{0.9pt}\hfill\strut% + \par\vskip4mm \endgroup% } @@ -199,27 +398,32 @@ \cftpagenumbersoff{part} \DeclareRobustCommand\precistoctext[1]{% - {\nopagebreak\leftskip0pt\relax + {\nopagebreak\leftskip\cftsectionnumwidth\relax % \advance\leftskip\cftchapternumwidth\relax - \rightskip\@tocrmarg plus 4em \relax - \noindent\parbox{\linewidth-2em-\@tocrmarg}% - {\precistocfont\raggedright\footnotesize ##1}\par}\vskip5pt} +%% \rightskip\@tocrmarg plus 0em \relax +%% \noindent\parbox[t]{\linewidth-\cftsectionnumwidth-1em}% +%% {\precistocfont\raggedright\footnotesize ##1}\par}\vskip5pt} + \noindent\parbox[t]{\linewidth-\cftsectionnumwidth-\@pnumwidth}% + {\precistocfont\RaggedRight% + \footnotesize\sffamily ##1}\par}\vskip5pt} + + % reconfiguring the way parts will appear \renewcommand*{\l@part}[2]{% \ifnum \c@tocdepth >-2\relax \cftpartbreak% - \vskip\cftbeforepartskip + \vskip\cftbeforepartskip% \begingroup - { + {% \leftskip 0pt%\cftpartindent\relax \rightskip 0pt%\@tocrmarg \parfillskip -0pt%\rightskip - \parindent 0pt\relax\@afterindenttrue - \interlinepenalty\@M - \leavevmode - \feline@partToCtext{##1} - \par + \parindent 0pt\relax\@afterindenttrue% + \interlinepenalty\@M% + \leavevmode% + \feline@partToCtext{##1}% + \par% }\nopagebreak \global\@nobreaktrue \everypar{\global\@nobreakfalse\everypar{}}% @@ -227,7 +431,7 @@ \fi} % it is good to break begore a part instead of having a part at the % bottom of a page - \renewcommand\cftpartbreak{\par\addpenalty{-\@highpenalty} + \renewcommand\cftpartbreak{\par%\addpenalty{-\@highpenalty} \if@nobreak\else \vskip\z@\@plus\bottomsectionskip \penalty\z@ @@ -242,25 +446,35 @@ \setpnumwidth{2.55em} \setrmarg{3.55em} % need more space for ToC section numbers, we will use calculated numbers - \cftsetindents{section} {0em} {\secwidest+0.5em} - \cftsetindents{subsection} {\secwidest+0.5em} {\subsecwidest+0.5em} - \cftsetindents{subsubsection}{\secwidest+\subsecwidest+1em}{0em} +% \cftsetindents{section} {0em} {\secwidest+0.5em} + % \cftsetindents{subsection} {\secwidest+0.5em} {\subsecwidest+0.5em} + % \cftsetindents{subsubsection}{\secwidest+\subsecwidest+1em}{0em} + + + \newcommand\dlf{\ifdim\dimexpr \memRetrieveStored{wchapter}+0pt > + \memRetrieveStored{wsection}+0pt\relax% + \memRetrieveStored{wchapter}\else\memRetrieveStored{wsection}\fi} + \cftsetindentsalt{chapter}{\dlf+0.5em} + \cftsetindenttoedge{section}{\dlf+0.5em} + \cftsetindentsalt{subsection}{\memRetrieveStored{wsubsection}+0.5em} + \cftsetindents{subsubsection}{\memRetrieveStored{wsection}+0.5em}{0em}% +% \cftsetindentsalt{subsubsection}{\memRetrieveStored{wsection}+0.5em} + \cftsetindents{figure}{0pt}{\memRetrieveStored{wfigure}} + \cftsetindents{table}{0pt}{\memRetrieveStored{wtable}} + + + + % % need more space for LoF & LoT numbers %remove the dotted leaders - \renewcommand{\cftsectiondotsep} {\cftnodots} - \renewcommand{\cftsubsectiondotsep} {\cftnodots} - \renewcommand{\cftsubsubsectiondotsep}{\cftnodots} - \renewcommand{\cftparagraphdotsep} {\cftnodots} - \renewcommand{\cftsubparagraphdotsep} {\cftnodots} +% \renewcommand{\cftsectiondotsep} {\cftnodots} +% \renewcommand{\cftsubsectiondotsep} {\cftnodots} +% \renewcommand{\cftsubsubsectiondotsep}{\cftnodots} +% \renewcommand{\cftparagraphdotsep} {\cftnodots} +% \renewcommand{\cftsubparagraphdotsep} {\cftnodots} - % if someone wrote \bfseries or similar in the title of a - % subsubsection, we will remove it - \let\feline@oldnumberline\numberline - \let\oldbfseries=\bfseries - \let\oldem=\em - \let\oldttfamily=\ttfamily - \renewcommand{\cftsubsubsectionfont}{\small\itshape} - \renewcommand{\cftsubsubsectionpagefont}{\footnotesize\itshape\scshape} + +% \renewcommand{\cftsubsubsectionpagefont}{\footnotesize\itshape\scshape} % reconfigure the way subsubsectins are displayed \renewcommand{\l@subsubsection}[2]{% \ifnum \c@tocdepth > 2\relax% @@ -270,8 +484,9 @@ % \def\numberline##1{\textit{##1}~}% % numbers \def\numberline####1{}% % no numbers \leftskip=\cftsubsubsectionindent% - \settowidth\@tempdima{\textbf{999999}}% - \rightskip=\@tempdima plus 4em +% \settowidth\@tempdima{\textbf{99}}% + \settowidth\@tempdima{\@pnumwidth}% + \rightskip=\@tempdima plus 1em % \parfillskip=\fill% \parfillskip=2em plus 1fil \nopagebreak% added 20060713 @@ -289,8 +504,11 @@ } % getting chapternames and appendix names into the ToC - \renewcommand\cftchaptername{\chaptername~~} - \renewcommand\cftappendixname{\appendixname~~} +% \renewcommand\cftchaptername{\chaptername~~} +% \renewcommand\cftappendixname{\appendixname~~} + + \setlength\cftchapternumwidth{\cftsectionnumwidth} + % \renewcommand{\contentsname}{Indholdsfortegnelse} \setcounter{tocdepth}{3} % subsections @@ -302,20 +520,31 @@ % handle some added hooks \cftinsertcode{A}{ - \renewcommand\cftchapterfont{\normalfont} - \renewcommand\cftchapterpagefont{\normalfont} + \renewcommand\cftchapterfont{\normalfont\sffamily} + \renewcommand\cftchapterpagefont{\normalfont\sffamily} \setlength\cftbeforechapterskip{0pt} + \renewcommand{\cftchapterdotsep} {\cftdotsep} } \cftinsertcode{B}{ - \renewcommand\cftchapterfont{\bfseries} - \renewcommand\cftchapterpagefont{\bfseries} + \renewcommand\cftchapterfont{\bfseries\sffamily} + \renewcommand\cftchapterpagefont{\bfseries\sffamily} \addtolength\cftbeforechapterskip{1.25em plus 0.7em minus 1em} + \renewcommand{\cftchapterdotsep} {\cftnodots} } \cftinsertcode{C}{\setlength\cftbeforechapterskip{0pt}} + % \renewcommand\cftchapterleader{} +% \renewcommand\cftchapterafterpnum{\cftparfillskip} + +% \let\cftsectionleader\cftchapterleader +% \let\cftsubsectionleader\cftchapterleader +% \let\cftsectionafterpnum\cftchapterafterpnum +% \let\cftsubsectionafterpnum\cftchapterafterpnum + + % set the title of the short ToC \@nameuse{@tocmaketitle} % add the short ToC to the ToC @@ -324,7 +553,7 @@ % reag in the ToC \makeatletter % \input\feline@tocfile -\feline@includetocfile + \feline@includetocfile \endgroup \cleartorecto } @@ -367,18 +596,21 @@ % \input\feline@tocfile \feline@includetocfile - \typeout{widest section: \the\secwidest} - \typeout{widest subsection: \the\subsecwidest} +% \typeout{widest section: \the\secwidest} +% \typeout{widest subsection: \the\subsecwidest} \endgroup } % the internal macros tha lives inside the ToC file \def\cftSubsectionIndentsBackToNormal{% - \cftsetindents{subsubsection}{\secwidest+\subsecwidest+1em}{0em}% +% \cftsetindents{subsubsection}{\secwidest+\subsecwidest+1em}{0em}% +% \cftsetindents{subsubsection}{\memRetrieveStored{wsection}+0.5em}{0em}% +% \cftsetindents{subsubsection}{\secwidest+0.5em}{0em}% } \def\cftSubsectionIndentsPullBack{% - \cftsetindents{subsubsection}{\secwidest+0.5em}{0em}% + %\cftsetindents{subsubsection}{\secwidest+0.5em}{0em}% +% \cftsetindents{subsubsection}{\memRetrieveStored{wsection}+0.5em}{0em}% } \newcommand\ToCSubsectionIndentsPullBack{% @@ -395,3 +627,9 @@ \let\RedofelineEmulSubSubSec\ToCSubsectionIndentsBackToNormal \let\felineEmulSubSubSec\ToCSubsectionIndentsPullBack +% figures + +\renewcommand\cftfigurefont{\sffamily} +\renewcommand\cftfigurepagefont{\sffamily} +\renewcommand\cfttablefont{\sffamily} +\renewcommand\cfttablepagefont{\sffamily} |