Skip to content

Conversation

@mmcky
Copy link
Member

@mmcky mmcky commented Aug 21, 2020

This PR updates config to enable build of pdf files

@mmcky mmcky requested a review from AakashGfude August 21, 2020 00:41
@mmcky
Copy link
Member Author

mmcky commented Aug 21, 2020

@AakashGfude it looks like the preamble components aren't getting transfered to sphinx via jupyter-book. Would you mind to checkout this PR and confirm on your end.

latex:
  latex_engine                : 'xelatex'
  latex_documents:
    targetname                : book.tex
  latex_elements:
    preamble                  : '\usepackage[utf8x,utf8]{inputenc}'

I think you're correct in that the basic pdf preamble doesn't include the correct packages so we will need to pass through some packages via the preamble option. My current xelatex build error is:

! Text line contains an invalid character.
l.9356 ...cher.py:10: NumbaDeprecationWarning: ^^[
                                                  {[}1mThe 'numba.jitclass' ...

@mmcky
Copy link
Member Author

mmcky commented Aug 21, 2020

@AakashGfude it seems to be an issue with xelatex on this line of tex

\begin{sphinxalltt}
/Users/matthewmckay/anaconda3/envs/ebp/lib/python3.7/site\sphinxhyphen{}packages/ipykernel\_launcher.py:10: NumbaDeprecationWarning: �{[}1mThe 'numba.jitclass' decorator has moved to 'numba.experimental.jitclass' to better reflect the experimental nature of the functionality. Please update your imports to accommodate this change and see http://numba.pydata.org/numba\sphinxhyphen{}doc/latest/reference/deprecation.html\#change\sphinxhyphen{}of\sphinxhyphen{}jitclass\sphinxhyphen{}location for the time frame.�{[}0m
  \# Remove the CWD from sys.path while we load stuff.

\end{sphinxalltt}

I think the culprit is ' character that is being added in this code output
Nope a ' is valid latex

If I comment that block out -- xelatex builds just fine.

@mmcky
Copy link
Member Author

mmcky commented Aug 21, 2020

Its the only occurrence of sphinxalltt in the whole build

% now for the modified alltt environment
\newenvironment{sphinxalltt}
{% at start of next line to workaround Emacs/AUCTeX issue with this file
\begin{alltt}%
 \ifspx@opt@parsedliteralwraps
   \sbox\sphinxcontinuationbox {\spx@opt@verbatimcontinued}%
   \sbox\sphinxvisiblespacebox {\spx@opt@verbatimvisiblespace}%
   \sphinxbreaksattexescapedchars
   \sphinxbreaksviaactiveinparsedliteral
   \sphinxbreaksatspaceinparsedliteral
% alltt takes care of the ' as derivative ("prime") in math mode
   \everymath\expandafter{\the\everymath\sphinxunactivateextrasandspace
             \catcode`\<=12\catcode`\>=12\catcode`\^=7\catcode`\_=8 }%
% not sure if displayed math (align,...) can end up in parsed-literal, anyway
   \everydisplay\expandafter{\the\everydisplay
             \catcode13=5 \sphinxunactivateextrasandspace
             \catcode`\<=12\catcode`\>=12\catcode`\^=7\catcode`\_=8 }%
 \fi }
{\end{alltt}}

@mmcky
Copy link
Member Author

mmcky commented Aug 24, 2020

This isn't building because of ansi escape characters -- will open a new issue.

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.

2 participants