LaTeX: a paragraph cell in a tabular header row is not bold

Open Beginner friendly
#3,251 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Quiet
Tech stack
latex, xml
Domain
documentation

Research direction

The bug is in the paragraph branch of the cell template in pretext-latex-common.xsl, around line 8055; the bare-text branch next to it already applies the header row's bold. Compare the two branches and check where \bfseries is added for header rows. Reproduce with the minimal tabular example from the issue. Done when a <p> cell in a header row gets \bfseries alongside \raggedright, and the column width still applies.

Written by the indexing model from the issue text.

Description

In a <tabular> header row (<row header="yes">), the LaTeX conversion sets a bare-text cell in bold but not a cell that contains a <p>. So a header cell in a column with a <col width> loses its bold, because the width only applies to paragraph cells. The HTML conversion is fine: both cells become <th>.

Minimal example:

<tabular>
  <col width="40%"/>
  <col/>
  <row header="yes">
    <cell><p>Wrapped header</p></cell>
    <cell>Bare header</cell>
  </row>
  <row>
    <cell><p>a</p></cell>
    <cell>b</cell>
  </row>
</tabular>

LaTeX output (checkout 58551797, 2026-08-23):

\begin{tabular}{ll}
\multicolumn{1}{m{0.4\linewidth}}{\raggedright%
Wrapped header%
}&{\bfseries{}Bare header}\tabularnewline[0pt]
\multicolumn{1}{m{0.4\linewidth}}{\raggedright%
a%
}&b
\end{tabular}

"Bare header" gets \bfseries, but "Wrapped header" doesn't. The paragraph branch of the cell template in pretext-latex-common.xsl (around line 8055) never applies the header row's bold.

Expected: the header row's bold applies to a paragraph cell too, e.g. {\raggedright\bfseries{}Wrapped header}. Then a table can give its columns widths without its header row losing its emphasis.

🤖 Generated with Claude Code

Dominant language
XSLT
Stars
466
Forks
251
Avg merge
4m
Merged PRs (30d)
13

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from PreTeXtBook/pretext

All issues in PreTeXtBook/pretext

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.