ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \startframed spurious whitespace
@ 2014-07-23  1:20 Rik Kabel
  2014-07-23  6:20 ` Herbert Voss
  0 siblings, 1 reply; 3+ messages in thread
From: Rik Kabel @ 2014-07-23  1:20 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 375 bytes --]

There appears to be a bug with \startframed. In the following example, 
the instance with no optional argument sets correctly, while with the 
use of an optional argument (even empty []) a whitespace is introduced 
before the text.

    \starttext
    \startframed[]
    Why a space?
    \stopframed

    \startframed
    This is ok.
    \stopframed
    \stoptext

-- 
Rik



[-- Attachment #1.2: Type: text/html, Size: 739 bytes --]

[-- Attachment #2: Type: text/plain, Size: 485 bytes --]

___________________________________________________________________________________
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: \startframed spurious whitespace
  2014-07-23  1:20 \startframed spurious whitespace Rik Kabel
@ 2014-07-23  6:20 ` Herbert Voss
  2014-07-23 13:44   ` Rik Kabel
  0 siblings, 1 reply; 3+ messages in thread
From: Herbert Voss @ 2014-07-23  6:20 UTC (permalink / raw)
  To: ntg-context

Am 23.07.2014 03:20, schrieb Rik Kabel:
> There appears to be a bug with \startframed. In the following example,
> the instance with no optional argument sets correctly, while with the
> use of an optional argument (even empty []) a whitespace is introduced
> before the text.
> 
>     \starttext
>     \startframed[]
>     Why a space?
>     \stopframed

TeX reads "\startframed[] Why a space? \stopframed"
A linebreak is replaced by a space and spaces at the beginning of
a line are ignored by default. Without the optional []
TeX reads "\startframed Why a space? \stopframed"
The first space is "eaten" by TeX while parsing the macro name.

     \startframed[]%   ignore the space
     Why a space?
     \stopframed

It is the same behaviour as for \startframed{} ...


>     \startframed
>     This is ok.
>     \stopframed
>     \stoptext

This is also not correct, you should use:

     \startframed
     This is ok.%
     \stopframed
     \stoptext

Otherwise you'll get a space after the dot.


Herbert
___________________________________________________________________________________
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: \startframed spurious whitespace
  2014-07-23  6:20 ` Herbert Voss
@ 2014-07-23 13:44   ` Rik Kabel
  0 siblings, 0 replies; 3+ messages in thread
From: Rik Kabel @ 2014-07-23 13:44 UTC (permalink / raw)
  To: ntg-context

On 2014-07-23 02:20, Herbert Voss wrote:
> Am 23.07.2014 03:20, schrieb Rik Kabel:
>> There appears to be a bug with \startframed. In the following example,
>> the instance with no optional argument sets correctly, while with the
>> use of an optional argument (even empty []) a whitespace is introduced
>> before the text.
>>
>>      \starttext
>>      \startframed[]
>>      Why a space?
>>      \stopframed
> TeX reads "\startframed[] Why a space? \stopframed"
> A linebreak is replaced by a space and spaces at the beginning of
> a line are ignored by default. Without the optional []
> TeX reads "\startframed Why a space? \stopframed"
> The first space is "eaten" by TeX while parsing the macro name.
>
>       \startframed[]%   ignore the space
>       Why a space?
>       \stopframed
>
> It is the same behaviour as for \startframed{} ...

Yes. TeX does read it that way. I have written LaTeX packages and know 
the issues. ConTeXt, on the other hand, makes an extra effort, at least 
with the start/stop commands, to do it differently. That is one of the 
primary benefits, to my mind, of using 
\starttexdefinition...\stoptexdefinition instead of \def.

Perhaps I am extending my expectation of that improved behavior to 
\startframed[], but it is not, I think, an unreasonable hope.
>>      \startframed
>>      This is ok.
>>      \stopframed
>>      \stoptext
> This is also not correct, you should use:
>
>       \startframed
>       This is ok.%
>       \stopframed
>       \stoptext
>
> Otherwise you'll get a space after the dot.

In a real document I would likely use \par or a blank line at that 
point, but I was trying to provide a DWE (demonstrative working 
example), if not a MWE, to show the issue with the leading space. 
Line-feed hiding with % does not belong in the content of the document 
unless one chooses to drop back to TeX instead of writing within the 
ConTeXt package.
> Herbert

-- 
Rik
___________________________________________________________________________________
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-07-23 13:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-23  1:20 \startframed spurious whitespace Rik Kabel
2014-07-23  6:20 ` Herbert Voss
2014-07-23 13:44   ` Rik Kabel

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