Graphics, Figures & TablesHow to change the font of the headers?

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
DryRun
Posts: 8
Joined: Sun May 19, 2019 7:08 pm

How to change the font of the headers?

Post by DryRun »

Hi,

How to change the headers so that it is not italic but instead bold?

Code: Select all

\begin{tabular}{ @{} l l l >{$\mathstrut\displaystyle}l<{$} @{} }\toprule 
\emph{first} & \emph{second} & \emph{third} & \multicolumn{1}{l}{\emph{fourth}} \\\midrule
foo & bar & y=f(x) & data\\
foo & bar & y=f(x) & data \\
foo & bar & Time \\
foo & bar & y=f(x) & 10.56 \\
foo & bar & Angle & 18.256 \\
foo & bar & Force & 1.6 \\
foo & bar & y=f(x) & 8.56 \\\bottomrule
\end{tabular}

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

How to change the font of the headers?

Post by Johannes_B »

emph makes it italic.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
DryRun
Posts: 8
Joined: Sun May 19, 2019 7:08 pm

How to change the font of the headers?

Post by DryRun »

Thanks for the hint. I changed it to \textbf :D

The tex file compiles with no errors in Overleaf but i'm puzzled over why this part of the code is highlighted in red:

Code: Select all

$\mathstrut\displaystyle}l<{$}
Is this a deprecated style??
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

How to change the font of the headers?

Post by Johannes_B »

I have no idea why Overleaf highlights it read. I don't use Overleaf.

Code: Select all

\documentclass{article}
\usepackage{booktabs}
\usepackage{array}
\begin{document}
\begin{tabular}{ @{} l l l >{$\mathstrut\displaystyle}l<{$} @{} }
\toprule 
\emph{first} & \emph{second} & \emph{third} & \multicolumn{1}{l}{\emph{fourth}} \\\midrule
foo & bar & y=f(x) & data\\
foo & bar & y=f(x) & data \\
foo & bar & Time \\
foo & bar & y=f(x) & 10.56 \\
foo & bar & Angle & 18.256 \\
foo & bar & Force & 1.6 \\
foo & bar & y=f(x) & 8.56 \\\bottomrule
\end{tabular}
\end{document}
Don't post code chunks, always a complete and compilable document.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply