1

I get the error message of missing $ inserted in my table.

\toprule
 ABS & \ 14,573.300^a & 3 & 4,857.767 & 40.297 & .000 \\
\midrule

I had tried:

\toprule
 ABS & \[14,573.300^a\] & 3 & 4,857.767 & 40.297 & .000 \\
\midrule

Basically, i need put the figure below with subscript in my table

enter image description here

  • 1
    The ^ particle should only ever be used in math mode. For the problem at hand, replace ^a with \textsuperscript{a} -- unless you're really trying to display "14573 to the a'th power"... – Mico Aug 8 at 14:56
  • 1
    By the way, what is a supposed to denote? Is it a footnote marker? Please advise. – Mico Aug 8 at 15:01
  • @Mico Yes, it will be a footnote marker for a – aan Aug 8 at 15:05
  • Please provide complete small document not just code fragment ... see, if maybe use of the threeparttable can help you (it define \tnote for such purposes). – Zarko Aug 8 at 15:20
  • why not use \footnotemark ? (or as Zarko just suggested a table notes macro?) – David Carlisle Aug 8 at 15:20
6

In TeX and LaTeX, the ^ symbol should only ever be used in math mode, to denote exponentiation. However, you're not really trying to typeset "14,573.000 to the a'th power", right?

  • The brute-force solution would be to input 14,573.300\textsuperscript{a}. However, this approach doesn't exploit knowledge that a is supposed to be a footnote marker.

  • A much better solution is to load the threepartable package and to use its \tnote macro to typeset the footnote markers; the markers can be letters, numbers, symbols, or what-have-you. And, use a tablenotes environment after the end of the tabular environment to typeset the footnote material itself.

    A serious advantage of the latter approach is that the machinery of the threeparttable will automatically set the width of the tablenotes environment to that of the associated tabular environment.

enter image description here

\documentclass{article}
\usepackage{booktabs}
\usepackage[flushleft]{threeparttable}
\renewcommand{\TPTtagStyle}{\itshape} % optional
\usepackage{lipsum} % for filler text
\begin{document}

%% Approach 1: The brute-force method
\begin{table}[ht!]
\caption{A table}
\centering
\begin{tabular}{@{} *{6}{c} @{}}
\toprule
 ABS & \ 14,573.300\textsuperscript{a} & 3 & 4,857.767 & 40.297 & .000 \\
\midrule
\end{tabular}
\end{table}

%% Approach 2: The intelligent method
\begin{table}[h!]
\centering
\begin{threeparttable}
\caption{Another table}
\begin{tabular}{@{} *{6}{c} @{}}
\toprule
 ABS & \ 14,573.300\tnote{a} & 3 & 4,857.767 & 40.297 & .000 \\
\midrule
\end{tabular}

\footnotesize 
\begin{tablenotes}
\item[a]\lipsum*[2] % the footnote itself 
\end{tablenotes}

\end{threeparttable}
\end{table}

\end{document}
  • thanks. Why \item[a]\lipsum[testing] the footnote keep repeat it 2 times, the outcome is testingtesting. How to make it to only appear testing? – aan Aug 8 at 17:29
  • and it said missing numbers, treated as zero – aan Aug 8 at 17:31
  • I found. \item[a] My Note.. Between what is \lipsum used for? I googled, cannot understand fully – aan Aug 8 at 17:40
  • 2
    @aan - The command \lipsum is there to generate gibberish filler text. Its argument is optional and must be either a single integer or a range of integers, say, \lipsum[2] (see above) or \lipsum[1-20]. The former command prints out a single paragraph of filler text, whereas the latter outputs 20 [!] consecutive paragraphs of filler text. You can read more about the lipsum package online. \lipsum[testing] is a syntax error. To print out just the word "testing" after the footnote marker, write \item[a]testing. – Mico Aug 8 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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