I'm thinking about switching from LaTeX to ConTeXt. I'm using LaTeX extensively to create teaching materials with an extended version of xsim
. There are a lot of things I would need to port, one of them is a macro which produces a number of lines as a writing area for students. In LaTeX I just draw a line with TikZ with \linewidth
, which returns the width in the current environment (e.g. in an itemize
environment). I tried to recreate this same behavior with ConTeXt / MetaPost(fun) and it works well with \textwidth
which returns the full width, independent of the current environment. I could not find any reference to a equivalent of \linewidth
in the documentations. Is there such a command or a possibility to get the current environments x position?
Here's a minimal example, I would need to replace \the\textwidth
with something like \the\linewidth
. There are other issues, like the justification of the text before the break, but this is something I may figure out later.
\setuppapersize[A4]
\setupbodyfont[modern,12pt]
\starttext
\startuseMPgraphic{line}
draw ((0cm,0cm)--(\the\textwidth,0cm)) ;
\stopuseMPgraphic
\startitemize
\item here we list the points,\break\useMPgraphic{line}
\item one after the other.
\stopitemize
\useMPgraphic{line}
\stopchapter
\stoptext