question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not able to generate the whole book using latexpdf

See original GitHub issue

Describe the bug

context I’m trying to build a pdf using latex by running

jupyter-book build mybookname/ --builder pdflatex

expectation I expected a pdf of the whole book

bug But I’m getting only the first two sections of the first chapter. Here is what I get when building, it appears to have problems with cross-references? I’m not sure.

Latexmk: Summary of warnings from last run of *latex:
  Latex failed to resolve 6 reference(s)
Latexmk: ====List of undefined refs and citations:
  Reference `capitulos/marco-teorico/reconstruccion-jets:jets' on page 3 undefined on input line 210
  Reference `capitulos/marco-teorico/mas-alla-del-ms:bsm' on page 3 undefined on input line 210
  Reference `capitulos/marco-teorico/aprendizaje-automatico:ml' on page 3 undefined on input line 210
  Reference `capitulos/marco-teorico/reproducibilidad:rpd' on page 3 undefined on input line 210
  Reference `capitulos/marco-teorico/reconstruccion-jets:jets-desarrollo' on page 9 undefined on input line 364
  Reference `capitulos/marco-teorico/reconstruccion-jets:jets-qcd' on page 9 undefined on input line 367
Latexmk: Errors, so I did not complete making targets
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 1
      Refer to 'python.log' for details
Latexmk: If appropriate, the -f option can be used to get latexmk
  to try to force complete processing.
Reverting Windows console CPs to (in,out) = (850,850)
C:\texlive\2022\bin\win32\runscript.tlu:915: command failed with exit code 12:
perl.exe c:\texlive\2022\texmf-dist\scripts\latexmk\latexmk.pl -pdf -dvi- -ps-  python.tex

I uploaded all I get in the console here problem This is a problem for people trying to get a latex pdf from their books.

Reproduce the bug

  1. Clone https://github.com/marianaiv/tesis_grado_UCV/tree/marco-teorico to your computer
  2. Go to the file. From the command line would be
cd path_where_cloned/tesis_grado_UCV
  1. Build the pdf using
jupyter-book build tesis --builder latexpdf

List your environment

>jupyter-book --version
Jupyter Book      : 0.12.2
External ToC      : 0.2.4
MyST-Parser       : 0.15.2
MyST-NB           : 0.13.2
Sphinx Book Theme : 0.1.10
Jupyter-Cache     : 0.4.3
NbClient          : 0.5.4
  • Python 3.7.4
  • Windows 10
  • TeX 3.141592653 (TeX Live 2022), kpathsea version 6.3.4

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:13 (7 by maintainers)

github_iconTop GitHub Comments

4reactions
michaelosthegecommented, May 8, 2022
0reactions
phockettcommented, Nov 29, 2022

Just ran into this one too, specifically for the captions in the {glue:figure} case.

The fix at https://github.com/mcmtroffaes/sphinxcontrib-bibtex/issues/276#issuecomment-1102154800 worked for me (thanks @michaelosthege for pointing in that direction!), i.e. adding the following to the preamble (via my _config.yml):

sphinx:
  config:
      preamble: |+
		% Fix citations in figure captions, from https://github.com/mcmtroffaes/sphinxcontrib-bibtex/issues/276#issuecomment-1102154800
        \usepackage{etoolbox}
        \AtBeginEnvironment{figure}{\pretocmd{\hyperlink}{\protect}{}{}}  

Citations in captions then seem to work without triggering latex build issues.

(I also tested the fix at https://sphinxcontrib-bibtex.readthedocs.io/en/latest/usage.html#latex-backend-fails-with-citations-in-figure-captions, but that didn’t work for me (maybe a Sphinx version thing).)

> jupyter-book --version
Jupyter Book      : 0.13.1
External ToC      : 0.2.4
MyST-Parser       : 0.15.2
MyST-NB           : 0.13.2
Sphinx Book Theme : 0.3.3
Jupyter-Cache     : 0.4.3
NbClient          : 0.5.4

Sphinx 4.5.0 Python 3.9.7

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create individual chapter PDFs from included TeXs?
I am using \include command to create a one big PDF file, the output is MainTex.pdf . Life is all good up to...
Read more >
Creating high-quality PDF/A documents using LaTeX
Creating high-quality PDF/A documents using LaTeX. This document provides step-by-step instructions for generating valid PDF/A from LaTeX sources.
Read more >
[PDF] LaTeX - Beginner's Guide
out by creating an example book. By doing this, you will get familiar with using document templates, finally being able to write our...
Read more >
Problems with Building and Viewing PDF Files from LaTeX
At the moment, I am trying to get started with LaTeX but encountered ... fact, I do have another laptop with Linux and...
Read more >
R Markdown doesn't create pdf file ("Latex failed to compile ...")
Hi all, I am a beginner at R. I am trying to knit R Markdown to PDF ... Local\Programs\MiKTeX\miktex\bin\x64\pdflatex.exe did not succeed.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found