如何自动缩放图形环境以适合带有文本的页面

如何自动缩放图形环境以适合带有文本的页面

我正在尝试完成一份科学报告,并努力将图形(及其标题)缩放到部分填充文本的页面上,以便它占据剩余的空间。

这是我当前的页面 在此处输入图片描述 这就是我想要创造的- 即使我添加/删除一些内容,图形也会自动缩放以填充页面上的剩余空间。 在此处输入图片描述

这是当前页面的代码,其中删除了许多不需要的包/序言

\documentclass[12pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\graphicspath{ {images/} }

\begin{document}
\maketitle

\section{Surface Processes}
    \subsection{Atmosphere}
    \subsection{Temperature}
        Since 2009, the Diviner Lunar Radiometer Experiment on-board the Lunar Reconnaissance Orbiter (LRO) has been acquiring thermal emission measurements of the lunar surface to map the daytime, nighttime and Polar surface thermal environments. The LRE's primary goal is to provide detailed thermal maps of PSRs and adjacent areas to place first-order constraints on viable cold-traps for water ice. Of the nine channels, four are dedicated to measuring the surface thermal emissions including 13–23 $\mu$m ($>$178 K), 25–41 $\mu$m (69 - 178 K), 50–100 $\mu$m (43 - 69 K) and 100–400$\mu$m ($<$43K). The bolometric brightness temperature, ($T_bol$) is a measure of the spectrally integrated flux of infrared radiation emerging from the surface, and is the most fundamental and interpretable measurably quantity for the purposes of quantifying the overall heat balance of the surface and comparing with available models \citep{Paige2010}. \cite{Williams2017} determine the $T_{bol}$,  from the combined brightness temperatures of the individual Diviner spectral channels, providing a diurnal temperature curve of the lunar surface at different latitudes (Figure \ref{fig:Williams2017 Bolometric Surface Temp}).
        \newline

            \begin{figure} [h]
                \centering
                \includegraphics[width=\textwidth]{Images/Williams 2017 bolometric surface temperature.jpg}
                \caption{(a) Zonal mean bolometric temperatures and (b) standard deviation versus local time for latitude bands 0°, 30°, 45° 60°, 70°, 80°, and 85° \citep{Williams2017}}
                \label{fig:Williams2017 Bolometric Surface Temp}
            \end{figure}
        
        \clearpage

我试过了zref-sapos 解决方案在这里,但它不允许我添加标题。我还尝试了Tiks 解决方案在这里,但对我来说没用,因为我不熟悉如何修改它,因为我的图没有使用 Tiks。此外,当我使用简单方法时由 David Carlisle 推荐,无论我输入什么 pt 值"\textheight-22.2pt"数字没有任何变化。

我对 overleaf 还不熟悉,所以不确定如何解决这个问题,任何我可以简单地包含在 \begin{figure} 环境中的解决方案都会很棒。

干杯

答案1

这将计算剩余空间并缩放图像高度以适应。我不得不做一些额外的更改才能让它在不访问您的文件的情况下运行。

\documentclass[12pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
%\graphicspath{ {images/} }

\makeatletter
\newcommand{\autoscale}[2]% #1 = image filename, #2 = caption
{\par\bgroup
  \dimen0=\dimexpr\pagegoal-\pagetotal-\baselineskip\relax
  \noindent\begin{minipage}[c][\dimen0][b]{\columnwidth}
    \def\@captype{figure}% or use \captionof{figure}
    \setbox0=\vbox{\caption{#2}}% measure caption height
    \centering
    \includegraphics[height={\dimexpr \dimen0-\intextsep-\ht0-\dp0}]{#1}\par
    \unvbox0
  \end{minipage}%
\egroup\par}
\makeatother

\begin{document}

\section{Surface Processes}
    \subsection{Atmosphere}
    \subsection{Temperature}
        Since 2009, the Diviner Lunar Radiometer Experiment on-board the Lunar Reconnaissance Orbiter (LRO) has been acquiring thermal emission measurements of the lunar surface to map the daytime, nighttime and Polar surface thermal environments. The LRE's primary goal is to provide detailed thermal maps of PSRs and adjacent areas to place first-order constraints on viable cold-traps for water ice. Of the nine channels, four are dedicated to measuring the surface thermal emissions including 13–23 $\mu$m ($>$178 K), 25–41 $\mu$m (69 - 178 K), 50–100 $\mu$m (43 - 69 K) and 100–400$\mu$m ($<$43K). The bolometric brightness temperature, ($T_bol$) is a measure of the spectrally integrated flux of infrared radiation emerging from the surface, and is the most fundamental and interpretable measurably quantity for the purposes of quantifying the overall heat balance of the surface and comparing with available models (cite removed)determine the $T_{bol}$,  from the combined brightness temperatures of the individual Diviner spectral channels, providing a diurnal temperature curve of the lunar surface at different latitudes (Figure \ref{fig:Williams2017 Bolometric Surface Temp}).

\autoscale{example-image}{(a) Zonal mean bolometric temperatures and (b) standard deviation versus local time for latitude bands $0^\circ, 30^\circ, 45^\circ, 60^\circ, 70^\circ, 80^\circ, \textrm{and } 85^\circ $ (cite removed)\label{fig:Williams2017 Bolometric Surface Temp}}

next page starts here
\end{document}

相关内容