Correct order of packages for unicode in nbconvert to LaTeX#4806
Merged
Conversation
minrk
added a commit
that referenced
this pull request
Jan 16, 2014
Correct order of packages for unicode in nbconvert to LaTeX
mattvonrocketstein
pushed a commit
to mattvonrocketstein/ipython
that referenced
this pull request
Nov 3, 2014
Correct order of packages for unicode in nbconvert to LaTeX
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ucs and inputenc latex packages set the converted notebook up for unicode support. However, the wrong option (utf8, should be utf8x) is given to the inputenc package and the ucs package should be loaded before inputenc. The relevant part of the pdflatex log from "ipython nbconvert --to latex notebook.ipynb; pdflatex notebook.ipynb" is:
(/usr/local/texlive/2013/texmf-dist/tex/latex/ucs/ucsencs.def)
Package ucs Warning: ***************************
(ucs) You seem to have loaded inputencoding utf8
(ucs) (LaTeX kernel UTF-8) instead of utf8x (ucs.sty UTF-8).
(ucs) Probably you are compiling a document written for a
(ucs) pre-august-2004 ucs.sty.
(ucs) ***************************
(ucs) Please use \usepackage[utf8x]{inputenc} instead of
(ucs) \usepackage[utf8]{inputenc}.
(ucs) ***************************
(ucs) If you should really want to use ucs.sty and kernel's
(ucs) utf8.def together, use \usepackage[utf8x,utf8]{inputenc}
(ucs) to disable compatibility mode
(ucs) ***************************
(ucs) Activating compatibility mode.
(ucs) ***************************
(ucs) on input line 213.
(/usr/local/texlive/2013/texmf-dist/tex/latex/ucs/utf8x.def)
This tiny patch uses the utf8x option and gets the package order right. More information about ucs from "texdoc ucs".