Graphics, Figures & TablesGetting an underscore "_" in a table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
jgaspard
Posts: 20
Joined: Tue Aug 19, 2008 4:16 pm

Getting an underscore "_" in a table

Post by jgaspard »

Hi all!

Ok, I have a little problem. Why can't I typeset this table correctly? It doesn't work when I add the "_" at "mitt_1984"...But I need to since it's a code for my statistical operations.

Thanks a lot!

Code: Select all

\documentclass[10pt,a4paper]{report}
\usepackage[francais]{babel}
\usepackage[applemac]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{cite}
\usepackage{graphicx}
\usepackage{lscape}
\usepackage{fullpage}
\usepackage{geometry}
\usepackage{fancyhdr}
\usepackage[adobe-utopia]{mathdesign}
\pagestyle{empty}
\geometry{hmargin=3cm, vmargin=3cm}

\begin{document}
\begin{table}[h]
\centering
\begin{footnotesize}
\caption{Analyse lexicométrique: allocutions au Parlement européen (1984-2008)}
\label{allocutions}
\begin{tabular}{@{}lr@{ }ll@{}}
\hline
\textbf{Président}&\textbf{Discours}&&\textbf{Code}\\
\hline
François Mitterrand&24 mai&1984&mitt_1984\\
François Mitterrand&25 octobre&1989&mitt\\
François Mitterrand&22 novembre&1989&mitt\\
François Mitterrand&17 janvier&1995&mitterrand\\
Jacques Chirac&4 juillet&2000&chirac\\
Jacques Chirac&12 décembre&2008&chirac\\
Nicolas Sarkozy&10 juillet&2008&sarko\\
Nicolas Sarkozy&21 octobre&2008&sarko\\
Nicolas Sarkozy&16 décembre&2008&sarko\\
\hline
\end{tabular}
\end{footnotesize}
\end{table}
\end{document}

Recommended reading 2024:

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

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

phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Getting an underscore "_" in a table

Post by phi »

_ is a special character used in math mode. Use \_ or \textunderscore to get a literal underscore.
jgaspard
Posts: 20
Joined: Tue Aug 19, 2008 4:16 pm

Re: table with "_"

Post by jgaspard »

Perfect, thanks a lot
Post Reply