ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* escape in verbatim text eats line breaks
@ 2011-01-10 11:23 Stefan Müller
  2011-01-10 14:38 ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Stefan Müller @ 2011-01-10 11:23 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi list,

there seems to be something wrong with the "escape" mechanism in 
verbatim. Line breaks before escaped code are ignored. Consider the 
following example from the wiki [1] (e.g. the second line is printed 
right behind the first with no line break):

\starttext

\setuptyping[TEX][escape=yes]

\startTEX
/BTEX\em sometex/ETEX
/BTEX\em sometex/ETEX \after
\before /BTEX\em sometex/ETEX
\before /BTEX\em sometex/ETEX \after
\before /BTEX\em sometex/ETEX \inbetween /BTEX\em sometex/ETEX \after
\before \after
\stopTEX

\setuptyping[TEX][escape={[[,]]}]

\startTEX
[[\em sometex]]
[[\em sometex]] \after
\before [[\em sometex]]
\before [[\em sometex]] \after
\before [[\em sometex]] \inbetween [[\em sometex]] \after
\before \after
\stopTEX

\setuptyping[TEX][escape=//]

\startTEX
//\em sometex
\before //\em sometex
\stopTEX

\stoptext

Is this a bug or am I missing something here?

Also "\setuptyping[TEX][escape=//]" seems to have no effect at all, "//" 
is printed just like normal chars.

Best regards,
Stefan Müller.


[1] http://wiki.contextgarden.net/Verbatim#Embedded_formatting_commands
___________________________________________________________________________________
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] 5+ messages in thread

* Re: escape in verbatim text eats line breaks
  2011-01-10 11:23 escape in verbatim text eats line breaks Stefan Müller
@ 2011-01-10 14:38 ` Hans Hagen
  2011-01-10 20:07   ` Stefan Müller
  2011-01-10 20:35   ` Peter Münster
  0 siblings, 2 replies; 5+ messages in thread
From: Hans Hagen @ 2011-01-10 14:38 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 10-1-2011 12:23, Stefan Müller wrote:
> Hi list,
>
> there seems to be something wrong with the "escape" mechanism in
> verbatim. Line breaks before escaped code are ignored. Consider the
> following example from the wiki [1] (e.g. the second line is printed
> right behind the first with no line break):
>
> \starttext
>
> \setuptyping[TEX][escape=yes]
>
> \startTEX
> /BTEX\em sometex/ETEX
> /BTEX\em sometex/ETEX \after
> \before /BTEX\em sometex/ETEX
> \before /BTEX\em sometex/ETEX \after
> \before /BTEX\em sometex/ETEX \inbetween /BTEX\em sometex/ETEX \after
> \before \after
> \stopTEX
>
> \setuptyping[TEX][escape={[[,]]}]
>
> \startTEX
> [[\em sometex]]
> [[\em sometex]] \after
> \before [[\em sometex]]
> \before [[\em sometex]] \after
> \before [[\em sometex]] \inbetween [[\em sometex]] \after
> \before \after
> \stopTEX
>
> \setuptyping[TEX][escape=//]
>
> \startTEX
> //\em sometex
> \before //\em sometex
> \stopTEX
>
> \stoptext
>
> Is this a bug or am I missing something here?

I get newlines here.

> Also "\setuptyping[TEX][escape=//]" seems to have no effect at all, "//"
> is printed just like normal chars.

Actually in mkii it's

\setuptyping[TEX][escape=/]

\startTEX
/em sometex
\before /em sometex
\stopTEX

and indeed in mkiv it does not work. I will provide a bit of backward 
compatibility but keep in mind that in mkiv the \em change will cross 
lines, so in this case the first sometex as well as \before will be 
slanted.


-----------------------------------------------------------------
                                           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] 5+ messages in thread

* Re: escape in verbatim text eats line breaks
  2011-01-10 14:38 ` Hans Hagen
@ 2011-01-10 20:07   ` Stefan Müller
  2011-01-10 20:35   ` Peter Münster
  1 sibling, 0 replies; 5+ messages in thread
From: Stefan Müller @ 2011-01-10 20:07 UTC (permalink / raw)
  To: mailing list for ConTeXt users



On 10.01.2011 15:38, Hans Hagen wrote:
>> Is this a bug or am I missing something here?
>
> I get newlines here.

I'm using minimals: ConTeXt version 2011.01.06 17:08

Just to clarify: My first line in the PDF result is
"sometexsometex \after"

>> Also "\setuptyping[TEX][escape=//]" seems to have no effect at all, "//"
>> is printed just like normal chars.
>
> Actually in mkii it's
>
> \setuptyping[TEX][escape=/]
>
> \startTEX
> /em sometex
> \before /em sometex
> \stopTEX

Does that mean the example on the wiki page is not correct?

> and indeed in mkiv it does not work. I will provide a bit of backward
> compatibility but keep in mind that in mkiv the \em change will cross
> lines, so in this case the first sometex as well as \before will be
> slanted.

Thanks and best regards,
Stefan
___________________________________________________________________________________
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] 5+ messages in thread

* Re: escape in verbatim text eats line breaks
  2011-01-10 14:38 ` Hans Hagen
  2011-01-10 20:07   ` Stefan Müller
@ 2011-01-10 20:35   ` Peter Münster
  2011-01-21 13:13     ` Stefan Müller
  1 sibling, 1 reply; 5+ messages in thread
From: Peter Münster @ 2011-01-10 20:35 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hans Hagen <pragma@wxs.nl> writes:

>> Is this a bug or am I missing something here?
>
> I get newlines here.

Minimal example:

\definetyping[Test][escape={/,/}]
\starttext
No line break between the blas:
\startTest
bla
/bla/
\stopTest
\stoptext

-- 
Peter Münster

Contact information: http://pmrb.free.fr/contact/
___________________________________________________________________________________
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] 5+ messages in thread

* Re: escape in verbatim text eats line breaks
  2011-01-10 20:35   ` Peter Münster
@ 2011-01-21 13:13     ` Stefan Müller
  0 siblings, 0 replies; 5+ messages in thread
From: Stefan Müller @ 2011-01-21 13:13 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Because of the new beta I tried it again with a current Mk IV version 
(2011.01.18 19:34).

The examples I provided (from the wiki, now abbreviated, with numbering) 
have correct line breaks but the second line does not get a number.

\setuptyping[TEX][escape=yes, numbering=line]
\startTEX
/BTEX\em sometex/ETEX
/BTEX\em sometex/ETEX \after
\stopTEX
\setuptyping[TEX][escape={[[,]]}]
\startTEX
[[\em sometex]]
[[\em sometex]] \after
\stopTEX

The example from Peter Münster works worse: now there is one line break 
more instead of one less. In addition the escaped line does not get a 
number as above. It works if the line starts with (non-escaped) text, 
space or tab.

\definetyping[Test][escape={/,/}, numbering=line]
\starttext
Two line breaks between the first two blas \\
The second bla does not get a number
\startTest
bla
/bla/
bla
\stopTest
\stoptext

In the examples above there's a difference when using start/stopTEX with 
setuptyping[TEX] and when using start/stopTest with definetyping[Test]. 
I don't know why.

Thank you so far, Hans. Best regards,
Stefan.
___________________________________________________________________________________
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] 5+ messages in thread

end of thread, other threads:[~2011-01-21 13:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-10 11:23 escape in verbatim text eats line breaks Stefan Müller
2011-01-10 14:38 ` Hans Hagen
2011-01-10 20:07   ` Stefan Müller
2011-01-10 20:35   ` Peter Münster
2011-01-21 13:13     ` Stefan Müller

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