|
349 | 349 | \end{DoxyDesc}%
|
350 | 350 | }
|
351 | 351 |
|
352 |
| -% define a theme for the DoxyTable environment |
353 |
| -\NewTblrTheme{DoxyTableTheme}{ |
| 352 | +% define a theme for the DoxyTable environment (without caption) |
| 353 | +\NewTblrTheme{DoxyTableBareTheme}{ |
| 354 | + \DefTblrTemplate{firsthead}{default}{}% |
| 355 | + \DefTblrTemplate{middlehead, lasthead}{default}{}% |
| 356 | + \DefTblrTemplate{contfoot-text}{default}{}% |
| 357 | +} |
| 358 | + |
| 359 | +% define a theme for the DoxyTable environment (with caption) |
| 360 | +\NewTblrTheme{DoxyTableCaptionTheme}{ |
354 | 361 | \SetTblrStyle{firsthead}{font=\bfseries}{}%
|
355 | 362 | \DefTblrTemplate{middlehead, lasthead}{default}{}%
|
356 | 363 | \DefTblrTemplate{contfoot-text}{default}{}%
|
|
365 | 372 | % - #5: body of the table (part between start{DoxyTable}..\end{DoxyTable}
|
366 | 373 | \NewDocumentEnvironment{DoxyTable}{m +m m m +b}{%
|
367 | 374 | \par%
|
368 |
| -\SetTblrOuter[longtblr]{theme=DoxyTableTheme,caption={#2},label={#3}}% set table caption and label |
| 375 | +\def\hascaption{#2}% |
| 376 | +\ifx\hascaption\empty% if caption is empty |
| 377 | + \SetTblrOuter[longtblr]{theme=DoxyTableBareTheme}% table without caption or label |
| 378 | +\else% caption not empty |
| 379 | + \SetTblrOuter[longtblr]{theme=DoxyTableCaptionTheme,caption={#2},label={#3}}% set table caption and label |
| 380 | +\fi% |
369 | 381 | \sbox0{% first render the table in a savebox to calculate the width of the table which will be stored in \wd0
|
370 | 382 | \begin{tblr}{hlines,vlines,measure=vbox,colspec={*{#1}{l}}}%
|
371 | 383 | #5
|
|
380 | 392 | measure=vbox,% needed to allow nested lists and tables
|
381 | 393 | colspec={*{#1}{\DoxyTableColSpec}},% set column type for all columns
|
382 | 394 | rowhead=#4,% set which row is the header (0=disable, 1=enable)
|
383 |
| - row{#4}={bg=\tableheadbgcolor}}% set header background color |
| 395 | + row{#4}={bg=\tableheadbgcolor,font=\noexpand\bfseries}}% set header background color and font weight |
384 | 396 | % now render the table for real
|
385 | 397 | \ExpandArgs{nV}\begin{longtblr}\DoxyTableOptions%
|
386 | 398 | #5
|
|
404 | 416 | \end{tblr}
|
405 | 417 | }%
|
406 | 418 |
|
407 |
| -\NewTblrTheme{DoxyParamTableTheme}{ |
408 |
| - \DefTblrTemplate{firsthead}{default}{}% |
409 |
| - \DefTblrTemplate{middlehead, lasthead}{default}{}% |
410 |
| - \DefTblrTemplate{contfoot-text}{default}{}% |
411 |
| -} |
412 |
| - |
413 | 419 | % Defines a parameter table
|
414 | 420 | % Arguments:
|
415 | 421 | % #1: Number of columns
|
416 | 422 | % #2: Initial format for tblr, i.e. format except for last column
|
417 | 423 | % #3: Title of the table ee.g. Params, Enumerator
|
418 | 424 | % #4: Body
|
419 | 425 | \NewDocumentCommand{\DoxyParamTable}{m m +m +m}{%
|
420 |
| - \SetTblrOuter[longtblr]{theme=DoxyParamTableTheme}% set table caption and label |
| 426 | + \SetTblrOuter[longtblr]{theme=DoxyTableBareTheme}% set table caption and label |
421 | 427 | \sbox0{% render table off-screen first to capture its width in \wd0
|
422 | 428 | \begin{tblr}{measure=vbox,colspec={*{#1}{|l}|}}%
|
423 | 429 | \SetCell[c=#1]{l} \tf{#3} \\[1ex]%
|
|
430 | 436 | \else%
|
431 | 437 | \edef\DoxyTableColSpec{#2l}%
|
432 | 438 | \fi%
|
433 |
| - \expanded{\noexpand\begin{longtblr}[l,theme=DoxyParamTableTheme]% |
| 439 | + \expanded{\noexpand\begin{longtblr}[l,theme=DoxyTableBareTheme]% |
434 | 440 | {vline{1-Z}={2-Z}{solid},% show vertical lines for all rows except the first
|
435 | 441 | measure=vbox,% needed to allow nested lists and tables
|
436 | 442 | colspec=\DoxyTableColSpec}}% set column type for all columns
|
|
0 commit comments