texmath icon indicating copy to clipboard operation
texmath copied to clipboard

LaTeX -> doc: set

Open catap opened this issue 5 years ago • 3 comments

I'm trying to convert some .tex to .docx with a lot of complex math and pandoc-2.11.3.1 can't convert \set{..} and similar cases.

Usual error looks like:

[WARNING] Could not convert TeX math '\set{1, \dots, n}', rendering as TeX:
  \set{1, \dots, n}
      ^
  unexpected "{"
  expecting "%", "\\label", "\\nonumber" or whitespace

Test case:

\documentclass{scrartcl}

\begin{document}

$\set{1, \dots, n}$

\end{document}

catap avatar Dec 24 '20 00:12 catap

Is \set part of core tex? If not, where is it defined? (You minimal test case doesn't compile with latex, so I gather it's defined in some external package.)

jgm avatar Dec 24 '20 02:12 jgm

@jgm before your question I was very sure that it is part of LaTeX.

Anyway, you're right and it came from \usepackage{braket}

catap avatar Dec 24 '20 02:12 catap

I see. Well, this package can't have the ambition of supporting everything in CTAN. We try to support the most commonly used packages. I'd suggest simply adding a macro definition of \set to your document -- if you're using pandoc, you can do something like pandoc mymacros.md myfile.md where mymacros.md contains the macro definitions you need. Pandoc will process these.

jgm avatar Dec 24 '20 18:12 jgm