我正在尝试将子标题包包含在文档类 aastex61 中。
以下是我的 LaTeX 源文件的相关行
\documentclass[twocolumn]{aastex61}
\pdfoutput=1 %for arXiv submission
\usepackage{amsmath,amstext}
\usepackage[T1]{fontenc}
\usepackage{apjfonts}
\usepackage[figure,figure*]{hypcap}
\usepackage{url}
\usepackage{graphicx}
\usepackage{subcaption}
\renewcommand*{\sectionautorefname}{Section} %for \autoref
\renewcommand*{\subsectionautorefname}{Section} %for \autoref
\shorttitle{AASTeX 6.1 Template}
\shortauthors{Author A et al.}
\begin{document}
\begin{figure}
\centering
\begin{subfigure}[width = 0.3\linewidth]
\includegraphics{}[width=\textwidth]{4915_sval.pdf}
\caption{plot}
\label{plot:sval}
\end{subfigure}
\end{figure}
\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.
...
l.20 \begin{document}
欢迎任何建议!
答案1
当你尝试编译示例时,你会得到
Package caption Warning: Unsupported document class (or package) detected,
(caption) usage of the caption package is not recommended.
See the caption package documentation for explanation.
基于 的revtex4-1
类与不兼容,因此也与 不兼容。aastex61
caption
subcaption
您可以使用subfig
来加载该caption=false
选项。
这里有一些代码可以帮助你入门:
\documentclass[twocolumn]{aastex61}
\pdfoutput=1 %for arXiv submission
\usepackage{amsmath}
\usepackage[T1]{fontenc}
%\usepackage{apjfonts}
%\usepackage[figure,figure*]{hypcap}
\usepackage{url}
\usepackage{graphicx}
\usepackage[caption=false]{subfig}
\usepackage{lipsum} % just for the example
\renewcommand*{\sectionautorefname}{Section} %for \autoref
\renewcommand*{\subsectionautorefname}{Section} %for \autoref
\begin{document}
\title{An Example Article using AAS\TeX{} v6.1}
\author{Greg J. Schwarz}
\affil{American Astronomical Society \\
2000 Florida Ave., NW, Suite 300 \\
Washington, DC 20009-1231, USA}
\author{Butler Burton}
\affil{National Radio Astronomy Observatory}
\begin{abstract}
Whatever
\end{abstract}
\keywords{One, two}
\section{Test}
\lipsum[1-6]
\begin{figure}
\centering
\subfloat[plot]{%
\includegraphics[width=0.3\columnwidth]{example-image-a}%
\label{plot:sval}%
}\qquad
\subfloat[plot]{%
\includegraphics[width=0.3\columnwidth]{example-image-b}%
\label{plot:whatever}%
}
\end{figure}
\lipsum
\end{document}
我之所以发表评论是apjfonts.sty
因为我没有它,而且hypcap
它不能与之一起工作subfig
。