How do you track down errors reported during the export process? I am writing an Org document and exporting it to PDF. (I do not know LaTeX).
I was getting the following error: org-latex-compile: PDF file ./myfile.pdf wasn't produced: [undefined control sequence] [package error] Runaway argument
. By trial and error, I narrowed it down to this section of the document:
* Prefix key
* ~M-p~ (currently unassigned)
* ~H-c~ (currently unassigned)
* ~H-;~ (currently unassigned)
After much web searching, I discovered that a limitation of LaTeX is that verbatim text cannot be used in a subheading. The LaTeX generated from the above snippet included lines like:
\subsubsection{\verb~M-p~ (currently unassigned)}
Changing the subheadings to an unordered list fixed the problem:
* Prefix key
- ~M-p~ (currently unassigned)
- ~H-c~ (currently unassigned)
- ~H-;~ (currently unassigned)
because those generated lines looked more like this:
\item \verb~M-p~ (currently unassigned)
Now, finally, here is my question: Is there a better way of tracking down, diagnosing, and solving such errors than my trial-and-error-plus-web-search (short of, say, spending a few weeks learning LaTeX)?
Currently, my file produces a seemingly-fine PDF... but the export process does issue an error message: Process completed with errors: [package error]
. I have no idea whether this is serious, whether it has affected my PDF output in a way that I haven't noticed yet, or if it's trivial and should be ignored. Any help is appreciated.
tex2pdf
or whatever other command you use to generate PDF. Switch to*Org PDF LaTeX Output*
to see it. Package error typically means that you used some package, which you didn't install (you are missing some STY file).inputenc
complained because I used a UTF character that LaTeX apparently can't represent. Thanks!