\footnote gives error in minipage environment with cta-author class - latex

I need to use \footnote in a minipage environment, but it always gives an error
Command \itshape invalid in math mode. a\footnote{
mwe is
\documentclass{cta-author}
\begin{document}
\begin{table}
\begin{minipage}{\columnwidth}
\begin{tabular}{|c|c|}
\hline
Column 1 & Column2 \\
a\footnote{footnote example} & b\\
\hline
\end{tabular}
\end{minipage}
\end{table}
\end{document}
Latex class file is here

You can redefine the way cta-author makes the footnote mark. Instead of $^{...}$, use \textsuperscript{...}:
\documentclass{cta-author}
\makeatletter
\def\#makefnmark{\textsuperscript{\#thefnmark}}
\makeatother
\begin{document}
\begin{table}
\begin{minipage}{\columnwidth}
\begin{tabular}{|c|c|}
\hline
Column 1 & Column2 \\
a\footnote{footnote example} & b \\
\hline
\end{tabular}
\end{minipage}
\end{table}
% A possible work-around
\begin{table}
\begin{tabular}{|c|c|}
\hline
Column 1 & Column2 \\
a$^*$ & b \\
\hline
\end{tabular}
\medskip
\footnoterule
{\itshape\footnotesize $^*$footnote example}
\end{table}
\end{document}
And here is a visual of the work-around:

Related

making latex table

Can anyone give an idea on how to make this table?
Use \begin{table} [...] \end{table}
Here is a minimal working example:
\begin{table}
\centering
\begin{tabular}{l r}
& 119 Responses\\
Field & Percentage \\
\hline
Very convenient & 63\% \\
Sowewhat convenient & 28\% \\
Neutral & 5\% \\
Somewhat inconvenient & 2\% \\
Very inconvenient & 3\% \\
\end{tabular}
\end{table}
\end{document}
It looks like this:

Overleaf Appendix Table Numbering

I am using overleaf to write a journal article and want to move a lot of my results table to the Appendix. So I write the following commands:
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{outlines}
\usepackage{dirtytalk}
\usepackage{latexsym}
\usepackage{tabularx}
\usepackage{amsmath}
\usepackage{booktabs,caption}
\usepackage{longtable}
\usepackage{appendix}
\usepackage[para,online,flushleft]{threeparttable}
\usepackage[affil-it]{authblk}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage[a4paper, total={6in, 8in}]{geometry}
\renewcommand{\baselinestretch}{1.5}
\begin{document}
\bibliographystyle{IEEEtran}
\bibliography{bibliography.bib}
\appendix
\section{Tables}
\begin{table}[!]
\begin{scriptsize}
\centering
\caption{Reduced Form Estimates using Linear Probability Model}
\label{tab:my-table}
\begin{tabular}{#{}lcccc#{}}
\hline
\hline
& (1) & (2) & (3) & (4) \\
VARIABLES & A & B & C & D \\
\hline
&&&& \\
&&&& \\
&&&& \\
\hline
\multicolumn{5}{c}{\textit{Note:}Robust standard errors in parentheses *** p$<$0.01, ** p$<$0.05, * p$<$0.1 }
\end{tabular}
\end{scriptsize}
\end{table}
\end{document}
While the section is recognized as appendix and tables, the numbering of the tables continue from the main text. How do I go from for example: Table 12 to Table A1?
Thanks
You could use
\setcounter{table}{0}
\renewcommand{\thetable}{A\arabic{table}}
to change the numbering style of the appendix tables
Please also note that scriptsize is NOT an environment, it is a macro.
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{booktabs}
\usepackage{outlines}
\usepackage{dirtytalk}
\usepackage{latexsym}
\usepackage{tabularx}
\usepackage{amsmath}
\usepackage{booktabs,caption}
\usepackage{longtable}
\usepackage{appendix}
\usepackage[para,online,flushleft]{threeparttable}
\usepackage[affil-it]{authblk}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage[a4paper, total={6in, 8in}]{geometry}
\renewcommand{\baselinestretch}{1.5}
\begin{document}
\bibliographystyle{IEEEtran}
\bibliography{bibliography.bib}
\begin{table}[htbp]
%\begin{scriptsize}
\scriptsize
\centering
\caption{Reduced Form Estimates using Linear Probability Model}
\label{tab:my-table-}
\begin{tabular}{#{}lcccc#{}}
\hline
\hline
& (1) & (2) & (3) & (4) \\
VARIABLES & A & B & C & D \\
\hline
&&&& \\
&&&& \\
&&&& \\
\hline
\multicolumn{5}{c}{\textit{Note:}Robust standard errors in parentheses *** p$<$0.01, ** p$<$0.05, * p$<$0.1 }
\end{tabular}
%\end{scriptsize}
\end{table}
\appendix
\setcounter{table}{0}
\renewcommand{\thetable}{A\arabic{table}}
\section{Tables}
\begin{table}[htbp]
%\begin{scriptsize}
\scriptsize
\centering
\caption{Reduced Form Estimates using Linear Probability Model}
\label{tab:my-table}
\begin{tabular}{#{}lcccc#{}}
\hline
\hline
& (1) & (2) & (3) & (4) \\
VARIABLES & A & B & C & D \\
\hline
&&&& \\
&&&& \\
&&&& \\
\hline
\multicolumn{5}{c}{\textit{Note:}Robust standard errors in parentheses *** p$<$0.01, ** p$<$0.05, * p$<$0.1 }
\end{tabular}
%\end{scriptsize}
\end{table}
\end{document}

How to vertically center my latex table cell

My Latex tabular looks like this
\begin{table}
\centering
\begin{tabular}{clll}
\toprule
\multirow{2}*{Name} & \multirow{2}*{Description} & \multicolumn{2}{c}
{Time} \\
\cline{3-4}
& & Item1 & Item2 \\
\midrule
App1 & Good & 1000ms & 1000ms \\
\bottomrule
\end{tabular}
\end{table}
'
I wonder how can I make Item1 and Item2 in the above table vertically-centered. Thank you!
You can use the command \cmidrule{3-4}: it is equivalent to \cline{3-4}, but it improves the looking of the table.
\documentclass{article}
\usepackage{multirow}
\usepackage{booktabs}
\begin{document}
\begin{table}
\begin{center}
\begin{tabular}{clll}
\toprule
\multirow{2}*{Name} & \multirow{2}*{Description} & \multicolumn{2}{c} {Time} \\
\cmidrule{3-4}
& & Item1 & Item2 \\
\midrule
App1 & Good & 1000ms & 1000ms \\
\bottomrule
\end{tabular}
\end{center}
\end{table}
\end{document}

A horizontal line in a latex table

I want to put a horizontal line between first and second rows in the following table:
\begin{table}[ht]
\centering
\caption{Multi-row table}
\label{tab:Mergedrows}
\vspace{1ex}
\begin{tabular}{|c|c|}
\hline
\multirow{2}{*}{Mergedrows}
&X\\
&X \\
\hline
\end{tabular}
\end{table}
How to do this?
Just like the documentation to multirow shows: by adding a cline:
\documentclass{article}
\usepackage{multirow}
\begin{document}
\begin{table}[ht]
\centering
\caption{Multi-row table}
\label{tab:Mergedrows}
\vspace{1ex}
\begin{tabular}{|c|c|}
\hline
\multirow{2}{*}{Mergedrows}
&X\\
\cline{2-2} % add this
&X \\
\hline
\end{tabular}
\end{table}
\end{document}

Latex threeparttable table notes width

I am having problems with my threeparttable notes as they are somehow not covering the entire width of my table. Can anybody help me? Thank you already in advance!
Here is the code I use:
\documentclass[11pt, oneside]{article}
\usepackage{geometry}
\geometry{letterpaper}
\usepackage{graphicx}
\usepackage{lscape}
\usepackage{booktabs}
\usepackage{amssymb}
\usepackage[flushleft]{threeparttable}
\usepackage{longtable}
\usepackage{array}
\usepackage{pdflscape}
\usepackage{tabularx}
\usepackage{adjustbox}
\pagenumbering{gobble}
\usepackage{booktabs}
\begin{document}
{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{table}
\scalebox{0.6}{
\begin{threeparttable}
\begin{tabularx}
\textwidth{lccccccccc}
& \textbf{Neonatal} & \textbf{Infant} & \textbf{Low} \\
& \textbf{Mortality} & \textbf{Mortality} & \textbf{Birthweight} & \textbf{Stunting} & \textbf{Underweight} &\\
\multicolumn{10}{c}{\noindent\rule{18cm}{0.4pt}}\\
\textit{Mother is between 17 and 19 yrs} & -0.00517*** & -0.00857*** & -0.00896** & -0.0487*** & -0.0315*** \\
& [0.001] & [0.002] & [0.004] & [0.005] & [0.004] \\
\multicolumn{10}{c}{\noindent\rule{18cm}{0.2pt}}\\
\textbf{N} & 752543 & 574609 & 399845 & 501520 & 512482 \\
\multicolumn{10}{c}{\noindent\rule{18cm}{0.4pt}}\\
\end{tabularx}
\begin{tablenotes}
\item Results are from the main results regressions (4). ***, ** and * denote significance at the 1\%, 5\%, and 10\% levels, respectively. Std. Errors in square brackets and are clustered at PSU level.
\end{tablenotes}
\end{threeparttable}
}
\end{table}
}
\end{document}
I know it's been years since your question, I am learning creating tables right now that's how I've found this question.
I think you confused the threeparttable package by declaring 10 colunms, while you have only 6 in reality. Why don't you try using 6 columns and then some way linebreak the headers and long cells instead?
\documentclass[11pt, oneside]{article}
\usepackage{geometry}
\geometry{letterpaper}
\usepackage{graphicx}
\usepackage{lscape}
\usepackage{booktabs}
\usepackage{amssymb}
\usepackage[flushleft]{threeparttable}
\usepackage{longtable}
\usepackage{array}
\usepackage{pdflscape}
\usepackage{tabularx}
\usepackage{adjustbox}
\pagenumbering{gobble}
\usepackage{booktabs}
\usepackage{makecell}
\renewcommand\theadalign{bc}
\renewcommand\theadfont{\bfseries}
\renewcommand\theadgape{\Gape[4pt]}
\renewcommand\cellgape{\Gape[4pt]}
\begin{document}
{
\def\sym#1{\ifmmode^{#1}\else\(^{#1}\)\fi}
\begin{table}
\scalebox{0.8}{
\begin{threeparttable}
\begin{tabularx}
{16.5cm}{lccccc}
{} & \thead{Neonatal \\ Mortality} & \thead{Infant \\ Mortality} & \thead{Low \\ Birthweight} & \thead{Stunting} & \thead{Underweight} \\
\midrule
{\shortstack[l]{\textit{Mother is between} \\ \textit{17 and 19 yrs}}} & {\shortstack[c]{ $-0.00517$*** \\ $[0.001] $ }} & {\shortstack[c]{$ -0.00857$*** \\ $[0.002] $}} & {\shortstack[c]{$ -0.00896$** \\ $[0.004]$}} & {\shortstack[c]{$ -0.0487$*** \\ $[0.005]$}} & {\shortstack[c]{$-0.0315$*** \\ $[0.004]$}} \\
\midrule
\textbf{N} & 752543 & 574609 & 399845 & 501520 & 512482 \\
\midrule
\end{tabularx}
\begin{tablenotes}
\item Results are from the main results regressions (4). ***, ** and * denote significance at the 1\%, 5\%, and 10\% levels, respectively. Std. Errors in square brackets and are clustered at PSU level.
\end{tablenotes}
\end{threeparttable}
}
\end{table}
}

Resources