
Estou escrevendo tabelas verdade como esta:
\begin{displaymath}
\begin{array}{|c c|c|}
p & q & p \land q \\
\hline
1 & 1 & 1 \\
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 0 \\
\end{array}
\end{displaymath}
e gostaria de colocar uma legenda depois da mesa explicando o que é a mesa. Eu tentei ambos com \caption
e captionof
mas não compila.
Responder1
É isso que voce quer?
\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb}
\usepackage{caption}
\begin{document}
\bgroup\setlength{\belowdisplayskip}{-2ex}
\begin{gather*}
\begin{array}{|cc|c|}
p & q & p \land q \\
\hline
1 & 1 & 1 \\
1 & 0 & 0 \\
0 & 1 & 0 \\
0 & 0 & 0 \\
\end{array}
\shortintertext{%
\captionof{table}{This is my table with caption}}
\end{gather*}
\egroup
Some text. Some more text. Some more text. Some more text. Some more text.
\end{document}