次のコードのコンパイルで重大な問題が発生しています。
\documentclass[a4paper,reprint,aps,unsortedaddress]{revtex4}
\usepackage{longtable}
\usepackage{caption}
\begin{document}
\captionof{table}{This is a very nice table}
\begin{longtable}{c|c|c|c}
A & B & A & B \\ \hline
\end{longtable}
\addtocounter{table}{-1}
\captionof{table}{This is a very nice table}
\begin{longtable}{c|c|c|c}
A & B & A & B \\ \hline
\end{longtable}
\end{document}
エラーメッセージは
! LaTeX Error: Command \longtable* already defined. Or name \end... illegal, see p.192 of the manual. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help.
このエラーを解決する方法を教えていただけますか?
答え1
さて、あなたのコードには 3 つの問題があります:
- クラス
revtex4
は古くなっています。現在のクラスは ですrevtex4-2
。変更できますか? - パッケージをロードすると、クラスとクラスに対して
caption
いくつかのエラー/警告が発生します。ロードしないでください。revtex4
revtex4-2
\captionof{table}{This is a very nice table}
パッケージがロードされている場合にのみ可能ですcaption
が、longtable
独自のキャプションを定義します\caption{This is a very nice table}\\
(閉じを参照してください\\
!)
次のコードで
\documentclass[a4paper,reprint,aps,unsortedaddress]{revtex4}
\usepackage{longtable}
%\usepackage{caption}
\begin{document}
\begin{longtable}{c|c|c|c}
\caption{This is a very nice table}\\
A & B & A & B \\ \hline
\end{longtable}
\addtocounter{table}{-1}
\begin{longtable}{c|c|c|c}
\caption{This is a very nice table}\\
A & B & A & B \\ \hline
\end{longtable}
\end{document}
revtex4
クラスとrevtex4-2
結果を使用してエラーなしでコンパイルできます。