escape in verbatim text eats line breaks
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
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 -----------------------------------------------------------------
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
Hans Hagen
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/
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.
participants (3)
-
Hans Hagen
-
pmlists@free.fr
-
Stefan Müller