如何修复超出下边距的文本?

如何修复超出下边距的文本?

我正在阅读我的文本,发现一部分文本超出了下边距。我尝试[h]从所有浮动中移除,但结果仍然有一部分超出了边距。有什么帮助吗?

\documentclass[12pt,a4paper]{article}
\usepackage{blindtext}
\usepackage{graphicx}
\usepackage[showframe,%
    left=3.00cm,
    right=2.00cm,
    top=3.00cm,
    bottom=2.00cm
]{geometry}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{array}
\usepackage{ltablex}
\keepXColumns
\linespread{1.3}
\begin{document}

\section{Section}
%%
\blindtext Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text\par%
%
\subsection{Subsection}%
%
Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text\par%
%
\subsubsection{Subsubsection 1}%
%
Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text\par%
%
Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text.\par%
%
\begin{table}[h]
\centering
\footnotesize
\caption{Table}
\label{tab:1}
\begin{tabular}{lc}
\midrule
\textbf{Head}   & \textbf{Head} \\
\midrule
CUR                     & \SI{20}{psi} \\
GS1                     & \SI{40}{psi} \\
GS2                     & \SI{40}{psi} \\
GS3                     & \SI{5000}{\volt} \\
GS4                     & \SI{450}{\degreeCelsius} \\
\midrule
\end{tabular}
\end{table}%
%
Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text\par%
%
\begin{figure}[h]
\centering
\includegraphics[height=9.7cm]{example-image-a}
\caption{Caption}
\label{fig:1}
\end{figure}
%
\begin{table}[h]
\centering
\footnotesize
\renewcommand{\tabularxcolumn}[1]{m{#1}}
\begin{tabularx}{\linewidth}{*5{>{\centering\arraybackslash}X}}
\caption{Caption}%
\label{tab:param-otimizados-transi}%
\\
\midrule
\textbf{Text\newline(m/z)} &
\textbf{Text\newline(m/z)} &
\textbf{Text\newline(\si{\volt})} &
\textbf{Text\newline(\si{e\volt})} &
\textbf{Text\newline(\si{\volt})} \\%
\midrule
100 & 100 & 100 & 100 & 100 \\
100 & 100 & 100 & 100 & 100 \\
100 & 100 & 100 & 100 & 100 \\
\midrule
\end{tabularx}
\end{table}%
%
This is the text out of the margins\par% 
%
\end{document}

在此处输入图片描述

答案1

这里有一个解决方案。您可以使用float包并将最后一个表的对齐方式设置为H而不是h

输出

\documentclass[12pt,a4paper]{article}
\usepackage{blindtext}
\usepackage{float}% added
\usepackage{graphicx}
\usepackage[showframe,%
    left=3.00cm,
    right=2.00cm,
    top=3.00cm,
    bottom=2.00cm
]{geometry}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage{siunitx}
\usepackage{array}
\usepackage{ltablex}
\keepXColumns
\linespread{1.3}
\begin{document}

\section{Section}
%%
\blindtext Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text\par%
%
\subsection{Subsection}%
%
Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text\par%
%
\subsubsection{Subsubsection 1}%
%
Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text\par%
%
Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text.\par%
%
\begin{table}[h]
\centering
\footnotesize
\caption{Table}
\label{tab:1}
\begin{tabular}{lc}
\midrule
\textbf{Head}   & \textbf{Head} \\
\midrule
CUR                     & \SI{20}{psi} \\
GS1                     & \SI{40}{psi} \\
GS2                     & \SI{40}{psi} \\
GS3                     & \SI{5000}{\volt} \\
GS4                     & \SI{450}{\degreeCelsius} \\
\midrule
\end{tabular}
\end{table}%
%
Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text Text\par%
%
\begin{figure}[h]
\centering
\includegraphics[height=9.7cm]{example-image-a}
\caption{Caption}
\label{fig:1}
\end{figure}
%
\begin{table}[H]%changed this to upper case H.
\centering
\footnotesize
\renewcommand{\tabularxcolumn}[1]{m{#1}}
\begin{tabularx}{\linewidth}{*5{>{\centering\arraybackslash}X}}
\caption{Caption}%
\label{tab:param-otimizados-transi}%
\\
\midrule
\textbf{Text\newline(m/z)} &
\textbf{Text\newline(m/z)} &
\textbf{Text\newline(\si{\volt})} &
\textbf{Text\newline(\si{e\volt})} &
\textbf{Text\newline(\si{\volt})} \\%
\midrule
100 & 100 & 100 & 100 & 100 \\
100 & 100 & 100 & 100 & 100 \\
100 & 100 & 100 & 100 & 100 \\
\midrule
\end{tabularx}
\end{table}%
%
This is the text out of the margins\par% 
%
\end{document}

相关内容