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 use LaTeX for creating PDF output from R - not to create long documents. Hence the automatic Table 1: <caption> above the table is rather annoying. How can I remove the automatically generated Table 1:? Is it at all possible?

share|improve this question
2  
Maybe you could include some more information on how you generate your document? Do you use the xtable package, or Sweave, or do you export the data from R into a CSV file that you then import into LaTeX? –  Jake Jan 26 '12 at 3:05
add comment

migrated from stackoverflow.com Jan 26 '12 at 2:29

This question came from our site for professional and enthusiast programmers.

2 Answers

Use the caption package with the labelformat=empty option:

\documentclass[10pt,letterpaper]{article}

\usepackage[labelformat=empty]{caption}

\begin{document}

\begin{table}
\centering
\begin{tabular}{lll}
1 & 2 & 3 \\
a & b & c
\end{tabular}
\caption{Some super-secret data.}
\end{table}

\end{document}
share|improve this answer
add comment

In the standard document class (article, book and report), \@makecaption actually prints the float caption based on two arguments: The first is the float type (\@captype) and the second is the actual caption. If the removal of the float-specific addition is general (that is, for table, figure and others), then a redefinition of \@makecaption would suffice:

enter image description here

\documentclass{article}
\makeatletter
% Taken from http://mirrors.ctan.org/macros/latex/unpacked/article.cls
\long\def\@makecaption#1#2{%
  \vskip\abovecaptionskip
  \sbox\@tempboxa{#2}% \sbox{\@tempboxa{#1: #2}
  \ifdim \wd\@tempboxa >\hsize
    #2\par% #1: #2\par
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip}
\makeatother
\begin{document}

\begin{table}
  \centering
  \begin{tabular}{lll}
    1 & 2 & 3 \\
    a & b & c
  \end{tabular}
  \caption{Some super-secret data.}
\end{table}

\end{document}

In the above redefinition, the first argument #1 is still read, but not used, and therefore removed from the caption.

share|improve this answer
add comment

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.