Ok, I works when using the `-H` argument to include other files which must be processed with pandoc. Any other options ? Maybe there is a specific include command to add in the LaTeX template file ? Le vendredi 17 juillet 2015 08:44:23 UTC+2, Christopher a écrit : > > Hello John, > > Thanks for your reply. > > As you suggest, I check the generated tex file before converting it to pdf: > > \documentclass[10pt, a4paper]{report} > > \input{path-to/my-included-tex-file} > > \begin{document} > > Hello World > > \end{document} > > The error log is more verbose using pdflatex. This is the error: > > ! LaTeX Error: Missing \begin{document}. > ... > > l.6 $ > if(title)$ > ? > > The included file contains if statements which have not been evaluated... > How can I solve this issue and include other tex files in a template ? > Included files also contains pandoc variables checks, etc. > > Thanks in advance for you help. > > Le vendredi 17 juillet 2015 00:10:58 UTC+2, John MacFarlane a écrit : >> >> This should be possible. Whatever is in your template will >> just be passed through to the LaTeX output. >> >> To get a better idea of what is happening, try using >> >> pandoc -t latex -s --template /path/to/your/template >> -o output.tex input.md >> >> to create a latex file, output.tex, which you can inspect. >> Make sure it contains the `\input` line. >> Then run pdflatex on it directly and see what happens. >> >> +++ Christopher [Jul 16 15 14:27 ]: >> > Hi, >> > Is it possible to use the `input` command in a template file to add >> > custom definitions from another LaTeX file ? >> > Here is my main template file: >> > ``` >> > \documentclass[10pt, a4paper]{report} >> > \input{path/my-other-file} >> > \begin{document} >> > $body$ >> > \end{document} >> > ``` >> > The input file looks like this : >> > ``` >> > $if(title)$ >> > \def\theTitle{$title$} >> > $else$ >> > \def\theTitle{The title} >> > $endif$ >> > ``` >> > When running, I have the following error : >> > ``` >> > ! LaTeX Error: Missing \begin{document}. >> > ``` >> > Are input files supported in templates ? >> > Thanks in advance, >> > Regards >> > Christopher >> > >> > -- >> > You received this message because you are subscribed to the Google >> > Groups "pandoc-discuss" group. >> > To unsubscribe from this group and stop receiving emails from it, >> send >> > an email to [1]pandoc-discus...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > To post to this group, send email to >> > [2]pandoc-...-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> > To view this discussion on the web visit >> > [3] >> https://groups.google.com/d/msgid/pandoc-discuss/d9620980-3826-44fa- >> > 88a3-f6fa071f06b2%40googlegroups.com. >> > For more options, visit [4]https://groups.google.com/d/optout. >> > >> >References >> > >> > 1. mailto:pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >> > 2. mailto:pandoc-...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org >> > 3. >> https://groups.google.com/d/msgid/pandoc-discuss/d9620980-3826-44fa-88a3-f6fa071f06b2-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org?utm_medium=email&utm_source=footer >> > 4. https://groups.google.com/d/optout >> >> -- You received this message because you are subscribed to the Google Groups "pandoc-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to pandoc-discuss-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/c34d4b75-e8a8-45f8-97c3-5917612209f4%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.