首先有两个表格。前两个表格编号为表 1 和表 2。
\documentclass[12pt,a4paper]{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{amssymb}
\usepackage{ragged2e}
\usepackage[utf8x]{inputenc}
\usepackage{tabularx}
\usepackage{graphicx}
\DeclareUnicodeCharacter{2061}{}
\DeclareUnicodeCharacter{8289}{}
\begin{document}
\begin{table}[h]
\begin{minipage}{0.5\textwidth}
\begin{center}
\begin{tabular}{|c|c|c|c|c|}
\hline
$\wedge$ &$\phi$ &$\{a\}$ &$\{b\}$ &$\{a,b\}$\\
\hline
$\phi$ & $\phi$ &$\phi$ &$\phi$ &$\phi$\\
\hline
$a$ &$\phi$ &\{a\} &$\phi$ &$\{a\}$\\
\hline
$b$ &$\phi$ &$\phi$ &$\{b\}$ &$\{b\}$ \\
\hline
$\{a,b\}$ &$\phi$ &$\{a\}$ &$\{b\}$ &$\{a,b\}$ \\
\hline
\end{tabular}
\caption{Composition table for meet}
\end{center}
\end{minipage}
\begin{minipage}{0.5\textwidth}
\begin{center}
\begin{tabular}{|c|c|c|c|c|}
\hline
$\vee$ &$\phi$ &$\{a\}$ &$\{b\}$ &$\{a,b\}$\\
\hline
$\phi$ & $\phi$ &$\{a\}$ &$\{b\}$ &$\{a,b\}$\\
\hline
$a$ &$\{a\}$ &$\{a\}$ &$\{a,b\}$ &$\{a,b\}$\\
\hline
$b$ &$\{b\}$ &$\{a,b\}$ &$\{b\}$ &$\{a,b\}$ \\
\hline
$\{a,b\}$ &$\{a,b\}$ &$\{a,b\}$ &$\{a,b\}$ &$\{a,b\}$ \\
\hline
\end{tabular}
\caption{Composition table for join}
\end{center}
\end{minipage}
\end{table}
**After some texts, 3rd table begins...**
\begin{table}[h!]
\begin{center}
\begin{tabular}{c|cccc}
$w'x'y'z$ &$0$ &$0$ &$0$ &$1$\\
$w'x'yz'$ & $0$ &$0$ &$1$ &$0$ \\ \hline
$w'x'yz$ &$0$ &$0$ &$1$ &$1$ \\
$wx'yz'$ &$1$ &$0$ &$1$ &$0$ \\
$wxy'z'$ &$1$ &$1$ &$0$ &$0$ \\ \hline
$wx'yz$ &$1$ &$0$ &$1$ &$1$ \\
$wxyz'$ &$1$ &$1$ &$1$ &$0$ \\
\end{tabular}
\caption{$$}
\end{center}
\end{table}
\end{document}
但我想将第三个表重命名为表 1,但无法实现。任何建议都值得赞赏。
显示警告:'与此包类似的功能最近(everypage)已在 LaTeX 中实现。此包现在处于(everypage)遗留状态'。
答案1
我建议使用caption
包裹管理字幕格式:
\documentclass{article}
\usepackage{caption}
\DeclareCaptionLabelFormat{namedash}{#1-#2}
\captionsetup[table]{labelformat=namedash}
\begin{document}
\begin{table}[htb]
\begin{minipage}{0.5\linewidth}
\centering
\begin{tabular}{ | *{5}{c |} }
\hline
$\wedge$ & $\phi$ & $\{a\}$ & $\{b\}$ & $\{a,b\}$ \\
\hline
$\phi$ & $\phi$ & $\phi$ & $\phi$ & $\phi$ \\
\hline
$a$ & $\phi$ & $\{a\}$ & $\phi$ & $\{a\}$ \\
\hline
$b$ & $\phi$ & $\phi$ & $\{b\}$ & $\{b\}$ \\
\hline
$\{a,b\}$ & $\phi$ & $\{a\}$ & $\{b\}$ & $\{a,b\}$ \\
\hline
\end{tabular}
\caption{Composition table for meet}
\end{minipage}%
\begin{minipage}{0.5\linewidth}
\centering
\begin{tabular}{ | *{5}{c |} }
\hline
$\vee$ & $\phi$ & $\{a\}$ & $\{b\}$ & $\{a,b\}$ \\
\hline
$\phi$ & $\phi$ & $\{a\}$ & $\{b\}$ & $\{a,b\}$ \\
\hline
$a$ & $\{a\}$ & $\{a\}$ & $\{a,b\}$ & $\{a,b\}$ \\
\hline
$b$ & $\{b\}$ & $\{a,b\}$ & $\{b\}$ & $\{a,b\}$ \\
\hline
$\{a,b\}$ & $\{a,b\}$ & $\{a,b\}$ & $\{a,b\}$ & $\{a,b\}$ \\
\hline
\end{tabular}
\caption{Composition table for join}
\end{minipage}
\end{table}
**After some texts, 3rd table begins...**
\begin{table}[htb]
\centering
\begin{tabular}{ c | *{4}{c} }
$w'x'y'z$ & $0$ & $0$ & $0$ & $1$ \\
$w'x'yz'$ & $0$ & $0$ & $1$ & $0$ \\
\hline
$w'x'yz$ & $0$ & $0$ & $1$ & $1$ \\
$wx'yz'$ & $1$ & $0$ & $1$ & $0$ \\
$wxy'z'$ & $1$ & $1$ & $0$ & $0$ \\
\hline
$wx'yz$ & $1$ & $0$ & $1$ & $1$ \\
$wxyz'$ & $1$ & $1$ & $1$ & $0$
\end{tabular}
\caption*{Table-1}
\end{table}
\end{document}
这样您就可以使用\caption*
未格式化的标题(仅为文本),您可以在其中放置任何您想要的内容。