我正在尝试编写一份 2 列科学报告,我想让图表出现在第二页顶部的两列上。据我所知,使用 figure* 命令应该可以解决问题,但结果却添加了分页符,并且图像在下一页上垂直居中!我该如何解决这个问题?提前谢谢您。
请注意代码中所写的文字内容。
\documentclass[twocolumn]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{geometry}
\geometry{margin=1in}
\title{test}
\author{Pancake Senpai}
\date{September 2019}
\begin{document}
\maketitle
\section{Introduction}
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
\begin{figure*}[ht]
\centering
\includegraphics[width=\textwidth]{"diagram".png}
\caption{My diagram.}
\end{figure*}
\end{document}
答案1
您没有提供测试文件,但如果您添加足够的文本来开始第 2 页,并且图形足够小以允许位于文本页面的顶部,那么它就会出现在第 2 页的顶部。我删除了,[ht]
因为figure*
无法放置here
。
\documentclass[twocolumn]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{geometry}
\geometry{margin=1in}
\title{test}
\author{Pancake Senpai}
\date{September 2019}
\begin{document}
\maketitle
\section{Introduction}
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
\begin{figure*}
\centering
\includegraphics[width=\textwidth,height=5cm]{example-image}
\caption{My diagram.}
\end{figure*}
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
This is a two column document and I want an image to spread across two
columns on the SECOND page. Rather than add a load of text here, I've kept
it short, but if you run this code then you should add a load of text so
that you're on page 2 before adding the image in order to replicate the
conditions.
\end{document}