aslushnikov / latex-online

Online latex compiler. You give it a link, it gives you PDF
http://latexonline.cc
MIT License
497 stars 89 forks source link

Compile twice #16

Closed ktzanev closed 8 years ago

ktzanev commented 8 years ago

When I try to compile the following link :

http://latex.aslushnikov.com/compile?git=https://github.com/ktzanev/m53lille1&target=DS/M53_2015-16_Rattrapage.tex

the compilation works fine, but one of the elements that is positioned in an absolute way on the page using tikz needs the source to be compiled twice.

Does latex-online offers a parameter for compiling twice ?

aslushnikov commented 8 years ago

No, there's no such argument - it should automatically do necessary amount of steps to produce correct result. Could you please add a screenshot of what is exactly misaligned? This way I would be able to fix the problem.

The latex-online relies on rubber to build tex. The build system is responsible for running build as many times as needed.

However, the system is not ideal and maybe it is a time to switch to something modern. :)

ktzanev commented 8 years ago

When you compile a tikz image with the parameters [remember picture,overlay] like here that allows you to place it anywhere on the page, you have to compile twice.

example

ktzanev commented 8 years ago

I came to see that the other tikz images are missing. You can compare your compiled result with my local compilation result.

aslushnikov commented 8 years ago

Interesting. How do you compile this doc? Do you just run pdflatex twice?

I've tried running latexrun on your input, but it reported a lot of syntax errors.

ktzanev commented 8 years ago

I was compiling with xelatex, but it was supposed to be compatible with pdflatex too. BUT, there was a unicode minus sign (U+2212) that was not compatible with pdflatex (copy/paste problem). Now I have updated the source and it comiles fine with pdflatex, with xelatex and with lualatex. But it is not working with your system.

And yes I compile it twice to have the T.S.V.P arrow on the right place.

aslushnikov commented 8 years ago

I managed to build your document with some tweaks to the service. Here are the problems that arise:

  1. the latex-online doesn't know from which folder to build document, so it defaults to the root of the git repository. In your case, it should be the same folder as the target
  2. images img_* have to be built and committed to the repository separately

(1) might be solved with the relpath argument to the API; the (2) is unlikely.

ktzanev commented 8 years ago

My mistake : of course the images should be present as pdf in the repo ! So the missing images is not the problem.

Before latex-online was able to compile the document (without some images and with badly positioned one), now it throws an error saying that macros_M53.sty is missing, but it is as before present in the same folder.

And I can't find the description of relpath. Probably the default path should be set to the path of the target ?

aslushnikov commented 8 years ago

Before latex-online was able to compile the document (without some images and with badly positioned one), now it throws an error saying that macros_M53.sty is missing, but it is as before present in the same folder.

Yes, I switched from a very optimistic build system to the one which doesn't tolerate missing imports

Probably the default path should be set to the path of the target ?

Makes sense; let me fix this

aslushnikov commented 8 years ago

This is fixed with f20f05c72fcd91bff05e577f07aa8d10cffbcb57 Your link is now compiling successfully! :)

ktzanev commented 8 years ago

:+1: Fantastic ! Thanks.