mirrored leftmarginwidth in enumerations
If anyone has a suggestion for putting enumeration texts toward the right edge of the left margin, I would be grateful. In MkII enumerations, I would put a triangle (fig.2) in the left margin using \defineenumeration [pause] [title=no, text={\externalfigure[fig.2][height=1em]}, location=inleft, number=no, ] The triangle was automatically aligned toward the right side of the left margin (fill glue on the left), which was what I wanted, on even and odd pages. In MkIV, the marginal text is automatically aligned to the left side. I restored the MkII effect using this hack (using a > instead of the triangle, to make the example more self contained): \defineenumeration [pause] [title=no, text={\hbox to \leftmarginwidth{\hfil $>$}}, number=no, alternative=inleft, ] But I just realized that the hack doesn't work for double-sided layouts. Using the leftmarginwidth is correct on the odd pages, but it is too big for the even pages. Thus, on page 2 of the example below, the > overlaps the "question" text. Is there a more idiomatic MkIV replacement for my hack? Or is my hack okay, but ConTeXt should be updated to interpret leftmarginwidth to mean "the leftmarginwidth, as appropriate for an odd or an even page"? Here is the example: \setuplayout[marking=on,location=middle, backspace=1.25in, leftmargindistance=0.125in, leftmargin=0.625in, width=4.75in, rightmargindistance=0.25in, rightmargin=0.25in, ] \setuppagenumbering[alternative={doublesided}] \defineenumeration [pause] [title=no, text={\hbox to \leftmarginwidth{\hfil $>$}}, number=no, alternative=inleft, ] \def\question#1{\startpause\relax #1 \stoppause} \showframe \starttext \question{hello} \page \question{hello} \stoptext
Am 30.03.2014 um 20:00 schrieb Sanjoy Mahajan
If anyone has a suggestion for putting enumeration texts toward the right edge of the left margin, I would be grateful.
In MkII enumerations, I would put a triangle (fig.2) in the left margin using
\defineenumeration [pause] [title=no, text={\externalfigure[fig.2][height=1em]}, location=inleft, number=no, ]
The triangle was automatically aligned toward the right side of the left margin (fill glue on the left), which was what I wanted, on even and odd pages.
In MkIV, the marginal text is automatically aligned to the left side. I restored the MkII effect using this hack (using a > instead of the triangle, to make the example more self contained):
\defineenumeration [pause] [title=no, text={\hbox to \leftmarginwidth{\hfil $>$}}, number=no, alternative=inleft, ]
But I just realized that the hack doesn't work for double-sided layouts.
Using the leftmarginwidth is correct on the odd pages, but it is too big for the even pages. Thus, on page 2 of the example below, the > overlaps the "question" text.
Is there a more idiomatic MkIV replacement for my hack? Or is my hack okay, but ConTeXt should be updated to interpret leftmarginwidth to mean "the leftmarginwidth, as appropriate for an odd or an even page"?
Here is the example:
\setuplayout[marking=on,location=middle, backspace=1.25in, leftmargindistance=0.125in, leftmargin=0.625in, width=4.75in, rightmargindistance=0.25in, rightmargin=0.25in, ]
\setuppagenumbering[alternative={doublesided}]
\defineenumeration [pause] [title=no, text={\hbox to \leftmarginwidth{\hfil $>$}}, number=no, alternative=inleft, ]
\def\question#1{\startpause\relax #1 \stoppause}
\showframe
\starttext \question{hello} \page \question{hello} \stoptext
\defineenumeration [pause] [title=no, text={\symbol[triangle]}, width=fit, number=no, alternative=inleft] Wolfgang
Wolfgang Schuster
\defineenumeration [pause] [title=no, text={\symbol[triangle]}, width=fit, number=no, alternative=inleft]
Thank you. That works beautifully. Is my understanding right, that width=fit is what makes the head (here the triangle symbol) fit into its zone (here, the left margin)? How does it know to put the space on the left side of the triangle, rather than on the right side? Once I understand enough to not say nonsense, I'll wikify an example. -Sanjoy
participants (2)
-
Sanjoy Mahajan
-
Wolfgang Schuster