![将表格放入 \twocolumn 文档中,并将标题水平居中](https://linux22.com/image/434121/%E5%B0%86%E8%A1%A8%E6%A0%BC%E6%94%BE%E5%85%A5%20%5Ct%E2%80%8B%E2%80%8Bwocolumn%20%E6%96%87%E6%A1%A3%E4%B8%AD%EF%BC%8C%E5%B9%B6%E5%B0%86%E6%A0%87%E9%A2%98%E6%B0%B4%E5%B9%B3%E5%B1%85%E4%B8%AD.png)
我正在使用\twocolumn
文档,但是我想在列中间添加一个表格。我尝试使用\onecolumn
,但它将图形或表格放在下一页,使整个页面都占满了\onecolumn
。
我看到使用\multicols
可以解决问题。问题是,无论我如何设置,最终的表格标题都不会居中,而且我仍然无法获得overful hbox error
有关表格内容的信息。
\documentclass[journal, a4paper, 11pt]{IEEEtran}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{tabularx}
\usepackage{tabulary}
\usepackage{url}
\usepackage{amsmath}
\usepackage[left=1.5cm,right=1.5cm,top=1.5cm,bottom=1.5cm]{geometry}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{empheq}
\usepackage{textcomp}
\usepackage{float}
\usepackage{booktabs}
\usepackage{xspace}
\usepackage{makecell}
\usepackage{algorithm}
\usepackage{algpseudocode}
\usepackage{hhline}
\usepackage[style=numeric,sorting=none]{biblatex}
\addbibresource{references.bib}
% \renewcommand{\refname}{Referencias}
% \parindent=5mm
\setlength{\parindent}{1em}
\setlength{\parskip}{1em}
\renewcommand{\baselinestretch}{1.25}
% \renewcommand{\tablename}{Tabla}
% \renewcommand{\figurename}{Figura}
\PassOptionsToPackage{hyphens}{url}\usepackage{hyperref}
\usepackage{hyperref}
\hypersetup{
colorlinks=true,
linkcolor=blue,
filecolor=magenta,
urlcolor=cyan,
pdftitle={Overleaf Example},
citecolor=blue,
pdfpagemode=FullScreen,
}
\usepackage{placeins} %FloatBarrier
\usepackage{fancyhdr}
\newcommand*{\eg}{e.g.\@\xspace}
\newcommand*{\ie}{i.e.\@\xspace}
\newcommand{\mac}{\overline{\overline{c}}}
\newcommand{\sm}{\mathrm{sm}}
\newcommand{\MATLAB}{\textsc{Matlab}\xspace}
\newcommand{\dd}{\mathrm{d}}
% \renewcommand{\abstract}{\textbf{\emph{Resumen}} -- }
% \renewcommand\appendixname{Anexos}
\setlength{\parskip}{1mm}%
\newcommand{\reynolds}{\mathrm{Re}}
% Matlab code
\usepackage[framed,numbered,autolinebreaks,useliterate]{mcode}
\makeatletter
\long\def\@makecaption#1#2{\ifx\@captype%
\footnotesize{\normalfont\footnotesize #1}\\
{\normalfont\footnotesize\scshape #2}%
\@IEEEtablecaptionsepspace
\else
\@IEEEfigurecaptionsepspace
\setbox\@tempboxa\hbox{\normalfont\footnotesize {#1.}~~ #2}%
\ifdim \wd\@tempboxa >\hsize%
\setbox\@tempboxa\hbox{\normalfont\footnotesize {#1.}~~ }%
\parbox[t]{\hsize}{\normalfont\footnotesize \noindent\unhbox\@tempboxa#2}%
\else
\hbox to\hsize{\normalfont\footnotesize\hfil\box\@tempboxa\hfil}\fi\fi}
\makeatother
\usepackage{etoolbox}
\apptocmd{\sloppy}{\hbadness 10000\relax}{}{}
\usepackage{pdfpages}
\usepackage{multicol}
\begin{document}
% \onecolumn
\maketitle
\section{Introduction}
The following report analyzes the mission \textbf{New Horizons} mission to Pluto and its insights. This report is based on the experience from Dr. Alan Stern, principal investigator of the New Horizons mission and the Chief Scientist at Moon Express \cite{stern2018chasing}.
NASA's New Horizons spacecraft is the first spacecraft to explore Pluto up close, flying by the dwarf planet and its moons on July 14, 2015. In early 2019, New Horizons flew past its second major science target—2014 MU69, the most distant object ever explored up close \cite{nasa_new_horizons}.
\begin{center}
\begin{multicols}{2}
\begin{table}[H]
\resizebox{\textwidth}{!}{%
\centering
\begin{tabular}{|c|c|}
\hline
Nation & United States of America (USA) \\ \hline
Objective(s) & Pluto Flyby, Kuiper Belt Object Flyby \\ \hline
Spacecraft & New Horizons \\ \hline
Spacecraft Mass & 1,054 pounds (478 kilograms) \\ \hline
Mission Design and Management & NASA / Johns Hopkins University Applied Physics Laboratory (APL) \\ \hline
Launch Vehicle & Atlas V 551 (AV-010) \\ \hline
Launch Date and Time & Jan. 19, 2006 / 19:00:00 UT \\ \hline
Launch Site & Cape Canaveral, Fla. / Launch Complex 41 \\ \hline
Scientific Instruments & \begin{tabular}[c]{@{}l@{}}Ralph-Visible and Infrared Imager/Spectrometer\\ Alice-Ultraviolet Imaging Spectrometer\\ Radio-Science Experiment (REX)\\ Long-Range Reconnaissance Imager (LORRI)\\ Solar Wind and Plasma Spectrometer (SWAP)\\ Pluto Energetic Particle Spectrometer Science Investigation (PEPSSI)\\ Student Dust Counter (SDC)\end{tabular} \\ \hline
\end{tabular}
}
\captionsetup{justification=centering}
\caption{New Horizons mission characteristics. Source: \cite{nasa_new_horizons}.}
\label{tab:my-table}
\end{table}
\end{multicols}
\end{center}
答案1
让我们来解决您的问题中出现的各种问题。
(1)IEEEtran for journal 将生成一份两列文档。无需其他软件包。
(2)该类允许使用更宽的表格table*
。(其风格是两侧没有垂直线)
(3)宽表将转到下一页。说明建议使用该dblfloatfix
包使两列浮动元素按正确顺序显示出来。
(4)表格的标题应放在表格的顶部。
(5)要将标题放在页面中央,请将其放在 \parbox{\textwidth}{\caption{ ....}}
(6)请勿使用, \resizebox{
因为它会改变表格的字体大小(脚注大小)。
% !TeX TS-program = pdflatex
\documentclass[journal, a4paper, 11pt]{IEEEtran}
\usepackage{graphicx}
\usepackage{kantlipsum} % dummy text
\usepackage{dblfloatfix} % floats in twocolumns come out in the right order
\begin{document}
\title{A title}
\author {Only One}
\maketitle
\section{Introduction}
The following report analyzes the mission \textbf{New Horizons} mission to Pluto and its insights. This report is based on the experience from Dr. Alan Stern, principal investigator of the New Horizons mission and the Chief Scientist at Moon Express \cite{stern2018chasing}.
NASA's New Horizons spacecraft is the first spacecraft to explore Pluto up close, flying by the dwarf planet and its moons on July 14, 2015. In early 2019, New Horizons flew past its second major science target—2014 MU69, the most distant object ever explored up close \cite{nasa_new_horizons}
\section{Overview}
1. \kant[1-3]
\begin{table*}[tb]
\centering
\renewcommand{\arraystretch}{1.4} %expand the cells
\parbox{\textwidth}{\caption{New Horizons mission characteristics. Source:\cite{nasa_new_horizons}.}}
\label{tab:my-table}
\begin{tabular}{c|l}
\hline
Nation & United States of America (USA) \\ \hline
Objective(s) & Pluto Flyby, Kuiper Belt Object Flyby \\ \hline
Spacecraft & New Horizons \\ \hline
Spacecraft Mass & 1,054 pounds (478 kilograms) \\ \hline
Mission Design and Management & NASA / Johns Hopkins University Applied Physics Laboratory (APL) \\ \hline
Launch Vehicle & Atlas V 551 (AV-010) \\ \hline
Launch Date and Time & Jan. 19, 2006 / 19:00:00 UT \\ \hline
Launch Site & Cape Canaveral, Fla. / Launch Complex 41 \\ \hline
Scientific Instruments & \begin{tabular}[c]{@{}l@{}}
Ralph-Visible and Infrared Imager/Spectrometer\\
Alice-Ultraviolet Imaging Spectrometer\\
Radio-Science Experiment (REX)\\
Long-Range Reconnaissance Imager (LORRI)\\
Solar Wind and Plasma Spectrometer (SWAP)\\
Pluto Energetic Particle Spectrometer Science Investigation (PEPSSI)\\
Student Dust Counter (SDC)
\end{tabular} \\ \hline
\end{tabular}
\end{table*}
2. \kant[1-6]
\end{document}
答案2
我认为你能做的最好的事情就是给班级一个选项onecolumn
,并使用它multicol
来使文本变成双列,并将表格放在其中两列之间。
\documentclass[journal, a4paper, 11pt, onecolumn]{IEEEtran}
....
\usepackage{multicol}
....
\begin{multicols}{2}
\section{Introduction}
The following report analyzes the mission \textbf{New Horizons} mission to Pluto and its insights. This report is based on the experience from Dr. Alan Stern, principal investigator of the New Horizons mission and the Chief Scientist at Moon Express \cite{stern2018chasing}.
....
\end{multicols}
\begin{table}[H]
...
\end{table}
\begin{multicols}{2}
... more text ...
\end{multicols}