1

I am currently trying to understand the l3draw package defined functions and looked at the example:

\dim_new:N \l_mypos_dim
\draw_begin:
\draw_path_moveto:n { 0cm , \l_mypos_dim } % Coordinate (0,0) move to 
\draw_path_lineto:n { 1cm , \l_mypos_dim } % (1,0) horizontally.
\dim_set:Nn \l_mypos_dim { 1cm }           % Define the new y-coordinate.
\draw_path_lineto:n { 1cm , \l_mypos_dim } % Draw from (1,0)--(1,1).
\draw_path_close:                          % Close path from (1,1)--(0,0).
\draw_path_use_clear:n { stroke }
\draw_end:

Are the comments the correct interpretation?

My objective is to replicate the answer here: A symbol of a graph of a function without to use TikZ and similar just for fun.

azetina
  • 28,884
  • Looks about right, but the first is also a draw not a move. So you're drawing (0,0) -- (1,0) -- (1,1) -- cycle; (in the equivalent TikZ notation). – Skillmon Jan 09 '20 at 21:29
  • @Skillmon On page 10 it says In general, for reliable treatment by viewers, a \draw_path_moveto:n operation should precede the first use of a \draw_- path_lineto:n on a path. – azetina Jan 09 '20 at 21:33
  • Yes, but the comment there is slightly off. It should be move to (0,0) and draw to (1,0) horizontally – Skillmon Jan 09 '20 at 21:34
  • The interpretation is correct. I'm not sure what's the real usage of \l_mypos_dim – egreg Jan 09 '20 at 21:49
  • @azetina See the translation in the new language. ;-) – egreg Jan 09 '20 at 22:25
  • @egreg Incredible! :) – azetina Jan 10 '20 at 00:09
  • \l_mypos_dim
    (interpreted as 'my postion dimension'), it is just defining a value in the first line, before the drawing environment.   
    
    

    In this example it isn't clear if the value is zero. Maybe it is predefined in the code.

    And the command:

    \draw_path_close:
    
    

    means the path will be closed connecting to the first defined point.

    – Emílio Kavamura Jan 16 '20 at 01:01

0 Answers0