ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <schuster.wolfgang@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: mirrored leftmarginwidth in enumerations
Date: Sun, 30 Mar 2014 20:53:09 +0200	[thread overview]
Message-ID: <5D106621-F019-4D82-8E88-DB2AD0E14E54@gmail.com> (raw)
In-Reply-To: <87sipzr2hk.fsf@approx.mit.edu>


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
___________________________________________________________________________________


  reply	other threads:[~2014-03-30 18:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-30 18:00 Sanjoy Mahajan
2014-03-30 18:53 ` Wolfgang Schuster [this message]
2014-03-30 20:30   ` Sanjoy Mahajan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5D106621-F019-4D82-8E88-DB2AD0E14E54@gmail.com \
    --to=schuster.wolfgang@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).