我的问题如下:我需要在报告中添加很多数字。这些数字通常约为页面高度的 0.4。加上标题,高度大约是 0.55 左右。无论如何,一页上放不下两个数字。
最后我只剩下这样的东西:
在 .tex 文件中,它看起来像这样:
\documentclass[a4paper,titlepage]{article}
\usepackage[pass]{geometry}
\usepackage{changepage}
\usepackage[margin=0.8cm]{caption}
\usepackage{graphicx}
\usepackage{subcaption}
\begin{document}
\section{Section 1}
Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1Paragraph Fig1 Paragraph Fig1
%%%
%%%%%%%%%%%%%%%% FIGURE %%%%%%%%%%%%%%%%%
\begin{figure}[h!]
\centering
\makebox[\columnwidth]{\rule{\columnwidth}{10.5 cm}}
\caption{FIG 1}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2Paragraph Fig2 Paragraph Fig2
%%%
%%%%%%%%%%%%%%%% FIGURE %%%%%%%%%%%%%%%%%
\begin{figure}[h!]
\centering
\makebox[\columnwidth]{\rule{\columnwidth}{10.5 cm}}
\caption{FIG 2}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3Paragraph Fig3 Paragraph Fig3
%%%
%%%%%%%%%%%%%%%% FIGURE %%%%%%%%%%%%%%%%%
\begin{figure}[h!]
\centering
\makebox[\columnwidth]{\rule{\columnwidth}{10.5 cm}}
\caption{FIG 3}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4Paragraph Fig4 Paragraph Paragraph Fig4
%%%
%%%%%%%%%%%%%%%% FIGURE %%%%%%%%%%%%%%%%%
\begin{figure}[h!]
\centering
\makebox[\columnwidth]{\rule{\columnwidth}{10.5 cm}}
\caption{FIG 4}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5Paragraph Fig5 Paragraph Fig5
%%%
%%%%%%%%%%%%%%%% FIGURE %%%%%%%%%%%%%%%%%
\begin{figure}[h!]
\centering
\makebox[\columnwidth]{\rule{\columnwidth}{10.5 cm}}
\caption{FIG 5}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6Paragraph Fig6 Paragraph Paragraph Fig6
%%%
%%%%%%%%%%%%%%%% FIGURE %%%%%%%%%%%%%%%%%
\begin{figure}[h!]
\centering
\makebox[\columnwidth]{\rule{\columnwidth}{10.5 cm}}
\caption{FIG 6}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
\clearpage
\newpage
\section{Section 2}
Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph
\end{document}
通常,我会在部分末尾添加“\clearpage”和“\newpage”,以避免在第 2 部分中找到第 1 部分的数字。所以基本上,看图,我有:
- 第 0 页,包含章节开头和关于图 1 的评论
- 第 1 页,包含图 1 以及关于图 2、3、4 的评论
- 第 2 页,附有图 2 和关于图 5、6 的评论
- 第 3 页,仅显示图 3
- 第 4 页,仅显示图 4
- 第 5 页,仅显示图 5
- 第 6 页,见图 6。
最后一部分,第 3、4、5 和 6 页只有一个图,这让我很困扰……
我想知道是否有一个选项可以让我一旦没有更多文本,就改变页面的几何形状,以便在一页上容纳两个图形。在示例中,我们将对第 0、1 和 2 页进行完全相同的操作,但我会
- 第 3 页,附图 3 和图 4
- 第 4 页,附有图 5 和图 6。
我认为我可以手动完成,只需编译已有的代码,查看我的 pdf 并注意哪些图形放在文本后面。然后只需将它们从文本中移除并使用 '\newpage',然后在更改这些特定页面的几何形状时包含所有这些图形...但我不太喜欢这个想法,我想知道是否可以自动化。
我还想知道是否有可能在文本中间执行此操作:我们看到在第 2 页上,我们正在评论图 5 和 6,而图 3、4 尚未显示。是否可以强制 Latex 更改此页面的几何形状并允许图 3 出现在图 2 之后(在同一页上),然后在下一页上显示图 4,然后显示关于图 5 和图 6 的段落...
那么我们就有
- 第 0 页,包含章节开头和关于图 1 的评论
- 第 1 页,包含图 1 以及关于图 2、3、4 的评论
- 第 2 页,附图 2 和图 3
- 第 3 页,附有图 4 以及关于图 5 和图 6 的评论
- 第 4 页,附图 5 和 6
(我不知道这些是否都很清楚,但如果您想要更多信息,请随时询问)。我知道我应该让 LaTeX 帮我做这件事,因为这是它的目的,但我想知道是否可以不费太多力气就做到这一点。
谢谢 !
答案1
[h!]
只会让 latex 更难定位图形,它会抱怨很多,并将其更改为[ht!]
给自己一个机会,但p
除非你有非常好的理由不这样做,否则你应该始终包含 really。此外,常规使用也没有意义!
,因为这意味着忽略用户设置的约束。如果约束不合适,最好更改它们,而不是设置它们然后忽略它们。
这里用来将两个图形挤压到浮动页面上的代码有点像黑客行为,但工作正常,我个人只会将图形做得更小,以便两个图形可以放入正常页面中,那么就不需要了。
\documentclass[a4paper,titlepage]{article}
\usepackage[pass]{geometry}
\usepackage{changepage}
\usepackage[margin=0.8cm]{caption}
\usepackage{graphicx}
\usepackage{subcaption}
\renewcommand\floatpagefraction{0.7}
\makeatletter
\setlength\@fpbot{-.5cm plus 1fil}
\setlength\@fptop{-1.5cm}
\setlength\@fpsep{-2cm plus 1fill}
\makeatother
\begin{document}
\section{Section 1}
Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1 Paragraph Fig1Paragraph Fig1 Paragraph Fig1
%%%
%%%%%%%%%%%%%%%% FIGURE %%%%%%%%%%%%%%%%%
\begin{figure}[htp]
\centering
\makebox[\columnwidth]{\rule{\columnwidth}{10.5 cm}}
\caption{FIG 1}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2 Paragraph Fig2Paragraph Fig2 Paragraph Fig2
%%%
%%%%%%%%%%%%%%%% FIGURE %%%%%%%%%%%%%%%%%
\begin{figure}[htp]
\centering
\makebox[\columnwidth]{\rule{\columnwidth}{10.5 cm}}
\caption{FIG 2}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3 Paragraph Fig3Paragraph Fig3 Paragraph Fig3
%%%
%%%%%%%%%%%%%%%% FIGURE %%%%%%%%%%%%%%%%%
\begin{figure}[htp]
\centering
\makebox[\columnwidth]{\rule{\columnwidth}{10.5 cm}}
\caption{FIG 3}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4 Paragraph Fig4Paragraph Fig4 Paragraph Paragraph Fig4
%%%
%%%%%%%%%%%%%%%% FIGURE %%%%%%%%%%%%%%%%%
\begin{figure}[htp]
\centering
\makebox[\columnwidth]{\rule{\columnwidth}{10.5 cm}}
\caption{FIG 4}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5 Paragraph Fig5Paragraph Fig5 Paragraph Fig5
%%%
%%%%%%%%%%%%%%%% FIGURE %%%%%%%%%%%%%%%%%
\begin{figure}[htp]
\centering
\makebox[\columnwidth]{\rule{\columnwidth}{10.5 cm}}
\caption{FIG 5}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6 Paragraph Fig6Paragraph Fig6 Paragraph Paragraph Fig6
%%%
%%%%%%%%%%%%%%%% FIGURE %%%%%%%%%%%%%%%%%
\begin{figure}[htp]
\centering
\makebox[\columnwidth]{\rule{\columnwidth}{10.5 cm}}
\caption{FIG 6}
\end{figure}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%
\clearpage
\section{Section 2}
Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph Paragraph
\end{document}