Update: this problem does not appear when using
\documentclass[twocolumn]{article}
However, I use \documentclass[twocolumn]{aastex61}
which can be found at http://journals.aas.org/authors/aastex/aastex61.cls.
What is in the aastex61.cls
file that is causing this?
I am writing a two-column research article, and I have a table in it.
I wanted the table to take the maximum space in the article column, so that it is readable. I used \resizebox{\columnwidth}{!}
to give it the command to expand on the full width of the column (and the ! to keep the height scaled), as described in other answers on tex.stackexchange, like Resizing a table by textheight or in the wikibooks documentation https://en.wikibooks.org/wiki/LaTeX/Tables.
So I run the following code
\documentclass[twocolumn]{aastex61}
\usepackage{color}
\usepackage{lipsum}
\usepackage{mathtools}
\usepackage{placeins}
\usepackage{multirow}
\usepackage{float}
\usepackage{silence}
\begin{document}
\begin{abstract}
\lipsum[1-1]
\end{abstract}
\section{Introduction}
\lipsum[1]
\begin{table}[h!]
\centering
\resizebox{\columnwidth}{!}{%
\begin{tabular}{|l|l|l|l|l|l|l|}
\multicolumn{2}{|l|}{WC coefficient for PC number} & WC1 & WC2 & WC3 & WC4 & WC5 \\
\multirow{4}{*}{Fixed radiation field} & Using 2 PCs & & & & & \\
& Using 3 PCs & & & & & \\
& Using 4 PCs & & & & & \\
& Using 5 PCs & & & & & \\ \hline
\multicolumn{1}{|l|}{\multirow{4}{*}{Variable radiation field}} & Using 2 PCs & & & & & \\
\multicolumn{1}{|l|}{} & Using 3 PCs & & & & & \\
\multicolumn{1}{|l|}{} & Using 4 PCs & & & & & \\
\multicolumn{1}{|l|}{} & Using 5 PCs & & & & & \\
\end{tabular}%
}
\caption{Initial Values for the PCA coefficients}
\label{PCA_initial}
\end{table}
\lipsum[2-3]
\end{document}
However, the table is pushed to the right compared to the other text in the article column. See this picture:
This document explains how using @{}
before the first column marker is supposed to empty the space before the first column and aligned with the exterior text.
https://www.tug.org/TUGboat/tb28-3/tb90hoeppner.pdf
I tried using that, and it had no effect.
I also tried using the @{\hspace{-1cm})
as described here
https://en.wikibooks.org/wiki/LaTeX/Tables#Aligning_columns_at_decimal_points_using_dcolumn
The border does move left, but the horizontal line gets interrupted and I obtain
The only time when I got the table to be aligned with the rest of the article text was when I removed the "table" wrapper, and left the "tabular" only. But this of course fixed the table in the text (it cannot float), and does not allow me to reference it and caption it.
What are some solutions?
! LaTeX Error: Missing \begin{document}.