Difference between revisions of "Line breaks marker"

From Wiki
Jump to navigation Jump to search
m (Corrected link)
m (removed duplicated code)
(2 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
from the wizard himself:
 
from the wizard himself:
  
<texcode>
+
<context source="yes" text="looks like this:">
\startreusableMPgraphic{return}
 
    drawarrow
 
      (0,0)--
 
      (1EmWidth,0)--
 
      (1EmWidth,-.5ExHeight)--
 
      (.5EmWidth,-.5ExHeight) ;
 
\stopreusableMPgraphic
 
 
 
\definesymbol[return][\reuseMPgraphic{return}]
 
 
 
\setupcolors[state=start]
 
 
 
\starttext
 
 
 
\def\vcrlf{\symbol[return]\crlf\strut\kern1em\strut\ignorespaces}
 
 
 
\setuptyping[option=commands]
 
 
 
\starttyping
 
test test test /vcrlf test test
 
\stoptyping
 
 
 
\setuptyping[option=color]
 
 
 
\installnewpretty r \vcrlf
 
 
 
\starttyping
 
test \test{test} %%\ r test test
 
\stoptyping
 
</texcode>
 
 
 
looks like this:
 
 
 
<context>
 
 
  \startreusableMPgraphic{return}
 
  \startreusableMPgraphic{return}
 
     drawarrow
 
     drawarrow

Revision as of 03:48, 18 July 2006

< The ConTeXt Way

End of line marker in verbatim texts

from the wizard himself:

 \startreusableMPgraphic{return}
    drawarrow
      (0,0)--
      (1EmWidth,0)--
      (1EmWidth,-.5ExHeight)--
      (.5EmWidth,-.5ExHeight) ;
\stopreusableMPgraphic

\definesymbol[return][\reuseMPgraphic{return}]

\setupcolors[state=start]

\def\vcrlf{\symbol[return]\crlf\strut\kern1em\strut\ignorespaces}

\setuptyping[option=commands]

\starttyping
test test test /vcrlf test test
\stoptyping

\setuptyping[option=color]

\installnewpretty r \vcrlf

\starttyping
test \test{test} %%\ r test test
\stoptyping

looks like this: