ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Problem with \inmargin on \item lines
@ 2012-05-02  4:33 Malte Stien
  2012-05-02  8:07 ` Hans Hagen
  2012-05-02 11:30 ` Rogers, Michael K
  0 siblings, 2 replies; 3+ messages in thread
From: Malte Stien @ 2012-05-02  4:33 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi everyone,

I am experiencing a problem with \inmargin{some text} in \itemized lists. I am using them a lot in my documents, and it is kind of annoying. It appears that if one uses the \inmargin macro just prior to the \item macro, the in-margin text is typeset against the previous line, not the line with the \item. Minimal example.

\starttext
\startitemize
	\item This is just a normal completely innocent paragraph against which one will be able to judge the amount of indentation of the next paragraph.
	\inmargin{Duck}\item This paragraph has a duck inmargin comment
\stopitemize
\stoptext

That seems fair enough and even makes sense on some level. If however, one reverses the two macros, like so:

  	\item\inmargin{Duck} This paragraph has a duck inmargin comment

the leading space just after the closing brace is actually printed. I take this to be a bug, or is this by design? The only way I can around this is to not use a space, like so:

  	\item\inmargin{Duck}This paragraph has a duck inmargin comment

But I don't find that to be a satisfying solution. After all I am using ConTeXt because I am a bit pedantic about text, even the source code in this case.

Regards,
Malte.

___________________________________________________________________________________
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: Problem with \inmargin on \item lines
  2012-05-02  4:33 Problem with \inmargin on \item lines Malte Stien
@ 2012-05-02  8:07 ` Hans Hagen
  2012-05-02 11:30 ` Rogers, Michael K
  1 sibling, 0 replies; 3+ messages in thread
From: Hans Hagen @ 2012-05-02  8:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Malte Stien

On 2-5-2012 06:33, Malte Stien wrote:
> Hi everyone,
>
> I am experiencing a problem with \inmargin{some text} in \itemized lists. I am using them a lot in my documents, and it is kind of annoying. It appears that if one uses the \inmargin macro just prior to the \item macro, the in-margin text is typeset against the previous line, not the line with the \item. Minimal example.
>
> \starttext
> \startitemize
> 	\item This is just a normal completely innocent paragraph against which one will be able to judge the amount of indentation of the next paragraph.
> 	\inmargin{Duck}\item This paragraph has a duck inmargin comment
> \stopitemize
> \stoptext
>
> That seems fair enough and even makes sense on some level. If however, one reverses the two macros, like so:
>
>    	\item\inmargin{Duck} This paragraph has a duck inmargin comment
>
> the leading space just after the closing brace is actually printed. I take this to be a bug, or is this by design? The only way I can around this is to not use a space, like so:
>
>    	\item\inmargin{Duck}This paragraph has a duck inmargin comment
>
> But I don't find that to be a satisfying solution. After all I am using ConTeXt because I am a bit pedantic about text, even the source code in this case.

the magin note has to anchor somewhere so the second approach is the 
best as after all \item can start with doing spacing things

concerning the space ... sometimes you want a space so gobbling the next 
one is debatable; you can of course wrap the command, as in:

\def\myinmargin#1{\inmargin{#1}\ignorespaces}


-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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: Problem with \inmargin on \item lines
  2012-05-02  4:33 Problem with \inmargin on \item lines Malte Stien
  2012-05-02  8:07 ` Hans Hagen
@ 2012-05-02 11:30 ` Rogers, Michael K
  1 sibling, 0 replies; 3+ messages in thread
From: Rogers, Michael K @ 2012-05-02 11:30 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

It is not a bug. It is standard TeX: a space counts after "}" and is ignored immediately after a control sequence such as "\item".  To override either, you have to be explicit, "\ignorespaces" as Hans suggested in your case and "\ " (backslash-space) in the other to put a space in.  My preferred, idiosyncratic, pedantic way to ignore spaces in this case is a comment symbol and newlines:

\starttext
\startitemize
\item
This is just a normal completely innocent paragraph against which one will be able to judge the amount of indentation of the next paragraph.
\item\inmargin{Duck}%
This paragraph has a duck inmargin comment
\stopitemize
\stoptext

But I like newlines in my code, probably because I started editing text on 24x80 crt that would show only the first 80 characters of a line.

Michael

On May 2, 2012, at 12:33 AM, Malte Stien wrote:

> Hi everyone,
>
> I am experiencing a problem with \inmargin{some text} in \itemized lists. I am using them a lot in my documents, and it is kind of annoying. It appears that if one uses the \inmargin macro just prior to the \item macro, the in-margin text is typeset against the previous line, not the line with the \item. Minimal example.
>
> \starttext
> \startitemize
>       \item This is just a normal completely innocent paragraph against which one will be able to judge the amount of indentation of the next paragraph.
>       \inmargin{Duck}\item This paragraph has a duck inmargin comment
> \stopitemize
> \stoptext
>
> That seems fair enough and even makes sense on some level. If however, one reverses the two macros, like so:
>
>       \item\inmargin{Duck} This paragraph has a duck inmargin comment
>
> the leading space just after the closing brace is actually printed. I take this to be a bug, or is this by design? The only way I can around this is to not use a space, like so:
>
>       \item\inmargin{Duck}This paragraph has a duck inmargin comment
>
> But I don't find that to be a satisfying solution. After all I am using ConTeXt because I am a bit pedantic about text, even the source code in this case.
>
> Regards,
> Malte.
>

________________________________

This e-mail message (including any attachments) is for the sole use of
the intended recipient(s) and may contain confidential and privileged
information. If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination, distribution
or copying of this message (including any attachments) is strictly
prohibited.

If you have received this message in error, please contact
the sender by reply e-mail message and destroy all copies of the
original message (including attachments).
___________________________________________________________________________________
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:[~2012-05-02 11:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-02  4:33 Problem with \inmargin on \item lines Malte Stien
2012-05-02  8:07 ` Hans Hagen
2012-05-02 11:30 ` Rogers, Michael K

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).