-
Notifications
You must be signed in to change notification settings - Fork 482
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 PDF output format with julia
code block.
#1119
Conversation
- Don't failed to generate PDF format with `julia` code block that contain `%`.(Fixes JuliaDocs#1118) - Don't eat the last line of `julia` code block.
Hmm, on my system at least this seems to break ```julia
1 % 2
1 ⊻ 2
1 | 2
``` becomes \begin{minted}[escapeinside=⊻⊻]{julia}
1 % 2
1 ⊻\unicodeveebar⊻ 2
1 | 2
\end{minted} as it should. But that renders as After having played around with this for a while, it seems that minted's escaping is pretty broken in general? Using This gist should reproduce it: https://gist.github.com/mortenpi/574735e33d0f2e9093681a45e37bfd80 As a general comment, I think, if we can, it would be better to have the same escaping logic for the |
I can't reproduce your problem. My LuaTeX version is 1.07.0, what about you? |
Right, I was wondering if it might be something like that. Mine is 1.0.4. But that's from the Ubuntu 18.04 repositories, so this will break things if we build with our current Docker image. |
What seems to work is to add this to \newfontfamily\unicodevbarfont{DejaVu Sans Mono}[Scale=MatchLowercase]
\newcommand\unicodevbar{{\unicodevbarfont ^^7c}} and then do the code blocks as follows: \begin{lstlisting}[escapeinside=||]
1 % 2
1 |\unicodeveebar| 2
1 |\unicodevbar| 2
\end{lstlisting}
\begin{minted}[escapeinside=||]{julia}
1 % 2
1 |\unicodeveebar| 2
1 |\unicodevbar| 2
\end{minted} Edit: should be DejaVu Sans Mono for this symbol. |
It is perfect! It would be better to let |
Hmm. Do you mean that minted isn't highlighting them properly at the moment because we're doing the LaTeX magic? |
Yes, they are darker. |
I guess that would need getting the correct font color, thicknes etc. for the minted internals and applying it manually? |
This may be the easiest way to do it, because lstlisting do not have the problem. |
Hey @mortenpi , Is there any blocking issue or concern to merge this PR? The building pipeline for the pdf version of the Julia Documentation in Chinese has been broken for months due to the problem described above. It would be great to see this PR get merged. |
I think it will still break the Docker image currently? |
Ok, it doesn't actually break the Docker image, but PDFs built with it do not render correctly at the moment: #1119 (comment). Swapping the implementation to #1119 (comment) should work around that I think? |
Hi @June-6th , can you confirm this works and make the change correspondingly?
I think when #979 gets resolved, this will not be a big problem. (At least it's not a big problem for us right now. Because we are using a customized docker image here) |
@findmyway Yes, it work well. |
julia
code block thatcontain
%
.(Fixes The julia code block contains character%
can not generate PDF format output. #1118)julia
code block.Before this PR:
After this PR: