Skip to content

Commit 85ed0d2

Browse files
committed
Warnings in LaTeX output (2)
When looking at the doxygen PDF / LaTeX documentation we see warnings like: ``` LaTeX Warning: Command \underbar has changed. Check if current package is valid. LaTeX Warning: Command \underline has changed. Check if current package is valid. ``` this is due to the `sectsty` package (looks like to be unmaintained), we only use from this package the `allsectionsfont`, included relevant part in doxygen and renamed parts. ``` Package newunicodechar Warning: Redefining Unicode character ``` We want to (re)define some unicode characters, so taking the relevant part from the package `newunicodechar` and created the command `doxynewunicodechar` without the warning (had to be done in latexgen.cpp as the code is used in the formulas and the "normal" output). ``` LaTeX Warning: Command \LT@p@ftntext has changed. Check if current package is valid. ``` the `longtable` package as used by doxygen missed a small update that prevented this warning. ``` Package textcomp Warning: Symbol \textasciidieresis not provided by (textcomp) font family phv in TS1 encoding ``` redefining the "pure" umlaut character in more "native" LaTeX
1 parent 367e7b3 commit 85ed0d2

File tree

8 files changed

+64
-12
lines changed

8 files changed

+64
-12
lines changed

doc/doxygen_manual.tex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
\usepackage{mathptmx}
6363
\usepackage[scaled=.90]{helvet}
6464
\usepackage{courier}
65-
\usepackage{sectsty}
6665
\usepackage[titles]{tocloft}
6766
\usepackage{amssymb}
6867
\usepackage{doxygen}

doc/manual.sty

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
% Use helvetica font instead of times roman
22
\RequirePackage{helvet}
3-
\RequirePackage{sectsty}
43
\RequirePackage{tocloft}
54
\providecommand{\rmdefault}{phv}
65
\providecommand{\bfdefault}{bc}

src/htmlentity.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ static const std::vector<HtmlEntityInfo> g_htmlEntities
5252
{ SYM(yen), "\xc2\xa5", "&yen;", "<yen/>", "&#165;", "{$\\yen$}", NULL, "\\'A5", { NULL, HtmlEntityMapper::Perl_unknown }},
5353
{ SYM(brvbar), "\xc2\xa6", "&brvbar;", "<brvbar/>", "&#166;", "\\textbrokenbar{}", NULL, "\\'A6", { NULL, HtmlEntityMapper::Perl_unknown }},
5454
{ SYM(sect), "\xc2\xa7", "&sect;", "<sect/>", "<simplesect/>", "{$\\S$}", NULL, "\\'A7", { "sect", HtmlEntityMapper::Perl_symbol }},
55-
{ SYM(uml), "\xc2\xa8", "&uml;", "<umlaut/>", "&#168;", "\\textasciidieresis{}", " \\*(4", "\\'A8", { " ", HtmlEntityMapper::Perl_umlaut }},
55+
{ SYM(uml), "\xc2\xa8", "&uml;", "<umlaut/>", "&#168;", "\\\"{ }", " \\*(4", "\\'A8", { " ", HtmlEntityMapper::Perl_umlaut }},
5656
{ SYM(copy), "\xc2\xa9", "&copy;", "<copy/>", "&#169;", "\\copyright{}", "(C)", "\\'A9", { "copyright", HtmlEntityMapper::Perl_symbol }},
5757
{ SYM(ordf), "\xc2\xaa", "&ordf;", "<ordf/>", "&#170;", "\\textordfeminine{}", NULL, "\\'AA", { NULL, HtmlEntityMapper::Perl_unknown }},
5858
{ SYM(laquo), "\xc2\xab", "&laquo;", "<laquo/>", "&#171;", "\\guillemotleft{}", NULL, "\\'AB", { NULL, HtmlEntityMapper::Perl_unknown }},

src/latexgen.cpp

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2172,10 +2172,28 @@ void writeLatexSpecialFormulaChars(TextStream &t)
21722172
sup3[1]= 0xB3;
21732173
sup3[2]= 0;
21742174

2175-
t << "\\usepackage{newunicodechar}\n"
2176-
" \\newunicodechar{" << minus << "}{${}^{-}$}% Superscript minus\n"
2177-
" \\newunicodechar{" << sup2 << "}{${}^{2}$}% Superscript two\n"
2178-
" \\newunicodechar{" << sup3 << "}{${}^{3}$}% Superscript three\n"
2175+
t << "\\usepackage{newunicodechar}\n";
2176+
// taken from the newunicodechar package and removed the warning message
2177+
// actually forcing to redefine the unicode character
2178+
t << " \\makeatletter\n"
2179+
" \\def\\doxynewunicodechar#1#2{%\n"
2180+
" \\@tempswafalse\n"
2181+
" \\edef\\nuc@tempa{\\detokenize{#1}}%\n"
2182+
" \\if\\relax\\nuc@tempa\\relax\n"
2183+
" \\nuc@emptyargerr\n"
2184+
" \\else\n"
2185+
" \\edef\\@tempb{\\expandafter\\@car\\nuc@tempa\\@nil}%\n"
2186+
" \\nuc@check\n"
2187+
" \\if@tempswa\n"
2188+
" \\@namedef{u8:\\nuc@tempa}{#2}%\n"
2189+
" \\fi\n"
2190+
" \\fi\n"
2191+
" }\n"
2192+
" \\makeatother\n";
2193+
2194+
t << " \\doxynewunicodechar{" << minus << "}{${}^{-}$}% Superscript minus\n"
2195+
" \\doxynewunicodechar{" << sup2 << "}{${}^{2}$}% Superscript two\n"
2196+
" \\doxynewunicodechar{" << sup3 << "}{${}^{3}$}% Superscript three\n"
21792197
"\n";
21802198
}
21812199

