notebook icon indicating copy to clipboard operation
notebook copied to clipboard

Fails to export to PDF via LaTeX with a table with LaTeX content

Open mbaudin47 opened this issue 3 years ago • 2 comments

Describe the bug The Jupyter Notebook fails to produce the PDF using LaTeX. The error is:

! Undefined control sequence.
\LT@array ->\global \let \caption@opt@@longtable 
                                                 \@undefined \def \captionse...
l.384 ...width - 2\tabcolsep) * \real{0.6000}}@{}}
                                                  
? 
! Emergency stop.
\LT@array ->\global \let \caption@opt@@longtable 
                                                 \@undefined \def \captionse...

This happens when a text cell contains a table which has LaTeX content.

To Reproduce Steps to reproduce the behavior:

  1. In Jupyter Notebook, convert a cell into text mode.
  2. Paste the following content:
| A |  B |
|----------|---------------|
|F| $Lognormal(\mu = 3 \times 10^4, \sigma = 9\times 10^3, shift=15\times 10^3)$ |
  1. Export to PDF via LaTeX.
  2. No PDF is produced, but an error message is shown.

Expected behavior The PDF should be produced.

Screenshots

image

image

Desktop (please complete the following information):

  • OS: Linux Debian 10
  • Browser Firefox
  • Version :
$ jupyter --version
Selected Jupyter core packages...
IPython          : 7.28.0
ipykernel        : 6.4.1
ipywidgets       : 7.6.5
jupyter_client   : 6.1.12
jupyter_core     : 4.8.1
jupyter_server   : 1.11.1
jupyterlab       : 3.1.18
nbclient         : 0.5.4
nbconvert        : 6.2.0
nbformat         : 5.1.3
notebook         : 6.4.4
qtconsole        : 5.1.1
traitlets        : 5.1.0

Please consider the exported .tex file:

Exercice-Sensibilite-SRC-cantilever-beam-Copy1.txt

The problem seems to be the LaTeX longtable environment.

mbaudin47 avatar Jan 18 '22 15:01 mbaudin47

  • Here is another case.

  • Failure

|||||||
|:-:|:-:|:-:|:-:|:-:|:-:|
|  Data Set Characteristics  |    Multivariate    |   Number of Instances   |         13611         |        Area        |     Computer      |
|  Data Set Characteristics  |    Multivariate    |   Number of Instances   |         13611         |        Area        |     Computera     |
  • Success by deleted a single letter.
|||||||
|:-:|:-:|:-:|:-:|:-:|:-:|
|  Data Set Characteristics  |    Multivariate    |   Number of Instances   |         13611         |        Area        |     Computer      |
|  Data Set Characteristics  |    Multivariate    |   Number of Instances   |         13611         |        Area        |     Computer     |

Matt-V50 avatar Apr 28 '22 09:04 Matt-V50

Attach tex file, explored by jupyter. def.tex

Matt-V50 avatar Apr 28 '22 09:04 Matt-V50