ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* mirrored leftmarginwidth in enumerations
@ 2014-03-30 18:00 Sanjoy Mahajan
  2014-03-30 18:53 ` Wolfgang Schuster
  0 siblings, 1 reply; 3+ messages in thread
From: Sanjoy Mahajan @ 2014-03-30 18:00 UTC (permalink / raw)
  To: ntg-context

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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mirrored leftmarginwidth in enumerations
  2014-03-30 18:00 mirrored leftmarginwidth in enumerations Sanjoy Mahajan
@ 2014-03-30 18:53 ` Wolfgang Schuster
  2014-03-30 20:30   ` Sanjoy Mahajan
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Schuster @ 2014-03-30 18:53 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 30.03.2014 um 20:00 schrieb Sanjoy Mahajan <sanjoy@MIT.EDU>:

> 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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: mirrored leftmarginwidth in enumerations
  2014-03-30 18:53 ` Wolfgang Schuster
@ 2014-03-30 20:30   ` Sanjoy Mahajan
  0 siblings, 0 replies; 3+ messages in thread
From: Sanjoy Mahajan @ 2014-03-30 20:30 UTC (permalink / raw)
  To: Wolfgang Schuster, mailing list for ConTeXt users

Wolfgang Schuster <schuster.wolfgang@gmail.com> writes:

> \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
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-03-30 20:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-30 18:00 mirrored leftmarginwidth in enumerations Sanjoy Mahajan
2014-03-30 18:53 ` Wolfgang Schuster
2014-03-30 20:30   ` Sanjoy Mahajan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).