Skip to content

Commit 445ff9a

Browse files
authored
Merge pull request #11688 from albert-github/feature/bug_tblr_empty_label
Don't label an empty label as `_` with a table
2 parents ba922f4 + fcaa2fc commit 445ff9a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/latexdocvisitor.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1307,7 +1307,7 @@ void LatexDocVisitor::operator()(const DocHtmlTable &t)
13071307
m_t << "}";
13081308
// write label
13091309
m_t << "{";
1310-
if (c)
1310+
if (c && (!stripPath(c->file()).isEmpty() || !c->anchor().isEmpty()))
13111311
{
13121312
m_t << stripPath(c->file()) << "_" << c->anchor();
13131313
}

templates/latex/doxygen.sty

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,15 @@
373373
\NewDocumentEnvironment{DoxyTable}{m +m m m +b}{%
374374
\par%
375375
\def\hascaption{#2}%
376+
\def\haslabel{#3}%
376377
\ifx\hascaption\empty% if caption is empty
377378
\SetTblrOuter[longtblr]{theme=DoxyTableBareTheme}% table without caption or label
378379
\else% caption not empty
379-
\SetTblrOuter[longtblr]{theme=DoxyTableCaptionTheme,caption={#2},label={#3}}% set table caption and label
380+
\ifx\haslabel\empty% if label is empty
381+
\SetTblrOuter[longtblr]{theme=DoxyTableCaptionTheme,caption={#2}}% set table caption
382+
\else% label not empty
383+
\SetTblrOuter[longtblr]{theme=DoxyTableCaptionTheme,caption={#2},label={#3}}% set table caption and label
384+
\fi%
380385
\fi%
381386
\sbox0{% first render the table in a savebox to calculate the width of the table which will be stored in \wd0
382387
\begin{tblr}{hlines,vlines,measure=vbox,colspec={*{#1}{l}}}%
@@ -424,7 +429,7 @@
424429
% Arguments:
425430
% #1: Number of columns
426431
% #2: Initial format for tblr, i.e. format except for last column
427-
% #3: Title of the table ee.g. Params, Enumerator
432+
% #3: Title of the table e.g. Params, Enumerator
428433
% #4: Body
429434
\NewDocumentCommand{\DoxyParamTable}{m m +m +m}{%
430435
\SetTblrOuter[longtblr]{theme=DoxyTableBareTheme}% set table caption and label

0 commit comments

Comments
 (0)