-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
UTF8 characters in code blocks #963
Comments
This would be nice to support. Pandoc is converting code such as f(x) = π * x to \begin{Shaded}
\begin{Highlighting}[]
\NormalTok{f(x) }\OperatorTok{=}\NormalTok{ π }\OperatorTok{*}\NormalTok{ x}
\end{Highlighting}
\end{Shaded} This looks to be the same issue, solved using If you can find an acceptable solution using |
Thanks for the fast answer. Can you see, which packages are used for typesetting? I know either Shaded nor Highlighting as environments. The above examples are for use with |
Ah from the paper draft docker file it seems it might use edit but the latex template is too complicated for me, it seems it sometimes uses listings, but sometimes not – so if not I do not know what to do – and if it uses listings I do not know where to put new stuff. |
I see jlcode is not available through |
Indeed, I copied
The output looks acceptable. So the question for JOSS is really about adopting a new monospace font. I personally like DejaVu Sans Mono or its close relative Hack. Other strong competitors include JuliaCode and FiraCode. |
jlcode is indeed not available in can als also a little preliminary (I just added a few symbols back then), and the symbols are also only required for (pdf)latex, since then you do not necessarily have utf8 capabilities. That should work better with xelatex, and then you can also choose a nice font, yes :) My personal favourite is – I think – FiraCode, but JuliaCode is also nice, I do not know much about DejaVu Sans or Hack. |
This allows unicode in code blocks, as is especially popular in Julia submissions (openjournals/joss#963).
This allows unicode in code blocks, as is especially popular in Julia submissions (openjournals/joss#963). Cc: openjournals/whedon#105
This allows unicode in code blocks, as is especially popular in Julia submissions (openjournals/joss#963). Cc: openjournals/whedon#105
Hey I just wanted to report that I have a similar issue there lrnv/Copulas.jl#121 The paper is full of glitches from unicode not rendering correctly. Is a lot of latex characters do render correctly, there are several Julia-allowed ones that do not. In my particular case, I have: X₁ X₂ X₃ # Indices 1,2,3 do not render.
D̂ # the \hat does not render.
ϕ # \phi does simply not render.
ϕ⁽ᵈ⁾ # upper parenthesis are OK, but upper d is not (while upper 1 is OK) What can i do as a workaround right now ? It looks like the Hack font does not cover everything I need, is there an option to force usage of another user-suplied font (e.g; JuliaMono in my case) ? |
I tweaked There (with XeLaTeX) you can also easily use JuilaMono. |
Do you have a link on how to do that in current joss papers ? |
That would more be an issue how to tell that to pandoc I think; no I have not yet had the time (nor idea) to write a second JOSS paper and the first one 2021 I did with |
Ah see above in this thread, you can possibly hack the latex Header directly in the Markdown. |
Thanks @kellertuer, adding
to my header solves the issue perfectly. |
Note that JOSS uses lualatex, not xelatex (which is no longer active). Building this paper gives
Interestingly, all these characters render perfectly in my terminal (which uses Hack) and in the Hack playground, though I think both cases are due to OS font fallbacks since Stylistically, I find subscript numerals in variable names dubious, but that's a subjective choice JOSS need not make. OT for fonts, but on my mind reading this example: For languages that have standard formatters, I wonder if it should be applied. (For example, the Copulas |
In Julia code it is quite common to use UTF8 characters; the example I stumbled upon was just π but also the bold face ℝ and letters like that.
When writing a JOSS paper and using these within code, one gets an error, so for example when doing
The text was updated successfully, but these errors were encountered: