Difference between revisions of "Line breaks marker"

From Wiki
Jump to navigation Jump to search
m (removed duplicated code)
(Former example didn't work any more (2024/02). Removed part of example whose purpose I could not devine and made the rest work.)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
< [[The ConTeXt Way]]
 
 
 
== End of line marker in verbatim texts ==
 
== End of line marker in verbatim texts ==
  
Line 6: Line 4:
  
 
<context source="yes" text="looks like this:">
 
<context source="yes" text="looks like this:">
\startreusableMPgraphic{return}
+
\startreusableMPgraphic{return}
 
     drawarrow
 
     drawarrow
 
       (0,0)--
 
       (0,0)--
Line 20: Line 18:
 
\def\vcrlf{\symbol[return]\crlf\strut\kern1em\strut\ignorespaces}
 
\def\vcrlf{\symbol[return]\crlf\strut\kern1em\strut\ignorespaces}
  
\setuptyping[option=commands]
+
\setuptyping[TEX][escape=yes]
  
\starttyping
+
\startTEX
test test test /vcrlf test test
+
test test test /BTEX\vcrlf/ETEX test test
\stoptyping
+
\stopTEX
  
\setuptyping[option=color]
+
</context>
 
 
\installnewpretty r \vcrlf
 
  
\starttyping
+
[[Category:Basics]]
test \test{test} %%\ r test test
+
[[Category:Tools]]
\stoptyping
 
</context>
 

Latest revision as of 15:02, 3 February 2024

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[TEX][escape=yes]

\startTEX
test test test /BTEX\vcrlf/ETEX test test
\stopTEX

looks like this: