防止数字列表溢出

防止数字列表溢出

我有一个图表列表,当使用时siunitx,值和单位不会分隔到新行,因此会溢出图表列表的边缘(见下文)。

在此处输入图片描述

我可以(并且已经)粗略地解决了这个问题,方法是将其拆分\SI\num\si,但是我想知道是否有一个“更好”的解决方案可以自动排版列表以使其不会溢出?更好的方法是防止溢出,同时将单位保留为数字。

编辑:按要求的乳胶代码

\documentclass[a4paper,12pt]{article} %12pt font

\usepackage{amsmath}
\usepackage{graphicx}
\usepackage[margin=2cm,a4paper]{geometry} 
\usepackage[final]{hyperref} 
\usepackage{float}
\usepackage[font={small},labelfont=bf]{caption}
\usepackage[onehalfspacing]{setspace} %1.5 line spacing
\usepackage{natbib}
\usepackage{gensymb}
\usepackage[detect-weight=true,detect-family=true,separate-uncertainty=true]{siunitx}
\usepackage{amssymb}

\hypersetup{colorlinks=true, linkcolor=black, citecolor=black, urlcolor=blue, breaklinks=true}

\begin{document}
\listoffigures

\begin{figure}[htb]
\centering
\includegraphics[width=0.7\columnwidth]{alongshore_WS}
\caption{Annually-smoothed alongshore wind stress (\si{N.m^{-2}}) calculated over the region enclosed by 44--46\si{\degree} S, with zonal boundaries at 165--166.45\si{\degree} E in the south and 165--168.53\si{\degree} E in the north, over the altimeter record (April 1993 -- November 2016). The dashed line is the linear trend over this time period (\SI{1.31 +- 1.60E-3}{N.m^{-2}.decade^{-1}}). A negative wind stress represents wind flowing down the coast (i.e. poleward).}
\label{fig:WS}
\end{figure}

\end{document}

答案1

这些评论已经充分解决了我的这个问题,所以我想在这里总结一下这两种解决方案,以防其他人遇到类似的问题。

1)首先,指出,图表列表部分中的图表标题应该比问题中的要短。因此,对我来说,最好的解决方案是缩短图表标题,即\caption[Shorter caption]{Extended caption}

2)但是,如果这不能解决问题(并且数字列表仍然溢出),则\sisetup{allow-number-unit-breaks=true}使用约翰·科米洛也可以。请注意,在读取 中的包时也可以包含这一点\usepackage[allow-number-unit-breaks=true]{siunitx}

相关内容