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
    You can try pandoc, which can parse LaTeX and generate ConTeXt output. – Aditya Sep 28 '13 at 23:49
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.

  • Well, pandoc isn't perfect. Probably I need to write own script later. – random.nick Sep 29 '13 at 21:40
  • Writing a parser for tex isn't easy. Have a look at xii.tex :-) – Aditya Sep 30 '13 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. – random.nick Sep 30 '13 at 0:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.