Skip to content

simple tikz error causes latex build to hang with no easy way to kill running latex job (problem is that you can't easily kill it) #3783

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

Closed
DrXyzzy opened this issue Apr 26, 2019 · 4 comments · Fixed by #7722

Comments

@DrXyzzy
Copy link
Contributor

DrXyzzy commented Apr 26, 2019

Reported by Amanda Loudon.

  1. Create a .tex file with the following:
    \documentclass{article}
    \usepackage{tikz}
    \begin{document}
    \begin{tikzpicture}
    \draw (-1.5,0) -- (1.5,0);
    \draw (0,-1.5) -- (0,1.5);
    \end{tikzpicture}
    \end{document}
    
  2. Build the document and view the .pdf preview.
  3. Remove the semicolon from the end of the first \draw statement and Save or Build.
  4. Observe that the build process hangs, with the lower left build status pane showing a spinner and the message Running Latex... latexmk -pdf -f -g -bibtex -synctex=1 -interaction=nonstopmode tkx.tex.
  5. Clicking the trash can and Force Rebuild in the "Build Control and Log" panel in the lower right do not help (see if pdf preview is having trouble loading suggest trash and force rebuild #3560).
  6. Workaround: Correct the error by replacing the missing semicolon, then open a .term and run pkill pdflatex.
@haraldschilly
Copy link
Contributor

related: #3020

@williamstein
Copy link
Contributor

I think the solution to this is:

  • implement a stop button, which kills the currently running latex process.
  • bonus: show a progress bar with a timer that displays how long the latex job has been running

That's it. latex is a very complicated programming language and it's totally impossible to know whether latex is properly processing the document or stuck in some weird infinite loop that will never terminate. Also, often people do have large documents where latex takes a LONG time to process them (several minutes) so a uniform timeout is a non-starter. But a stop button makes perfect sense, just like there is a top button with Jupyter.

@haraldschilly would your brand new async execution functionality make it easy to solve this problem, finally!? #7686

@williamstein williamstein changed the title simple tikz error causes latex build to hang simple tikz error causes latex build to hang with no easy way to kill running latex job (problem is that you can't easily kill it) Jul 29, 2024
@williamstein
Copy link
Contributor

Note as part of this, there shouldn't be any timeout by default at all. Instead, just let the user explicitly kill their running latex if they give up on it, and make it very clear one is running.

@williamstein
Copy link
Contributor

Note -- this should also be sure to properly deal with multiple distinct clients trying to latex at the same time...

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

Successfully merging a pull request may close this issue.

3 participants