3

I got tables working based on MWE. It was provided by @Yiannis Lazarides How to create new table environment How can I create two captions one on the top and one on the bottom.

\documentclass{article}
\makeatletter
\usepackage[figurename=Figure.,
                  justification=RaggedRight, 
                  labelfont={bf, footnotesize}, 
                  textfont={footnotesize},position=top]{caption}
\begin{document}
\listoftables
\def\starttable#1{%
  \renewcommand{\arraystretch}{1.1}%
  \minipage{0.45\textwidth}
      \captionof{table}{#1}
      \tabular{|c|c|c|c|}
      \hline
      Text-1  & Text-2 & Text-3 & Text-4 \\
      \hline
}
\def\stoptable{%
   \hline\endtabular
   \endminipage\hspace{10pt}}
\def\R #1|#2|#3|#4{ #1&#2&#3&#4}

\newpage
\begin{table}[h]
\centering
\starttable{First table caption}
 \R test|test|test|test\\
 \R test|test|test|test\\
 \R test|test|test|test\\
\stoptable
%
\starttable{This is the second caption}
 \R test|test|test|test\\
 \R test|test|test|test\\
 \R test|test|test|test\\
\stoptable
\end{table}
\end{document}
  • What should the caption look like? Do you want the same table number? For example, "Table 1: Above caption" and then below "Table 1: Below caption"? Are you stuck using the interface as in the above example? – Werner Sep 8 '12 at 14:55
  • @Werner - I do not want table1: below. Just want to be able to put some text. I could not get that, when I put any text near it does not print the tables side by side moves them around. I want to be able to keep the structure same yet have two captions. Table # etc on the top and just plan text on the bottom for each table. – Aku Sep 8 '12 at 14:58
7

Using

\def\stoptable#1{%
   \hline\endtabular\par\vspace{\abovecaptionskip}%
   {\footnotesize #1}%
   \endminipage}

allows you to add

\stoptable{<caption>}

and receive a caption below the table:

enter image description here

\documentclass{article}
\usepackage[figurename=Figure.,
                  justification=RaggedRight, 
                  labelfont={bf, footnotesize}, 
                  textfont={footnotesize},position=top]{caption}
\begin{document}
\listoftables
\def\starttable#1{%
  \renewcommand{\arraystretch}{1.1}%
  \minipage{0.45\textwidth}
      \centering
      \captionof{table}{#1}
      \tabular{|c|c|c|c|}
      \hline
      Text-1  & Text-2 & Text-3 & Text-4 \\
      \hline
}
\def\stoptable#1{%
   \hline\endtabular\par\vspace{\abovecaptionskip}%
   {\footnotesize #1}%
   \endminipage}
\def\R #1|#2|#3|#4{ #1&#2&#3&#4}

\newpage
\begin{table}[h]
\centering
\starttable{First table top caption}
 \R test|test|test|test\\
 \R test|test|test|test\\
 \R test|test|test|test\\
\stoptable{First table bottom caption}
\hspace{10pt}%
\starttable{Second table top caption}
 \R test|test|test|test\\
 \R test|test|test|test\\
 \R test|test|test|test\\
\stoptable{Second table bottom caption}
\end{table}
\end{document}

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.