Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to highlight some numbers in a table using \bf{}. However, the bold numbers also get wider but I want them to neatly line up with the rest. How can I avoid this?

share|improve this question
    
Welcome to TeX.SE. I am sure there is an exact question on this site about generating bold text using the same horizontal space, but haven't found it yet... –  Peter Grill Jan 2 '13 at 16:05
    
What typeface are you using? Is it the default Computer Modern? –  egreg Jan 2 '13 at 16:25
    
Yes, I'm using the default typeface. –  Peter Jan 2 '13 at 16:28

1 Answer 1

up vote 7 down vote accepted

You can use "non extended bold face":

\documentclass{article}
\usepackage{booktabs}

\newcommand{\bftab}{\fontseries{b}\selectfont}

\begin{document}
\begin{tabular}{lc}
\toprule
Class & Value \\
\midrule
A & 10 \\
B & 12 \\
C & \bftab 13 \\
D & 11 \\
\bottomrule
\end{tabular}
\end{document}

enter image description here

Note. From your question I gather that you're using \bf{13} or something like that. It's wrong for two reasons:

  1. \bf is an obsolete command;
  2. it is not a command with argument.

Use \textbf{13} or {\bfseries 13} (the former is preferred for single snippets of boldface text, the latter is for longer passages or in the definition of environments).

share|improve this answer
    
Wow, thanks so much! –  Peter Jan 2 '13 at 16:48

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.