-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 #10147 Generating pdf with LuaLateX
#10150
base: master
Are you sure you want to change the base?
Conversation
templates/latex/etoc_doxygen.sty
Outdated
\etocruledstyle[#1]{#2}% | ||
[O \tableofcontents*} | ||
\etocruledstyle[#1]{#2}% | ||
\tableofcontents*} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should indeed be fixed, and probably also be reported upstream (seen the copyright notice), I will check this. The spaces should stay (as they are from the original.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already send a notice to upstream through issue #9936
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made PR #10171 which incorporates the removal of the stray bytes. I don't know where these bytes come from as they were not found upstream...
I did a quick test wit the example (example.tar.gz):
With pdflatex I get: With lualatex / xelatex I get: so we see that the minus sign is missing. Versions:
Note:
but I don't think they are influencing the behavior of the minus sign. |
I guess it's a font problem. I will do some checks. Do you know what is the codepoint you insert for the I know Doxygen is loading some font in other places but I didn't found where :(. I think if this packages are removed on lualatex and xetex this should work |
Some hacks that seems to work : \ifpdftex
\doxynewunicodechar{⁰}{${}^{0}$}% Superscript zero
\doxynewunicodechar{ⁱ}{${}^{1}$}% Superscript one
\doxynewunicodechar{²}{${}^{2}$}% Superscript two
\doxynewunicodechar{³}{${}^{3}$}% Superscript three
\doxynewunicodechar{⁴}{${}^{4}$}% Superscript four
\doxynewunicodechar{⁵}{${}^{5}$}% Superscript five
\doxynewunicodechar{⁶}{${}^{6}$}% Superscript six
\doxynewunicodechar{⁷}{${}^{7}$}% Superscript seven
\doxynewunicodechar{⁸}{${}^{8}$}% Superscript eight
\doxynewunicodechar{⁹}{${}^{9}$}% Superscript nine
\doxynewunicodechar{⁻}{${}^{-}$}% Superscript minus
\doxynewunicodechar{⁺}{${}^{+}$}% Superscript plus
\doxynewunicodechar{ⁱ}{${}^{i}$}% Superscript i
\doxynewunicodechar{⁽}{${}^{(}$}% Superscript (
\doxynewunicodechar{⁾}{${}^{)}$}% Superscript )
\doxynewunicodechar{ⁿ}{${}^{n}$}% Superscript n
\else
\usepackage{combofont}
\defaultfontfeatures{Scale=MatchLowercase}
\setupcombofont{rm-regular}
{
{file:lmroman10-regular.otf:\combodefaultfeat} at #1pt,
{file:STIXTwoMath-Regular.otf} at #1pt
}
{
{} ,
fallback
}
\setupcombofont{rm-bold}
{
{file:lmroman10-bold.otf:\combodefaultfeat} at #1pt,
{file:STIXTwoMath-Regular.otf} at #1pt
}
{
{} ,
fallback
}
\setupcombofont{rm-italic}
{
{file:lmroman10-bold.otf:\combodefaultfeat} at #1pt,
{file:STIXTwoMath-Regular.otf} at #1pt
}
{
{} ,
fallback
}
\setupcombofont{tt-regular}
{
{file:lmmono10-regular.otf:\combodefaultfeat} at #1pt,
{file:STIXTwoMath-Regular.otf} at #1pt
}
{
{} ,
fallback
}
\setupcombofont{tt-bold}
{
{file:lmmonolt10-bold.otf:\combodefaultfeat} at #1pt,
{file:STIXTwoMath-Regular.otf} at #1pt
}
{
{} ,
fallback
}
\setupcombofont{tt-italic}
{
{file:lmmono10-italic.otf:\combodefaultfeat} at #1pt,
{file:STIXTwoMath-Regular.otf} at #1pt
}
{
{} ,
fallback
}
\setupcombofont{sf-regular}
{
{file:lmsans10-regular.otf:\combodefaultfeat} at #1pt,
{file:STIXTwoMath-Regular.otf} at #1pt
}
{
{} ,
fallback
}
\setupcombofont{sf-bold}
{
{file:lmsans10-bold.otf:\combodefaultfeat} at #1pt,
{file:STIXTwoMath-Regular.otf} at #1pt
}
{
{} ,
fallback
}
\setupcombofont{sf-italic}
{
{file:lmsans10-oblique.otf:\combodefaultfeat} at #1pt,
{file:STIXTwoMath-Regular.otf} at #1pt
}
{
{} ,
fallback
}
\DeclareFontFamily{TU}{doxygen-rm}{}
\DeclareFontShape {TU}{doxygen-rm}{m}{n} {<->combo*rm-regular}{}
\DeclareFontShape {TU}{doxygen-rm}{m}{it} {<->combo*rm-italic}{}
\DeclareFontShape {TU}{doxygen-rm}{b}{n}{<->combo*rm-bold}{}
\DeclareFontFamily{TU}{doxygen-tt}{}
\DeclareFontShape {TU}{doxygen-tt}{m}{n} {<->combo*tt-regular}{}
\DeclareFontShape {TU}{doxygen-tt}{m}{it} {<->combo*tt-italic}{}
\DeclareFontShape {TU}{doxygen-tt}{b}{n}{<->combo*tt-bold}{}
\DeclareFontFamily{TU}{doxygen-sf}{}
\DeclareFontShape {TU}{doxygen-sf}{m}{n} {<->combo*sf-regular}{}
\DeclareFontShape {TU}{doxygen-sf}{m}{it} {<->combo*sf-italic}{}
\DeclareFontShape {TU}{doxygen-sf}{b}{n}{<->combo*sf-bold}{}
\renewcommand{\rmdefault}{doxygen-rm}
\renewcommand{\sfdefault}{doxygen-sf}
\renewcommand{\ttdefault}{doxygen-tt}
\setmathfont{STIXTwoMath-Regular.otf}
\fi
doxygen could maybe add very used symbol like this : https://github.com/Christoph-D/latex-unicode-math-mode/blob/master/unicode-math-mode.sty and maybe this one too (I'm biased because this is crashing with my code :) ) : https://www.compart.com/en/unicode/block/U+2500 Maybe to put this in a specific .tex to increase from time to time
The problem was unicode-math doesn't detect them because the text is not in math mode. I add a fallback to the fonts Pdflatex: |
In general I think we should think about the possibility to make lualatex (or xelatex) the default latex engine so we can incorporate the unicode characters (@doxygen what is you opinion on that). |
@albert-github doxygen.sty load some fonts as you mentioned. Indeed the superscript equal sign , 207C is missing, this is more a pseudo-code (that why I didn't pushed on the code directly to have opinion on this hack). |
Did you try to run the doxygen tests locally with lualatex/xelatex?
|
Regarding:
It looks like this is not an official CTAN package so, I think, adding it directly to doxygen is not a good idea, though a user can always add it by means of |
Yes, I generated the doxygen ref.tex on my problematic file and then modified it by hands. |
Doxygen could provide its own version. |
Regarding #10150 (comment)
that is true but where to stop / what to include, you mentioned the U+2500 block (which is quite a general block though) but other might like to use another block (like the ones after U+2010 or the ones after U+203B). |
True, In fact I thought the inputenc what doing this things for us. I switch to lualatex long time ago :) But some people need to compile with pdflatatex for good or bad reason. I agree but doxygen could provide the minimum ones (math+ greek symbols + Diacritics). This would not solve the problem with chinese for example. With the lualatex hack it could be possible to add font for that need by default. |
Would you accept this hack, or would like to find an other alternative? |
@albert-github Maybe this packages would solve some problems |
No description provided.