Open DonCammne opened 8 months ago
Yeah, this has been something that has bothered me for a long time.
The short answer is that it is a problem with the render to PDF engine and I am unsure how to fix it.
It seems to happen both when rendering to HTML in the browser and apparently in LaTeX, as shown by your example.
I have two strategies for managing this in my own calcs:
In an earlier version of handcalcs, I used the /gather environment for the long calcs. However, because this environment was not supported by Katex (at the time, anyway), I switched away from it. The gather environment gives a liiiitle bit of extra room on the line.
For HTML rendering this is an upstream issue for Katex and MathJax to address. In LaTeX, additional layout code or macros would need to be added to the document in order to correct it (I think...).
Thank you very much for the exhaustive response, very appreciated.
I will probably divide in parts the long calculation (which are a few, so not a big deal), it is a solution nonetheless, so thank you again.
Problem: If the output of a cell created with handcalcs is too long, the pdf just truncates it.
I tried to pinpoint where the problem originates, in order to plan a solution, but I don't understand if I can set up correctly handcals, because the creation of the pdf (performed by nbconvert) seems to be limited by the source (thus the NOTEBOOK.ipynb).
I'm sure that I'm not the first person to encounter a truncated line in the pdf, so how do you solve this problem?
More details: I'm on linux (Arch) and I use a simple command line to create the html (then printed in pdf in the browser) or directly the pdf:
jupyter nbconvert --to html/pdf --no-input NOTEBOOK.ipynb
This procedure should be the same of using JupyterLab.
Here are some images to ease the explanation:
Image 1. The cell in vscode with a long line
Image 2. The html file (converted from the notebook)
Image 3. The pdf converted from the html using "Print to pdf" (NB: some lines are not complete)
Image 4. The pdf file (converted from the notebook) (NB: some lines are not complete)
Code: And here's the code of the example for replicating the problem: Cell 1:
Cell 2:
Cell 3: