Wrong structure numbers in margin
Hi Hans, could you check the definition of \placeheadmarginalternative in strc-ren.mkiv? The current solution fails when structure number are set to “margin” in a doublesided layout because of the hard-coded \leftmargindistance. The “maybe better” solution actually seems to work better. \setuplayout [backspace=8cm, width=5cm, leftmargindistance=2cm] \setuppagenumbering [alternative=doublesided] \setupheads [alternative=margin] \unexpanded\def\placeheadmarginalternative#1#2% {\vbox {\localheadsetup \begstrut % use one \strut here! \dontleavehmode % in case there is no strut, else side effects with llap \ifconditional\headshownumber % this gives a wrong result on the second page %\llap{\hbox{\hfill{#1}\hskip\localheadskip\hskip\leftmargindistance}}% introduces whitespace % maybe better: \inleftmargin{\hbox{\hss{#1}\hskip\localheadskip}}% \fi {#2}}} \showframe \starttext \chapter{Chapter} \null\page \section{Section} \subsection{Subsection} \subsubsection{Subsubsection} \stoptext Regards Marco Patzer
Am 16.05.2012 um 19:24 schrieb Marco:
Hi Hans,
could you check the definition of \placeheadmarginalternative in strc-ren.mkiv? The current solution fails when structure number are set to “margin” in a doublesided layout because of the hard-coded \leftmargindistance. The “maybe better” solution actually seems to work better.
\inleftmargin can be a problem when you have another margin data command before the heading.
\unexpanded\def\placeheadmarginalternative#1#2% {\vbox {\localheadsetup \begstrut % use one \strut here! \dontleavehmode % in case there is no strut, else side effects with llap \ifconditional\headshownumber % this gives a wrong result on the second page %\llap{\hbox{\hfill{#1}\hskip\localheadskip\hskip\leftmargindistance}}% introduces whitespace % maybe better: \inleftmargin{\hbox{\hss{#1}\hskip\localheadskip}}% \fi {#2}}}
It’s simpler to check for odd/even page and use the right dimension: \unexpanded\def\placeheadmarginalternative#1#2% {\vbox {\localheadsetup \begstrut % use one \strut here! \dontleavehmode % in case there is no strut, else side effects with llap \ifconditional\headshownumber \llap{\hbox{\hfill{#1}\hskip\dimexpr\localheadskip+\doifoddpageelse\leftmargindistance\rightmargindistance\relax}}% introduces whitespace \fi {#2}}} Wolfgang
participants (2)
-
Marco
-
Wolfgang Schuster