[Tex/LaTex] Pandoc: does not include input files

pandoc

I have a LaTeX root file that refers to many other single files. Those files are included/referenced by

\input{somefolder/somefile}

But somehow Pandoc is generating the output just from the main tex file (the entry point) and does not follow the inputs. What am I doing wrong?

pandoc main.tex -t docx -o main.docx

Remark: I'm trying to import the LaTeX to Adobe Indesign by converting it to Docx first and then to Indesign.

Update: I created a minimum working example. Seems that the input file are correctly referenced but still I get tons of other errors that seem to be related to the corporate layout that uses Tkiz drawings. The Pandoc version is 1.19.2.1 on MacOS 10.12.4 (Sierra). The Pandoc command is:

pandoc booklet2016.tex -t docx -o booklet2016.docx

Best Answer

Pandoc does include input files


If you have a structure like this

.
├── main.tex
└── somefolder
    └── somefile.tex

with the following two files

1: main.tex

% !TeX program = XeLaTeX

\documentclass{article}
\begin{document}

\section*{Test}

    Input somefolder/somefile.tex:
    \input{somefolder/somefile}

\end{document}

and

2: somefile.tex

This is somefile

then

pandoc main.tex -t docx -o main.docx

will give you a word document, which contains the contents of somefolder/somefile.tex

3: main.docx

enter image description here


Bottom line: It works. If the structure of your project and/or code is more complicated then you should do some preprocessing first.


Update: Your MWE produces a docx file

enter image description here

As you can see, it contains the content from the included files. The trouble is that pandoc can't parse the elaborate macros (\newcommand) you are using, so there is a lot of noise and not a lot of signal.