0

I have a document (FromLaTeX.tex) something like this:

\documentclass{article}
\begin{document}
\section*{Introduction}
\section{First}
\section{Second}
\subsection{Numbered subsection}
\subsection*{Unnumbered subsection}
\section{Third}
\section*{References}
\end{document}

which I want to convert to Word using pandoc

pandoc -f latex -t docx -N --reference-doc=mycustomdoc.docx FromLaTeX.tex -o ToWord.docx

How can I suppress the numbering for \section*s in my Word document?

Update/Clarification:

I would like to use Word's built-in style-system for the headings and have created a reference-doc for pandoc to use (mycustomdoc.docx), which has numbered headings as the main heading-styles (Heading 1, Heading 2, etc.). I have also created unnumbered headings-styles that match the numbered ones in the same reference-doc (Unnumbered Heading 1, ...). I would like to be able to match the \section*s to these unnumbered headings when converting to docx.

  • First question i ask myself as a non-Word user: Does Word allow unnumbered sections? – Johannes_B Jul 1 '18 at 6:26
  • @Johannes_B Word has a style system where you can define if you want your sections numbered or unnumbered. You can then define a set of numbered sections and a set of unnumbered sections. But I don't know how to tell pandoc to use one for \section{} and the other for \section*{} – jan Jul 1 '18 at 6:43
  • 1
    tex4ht can convert your document with unnumbered sections. try make4ht -f odt FromLaTeX.tex. – michal.h21 Jul 1 '18 at 8:03
  • @michal.h21 Hmm, that might be an option. However, I would like to use pandoc since it's part of a more complex workflow using pandoc-citeproc and other things (omitted here for the MWE). I tried your option though, but ... apologies for my ignorance ... where does the output go? – jan Jul 1 '18 at 15:21
  • the output goes to FromLaTeX.odt, it can be converted to docx by LibreOffice. Word can open it as well, but the support isn't really good. – michal.h21 Jul 1 '18 at 16:33

Your Answer

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

Browse other questions tagged or ask your own question.