KWARC / LaTeX-proposal

The Proposal package for LaTeX
64 stars 34 forks source link

[BUG] Last page is zeroed if no bibliography is used #15

Open iron76 opened 8 years ago

iron76 commented 8 years ago

This is related to #14. I tried the latest LaTeX-proposal code (cloned from github) and the problem persists. The last page is labelled 0. I found out a workaround consisting in writing something in between \end{proposal} and \end{document}. This was actually why initially I was assuming the problem related to the finalised version (see my previous issue https://github.com/pdebuyl/FET_Proposal/issues/1).

kohlhase commented 8 years ago

I still cannot reproduce your problem, and I see that https://github.com/pdebuyl/FET_Proposal/tree/master/LaTeX-proposal is still not updated. But I also do not see what you are applying it to. Can you either

iron76 commented 8 years ago

Sorry. I forgot to say that the bug is replicable with one of the examples in your repository (please notice that this bug has nothing to do with the repository by @pdebuyl, otherwise I would have opened the issue there). Here are the steps to generate a .pdf with zeroed last page:

git clone https://github.com/KWARC/LaTeX-proposal.git 
cd LaTeX-proposal/eu/examples/fetopenstrep/
pdflatex propB.tex 
... (repeat as many times as you want)
pdflatex propB.tex 

The produced propB.pdf has tags page n of 0 in all pages.

pdebuyl commented 8 years ago

Using pdflatex instead of the Makefile results in your system-wide copy of the style files to be used instead of those of the repository. Check the propB.log file to check which files are used.

It is possible to set the TEXINPUTS environment variables, see https://github.com/pdebuyl/FET_Proposal/blob/master/debian-env.sh

iron76 commented 8 years ago

I checked and I am using the correct style files. Further digging I found out that the issue is instead related to the fact that I am not compiling the bibliography. As soon as I do it the last page is correctly set. The issue is crucial in my proposal because I don't have a bibliography. Anyway I have to say this issue might be considered minor since at least I have a workaround. Thanks for the help.

kohlhase commented 8 years ago

Thanks for digging, I can reproduce now, and I am quite sure that I can fix this. The main problem is that I never envisioned that someone would not want references. I will probably have to make this configurable.

pdebuyl commented 8 years ago

Indeed, a single bibliography element solves the problem. This is thus a rather uncommon problem.

Also, in the case of an empty bibliography, biblatex throws a "latex warning". Is that the cause of the missing {prop}{pages}{last} pdata reference?

kohlhase commented 8 years ago

It seems that this is a timing issue: LaTeXML closes the pdata file before it has the chance to write the last page. We probably have to build in something that flushes the buffers (and opening another file does that I think). Or we have to make the \protected@write I am using \immediate (I thought it was). I have to investigate further, but do not currently have the time.