I am trying to include subcaption package in the document class aastex61.
Here are the relevant lines of my LaTeX source file
\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}
The error prompted is:
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}
Any suggestions are welcome!
Best Answer
When you try compiling your example, you get
The
revtex4-1
class, whichaastex61
is based on, is not compatible withcaption
and therefore also withsubcaption
.You can use
subfig
, to be loaded with thecaption=false
option.Here's some code to get you started:
I commented
apjfonts.sty
because I don't have it andhypcap
because it cannot work withsubfig
.