I want to make the font type of a table to be the same that I am using in the text, how do I do that? How do I change the font in a table?
asked Aug 10, 2017 at 17:58 101 1 1 gold badge 1 1 silver badge 3 3 bronze badgesWelcome to TeX.SE. Please tell us which document class you employ, which text font(s) you use, and which font(s) you would like to use for table-related material.
Commented Aug 10, 2017 at 18:01the document class that I am using is 'book' and the font that I'm using is the 'default' and I'd like to use the \sf font in the table. Thank you for your quick reply
Commented Aug 10, 2017 at 18:04And which part of the table environment should be typeset using the sans-serif font: The table header (also called the caption), the tabular material, the footnotes, or all of the above?
Commented Aug 10, 2017 at 18:05 I want to set this font in the tabular material Commented Aug 10, 2017 at 18:07 \beginif you have only one table, the simplest way is
\begin \sffamily \begin . \end \end
otherwise put in preamble
\usepackage \AtBeginEnvironmentnote, this change font family only im tabular material. in caption is defined by caption set up.
answered Aug 10, 2017 at 18:12 302k 23 23 gold badges 180 180 silver badges 381 381 bronze badgesHere's a solution in case you want everything in the table , including the \caption , to be typeset using the sans-serif font: Simply insert the following instructions in the preamble:
\makeatletter \renewenvironment% <\renewcommand\familydefault\sfdefault \@float> \makeatother
A full working example:
\documentclass \usepackage % for filler text \makeatletter \renewenvironment% <\renewcommand\familydefault\sfdefault \@float> \makeatother \begin \lipsum*[1] \begin[h!] \caption \beginp@<>> \hline \lipsum*[2]\\ \hline \end \end \lipsum*[3] \end