templates/latex/doxygen.sty

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,36 @@
604604
{1.5ex \@plus .2ex}%
605605
{\raggedright\normalfont\normalsize\bfseries}}
606606
\makeatother
607+
% the sectsty doesn't look to be maintained but gives, in our case, some warning like:
608+
% LaTeX Warning: Command \underline has changed.
609+
% Check if current package is valid.
610+
% unfortunately had to copy the relevant part
611+
\newcommand*{\doxypartfont} [1]
612+
{\gdef\SS@partnumberfont{\SS@sectid{0}\SS@nopart\SS@makeulinepartchap#1}
613+
\gdef\SS@parttitlefont{\SS@sectid{0}\SS@titlepart\SS@makeulinepartchap#1}}
614+
\newcommand*{\doxychapterfont} [1]
615+
{\gdef\SS@chapnumfont{\SS@sectid{1}\SS@nopart\SS@makeulinepartchap#1}
616+
\gdef\SS@chaptitlefont{\SS@sectid{1}\SS@titlepart\SS@makeulinepartchap#1}}
617+
\newcommand*{\doxysectionfont} [1]
618+
{\gdef\SS@sectfont{\SS@sectid{2}\SS@rr\SS@makeulinesect#1}}
619+
\newcommand*{\doxysubsectionfont} [1]
620+
{\gdef\SS@subsectfont{\SS@sectid{3}\SS@rr\SS@makeulinesect#1}}
621+
\newcommand*{\doxysubsubsectionfont} [1]
622+
{\gdef\SS@subsubsectfont{\SS@sectid{4}\SS@rr\SS@makeulinesect#1}}
623+
\newcommand*{\doxyparagraphfont} [1]
624+
{\gdef\SS@parafont{\SS@sectid{5}\SS@rr\SS@makeulinesect#1}}
625+
\newcommand*{\doxysubparagraphfont} [1]
626+
{\gdef\SS@subparafont{\SS@sectid{6}\SS@rr\SS@makeulinesect#1}}
627+
\newcommand*{\doxyminisecfont} [1]
628+
{\gdef\SS@minisecfont{\SS@sectid{7}\SS@rr\SS@makeulinepartchap#1}}
629+
\newcommand*{\doxyallsectionsfont} [1] {\doxypartfont{#1}%
630+
\doxychapterfont{#1}%
631+
\doxysectionfont{#1}%
632+
\doxysubsectionfont{#1}%
633+
\doxysubsubsectionfont{#1}%
634+
\doxyparagraphfont{#1}%
635+
\doxysubparagraphfont{#1}%
636+
\doxyminisecfont{#1}}%
607637
% Define caption that is also suitable in a table
608638
\makeatletter
609639
\def\doxyfigcaption{%

templates/latex/header.tex

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,7 @@
5656
% set main and monospaced font
5757
$latexfont
5858
59-
\usepackage{sectsty}
60-
\allsectionsfont{%
59+
\doxyallsectionsfont{%
6160
\fontseries{bc}\selectfont%
6261
\color{darkgray}%
6362
}

templates/latex/latexrefman.tpl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@
3030
\usepackage[scaled=.90]{helvet}
3131
\usepackage{courier}
3232
\usepackage{amssymb}
33-
\usepackage{sectsty}
3433
\renewcommand{\familydefault}{\sfdefault}
35-
\allsectionsfont{
34+
\doxyallsectionsfont{
3635
\fontseries{bc}\selectfont
3736
\color{darkgray}
3837
}

templates/latex/longtable_doxygen.sty

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,15 @@
438438
\the\LT@p@ftn
439439
\global\LT@p@ftn{}%
440440
\hfil}
441-
\def\LT@p@ftntext#1{%
441+
%% added \long to prevent:
442+
% LaTeX Warning: Command \LT@p@ftntext has changed.
443+
%
444+
% from the original repository (https://github.com/latex3/latex2e/blob/develop/required/tools/longtable.dtx):
445+
% \changes{v4.15}{2021/03/28}
446+
% {make long for gh/364}
447+
% Inside the `p' column, just save up the footnote text in a token
448+
% register.
449+
\long\def\LT@p@ftntext#1{%
442450
\edef\@tempa{\the\LT@p@ftn\noexpand\footnotetext[\the\c@footnote]}%
443451
\global\LT@p@ftn\expandafter{\@tempa{#1}}}%
444452

0 commit comments

Comments
 (0)