1

I'm looking for some converter LaTeX -> ConTeXt and perhaps LaTeX <- ConTeXt (just in case). I can write simple script and implement translation of basic syntax, but perhaps someone did it?

1
  • 1
    You can try pandoc, which can parse LaTeX and generate ConTeXt output.
    – Aditya
    Sep 28, 2013 at 23:49

1 Answer 1

2

If pandoc conversion fits your need, then you can directly use it in ConTeXt using the filter module:

\usemodule[filter]

\defineexternalfilter
    [latex]
    [
      filter={pandoc -f latex -t context -o \externalfilteroutputfile},
      output=\externalfilterbasefile.tex,
    ]

\starttext

\startlatex
  This is a \textbf{\LaTeX} document that includes a \emph{table}

  \begin{tabular}{ll}
    One & Two \\
    Three & Four \\
  \end{tabular}
\stoplatex
\stoptext

which gives

enter image description here

Note that the conversion is not perfect because Pandoc's internal document model is not rich enough to store all LaTeX/ConTeXt documents.

3
  • Well, pandoc isn't perfect. Probably I need to write own script later. Sep 29, 2013 at 21:40
  • Writing a parser for tex isn't easy. Have a look at xii.tex :-)
    – Aditya
    Sep 30, 2013 at 0:43
  • I have skills, but it is time consuming. And I'm not sure if I want to use ConTeXt, perhaps I will stick to LaTeX. Sep 30, 2013 at 0:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .