Skip to content
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

Unable to control font size of titles for LaTeX tables #1959

Open
2 tasks done
bzkrouse opened this issue Feb 21, 2025 · 0 comments
Open
2 tasks done

Unable to control font size of titles for LaTeX tables #1959

bzkrouse opened this issue Feb 21, 2025 · 0 comments

Comments

@bzkrouse
Copy link

bzkrouse commented Feb 21, 2025

Prework

Description

Font sizes for titles and subtitles set via tab_options() do not translate into the rendered LaTeX.

Reproducible example

exibble |> 
  gt() |> 
  tab_options(
    table.font.size = "10pt",
    heading.title.font.size = "10pt",
    heading.subtitle.font.size = "10pt"
  ) |> 
  tab_header(title = "My title",
             subtitle = "My subtitle") |>
  as_latex() |> 
  cat()

results in the following:

\begin{table}[!t]
\caption*{
{\large My title} \\ 
{\small My subtitle}
} 
\fontsize{10.0pt}{12.0pt}\selectfont
\begin{tabular*}{\linewidth}{@{\extracolsep{\fill}}rlcrrrrll}
\toprule
num & char & fctr & date & time & datetime & currency & row & group \\ 
\midrule\addlinespace[2.5pt]
1.111e-01 & apricot & one & 2015-01-15 & 13:35 & 2018-01-01 02:22 & 49.950 & row\_1 & grp\_a \\ 
2.222e+00 & banana & two & 2015-02-15 & 14:40 & 2018-02-02 14:33 & 17.950 & row\_2 & grp\_a \\ 
3.333e+01 & coconut & three & 2015-03-15 & 15:45 & 2018-03-03 03:44 & 1.390 & row\_3 & grp\_a \\ 
4.444e+02 & durian & four & 2015-04-15 & 16:50 & 2018-04-04 15:55 & 65100.000 & row\_4 & grp\_a \\ 
5.550e+03 & NA & five & 2015-05-15 & 17:55 & 2018-05-05 04:00 & 1325.810 & row\_5 & grp\_b \\ 
NA & fig & six & 2015-06-15 & NA & 2018-06-06 16:11 & 13.255 & row\_6 & grp\_b \\ 
7.770e+05 & grapefruit & seven & NA & 19:10 & 2018-07-07 05:22 & NA & row\_7 & grp\_b \\ 
8.880e+06 & honeydew & eight & 2015-08-15 & 20:20 & NA & 0.440 & row\_8 & grp\_b \\ 
\bottomrule
\end{tabular*}
\end{table}

As you can see, the titles and subtitles are set to "large" and "small" fonts, respectively. It would be great to have control over these font sizes.
Thanks in advance for the consideration!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants