Skip to content
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

Multiple line Latex output of code cells rendering all on one line. #204

Closed
Carreau opened this issue Mar 12, 2015 · 3 comments
Closed

Multiple line Latex output of code cells rendering all on one line. #204

Carreau opened this issue Mar 12, 2015 · 3 comments
Labels
format:LaTeX pertains to exporting to the LaTeX format

Comments

@Carreau
Copy link
Member

Carreau commented Mar 12, 2015

@damontallen opened ipython/ipython#8026

As an example this notebook renders correctly in nbviewer and in the live notebook but when it is converted to Latex the cell output is forced to one line (pdf output). I've traced the problem to the addition of adjustbox to equation output. According to the documentation at ftp://ftp.dante.de/tex-archive/macros/latex/contrib/adjustbox/adjustbox.pdf (section 4.10, page 20) minipage must be used with adjustbox to allow for the use of linebreaks - "This allows for line breaks and footnotes in the adjustbox ."

Adjustbox was implemented in PR ipython/ipython#5694 to limit equations to page width but instead of using "max width" it should be minipage (line 164 of IPython/nbconvert/templates/latex/base.tplx). However there needs to be an additional addition of '' for ever newline in an equation's output and I don't know where that needs to be added. This also changes the behaviour of the rendering of the equation from centered to left justified even when '$$' was used. I don't know how to fix this.

@Carreau
Copy link
Member Author

Carreau commented Mar 12, 2015

@minrk commented

Thanks for the detailed explanation. Hopefully we can find a fix. It might be that we should back off adjustbox if the new bug is worse than the prior one.

@mpacer
Copy link
Member

mpacer commented Jun 29, 2017

Errors like this should already be closed. But if you used \\[ or \\( in a IPython.display.Markdown #617 will fix it.

@mpacer mpacer closed this as completed Jun 29, 2017
@daishi
Copy link

daishi commented Aug 15, 2017

It's not clear to me that this is (fully) fixed.
Though these are for Markdown cells, see:

https://gist.github.com/daishi/4111aca22a2b75bc61713e1ae08714f9

vs

https://gist.github.com/daishi/bc186df5eedf650a7e791a873ce5c668

It appears that a prefix of regular text causes an issue with the pdf renderer.

(Neither has an issue as a regular notebook).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format:LaTeX pertains to exporting to the LaTeX format
Projects
None yet
Development

No branches or pull requests

4 participants