Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to debug errors in PDF log compilation? #64

Closed
koppor opened this issue Oct 8, 2015 · 6 comments
Closed

How to debug errors in PDF log compilation? #64

koppor opened this issue Oct 8, 2015 · 6 comments

Comments

@koppor
Copy link
Contributor

koppor commented Oct 8, 2015

Creation of the pdf logs (parameter -lf pdf) fails here. The content of document.log.pdf.log is as follows:

! Too many }'s.
\endminipage ...pagefalse \color@endgroup \egroup 
                                                  \expandafter \@iiiparbox \...
l.134   \logref{207}{208}\endblockitem

pandoc: Error producing PDF from TeX source

I was searching for document.log.tex, but there was only diss-kopp.log.md. Where can I find the .tex to dig a bit into possible causes for the above error message?

@koppor
Copy link
Contributor Author

koppor commented Oct 8, 2015

Although this sounds like a pandoc issue, pandoc "document.log.md" -o "document.log.pdf" runs without any issues.

@akerbos
Copy link
Collaborator

akerbos commented Oct 8, 2015

Good question; I have no idea where Pandoc writes the temporary LaTeX file.

What you can do is change the call to Pandoc yourself. Insert

  target_file = "#{ParameterManager.instance[:jobname]}.log.tex

above that line and you should get the LaTeX file.

If you manage to construct an MWE, I'll have a look myself.

FWIW, \logref is something I hack into the Markdown log before passing it to Pandoc. It's entirely reasonable that there are bugs there, and that has happend before. In most cases, the issue was that specific log messages contained stuff that skrewed the regexp matching and/or ended up as LaTeX code when they should have stayed in their block code environments.

Note to self: this may be more robust if the markdown log used fenced code blocks instead of indented code blocks.

Note to self 2: since this keeps popping up, maybe log compilation should be done in two steps, always: Pandoc creates .tex and we call xelatex ourselves for the last step. Then we always have the intermediate step for debugging.

@akerbos akerbos changed the title PDF log: How to debug? How to debug errors in PDF log compilation? Oct 8, 2015
@akerbos akerbos added this to the Release 1.0 milestone Oct 8, 2015
@akerbos akerbos self-assigned this Oct 8, 2015
@koppor
Copy link
Contributor Author

koppor commented Oct 10, 2015

Think, a MWE will be difficult to construct. Maybe on a rainy day. 😃

Current investigation result. The first occurrence of logref in tex reads as follows:

\logref{207}{208}\endblockitem

But there is no \blockitem before.

@akerbos
Copy link
Collaborator

akerbos commented Oct 11, 2015

There should be a \blockitem right before either one of \(linked)error, \warning or \info, i.e. right at the start of this list item. If that's not there, it seems to be a bug indeed.

A good approach to creating MWEs is to delete half of the code and see if the error persists. If yes, continue. If no, undo and delete the other half.

@akerbos akerbos removed this from the Release 1.0 milestone Jan 7, 2016
@akerbos akerbos removed their assignment Jan 7, 2016
@akerbos
Copy link
Collaborator

akerbos commented Jan 7, 2016

Deferred to #77 after inspecting a concrete example (private communication).

Hotfix for the specific issue may happen, though, pending further input.

@akerbos akerbos closed this as completed Jan 7, 2016
akerbos pushed a commit that referenced this issue Jan 31, 2016
…via MD.

	Should also fix #64 along the way.
 * Writing hashes is a bit more robust now: only write if there are any hashes.
@reitzig
Copy link
Owner

reitzig commented Jan 31, 2016

@koppor I completely reimplemented LaTeX/PDF log generation. If you are still interested, give it a shot -- there should be no (or other, at least) problems now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants