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

Fix LaTeX exporting '?' for non-ascii title #1039

Merged
merged 1 commit into from
May 30, 2019
Merged

Fix LaTeX exporting '?' for non-ascii title #1039

merged 1 commit into from
May 30, 2019

Conversation

imtsuki
Copy link
Contributor

@imtsuki imtsuki commented May 30, 2019

I have the same issue with #786 . When I tried to export a PDF file from a notebook that has a non-ascii title (which is the notebook's file name), the output is just '????':

螢幕快照 2019-05-30 17 26 26

I discovered that it was not a XeLaTeX problem; I use ctex package to support non-ascii rendering (You can see them in the date under the title), but the title is still '???'. I tried to directly export .tex source file instead, and it turned out that nbconvert itself produces '\title{????}' for title while other non-ascii characters in the document body is fine.

In nbconvert/templates/latex/base.tplx, I found this line confusing:

\title{((( nb_title | ascii_only | escape_latex )))}

I have no idea what ascii_only is for, and deleting this is supposed to make sense.

螢幕快照 2019-05-30 17 29 46

@t-makaro
Copy link
Contributor

t-makaro commented May 30, 2019

LGTM! I think ascii_only is a remnant from before we were using XeLaTeX. I will merge once tests pass. The failures look unrelated.

Also, thanks for the tip on ctex. Are you just using a custom template to add \usepackage{ctex}?

@imtsuki
Copy link
Contributor Author

imtsuki commented May 30, 2019

Yeah, I added that line to article.tplx for my own use, and it only supports CJK characters (as far as I know).

@t-makaro t-makaro merged commit a68ff94 into jupyter:master May 30, 2019
@MSeal MSeal added this to the 5.6 milestone Jul 30, 2019
@meeseeksmachine
Copy link

This pull request has been mentioned on Jupyter Community Forum. There might be relevant details there:

https://discourse.jupyter.org/t/nbconvert-5-6-0-release/1867/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants