删除对齐环境上方和下方的空白

删除对齐环境上方和下方的空白

我想删除“Beachte:”上方和下方的对齐环境造成的空白。

\documentclass[12pt]{article}

\usepackage{amsmath}
\usepackage[utf8]{inputenc}
\usepackage[utf8]{inputenc}
\usepackage{ulem}
\usepackage[a4paper, top = 0.8cm, left = 1cm, right = 1cm, bottom = 0.8cm]{geometry}

\begin{document}
    \begin{minipage}[t]{0.1\linewidth}
        \begin{align*}
            \sigma_{L} & =  \text{Lochleibungsspannung}\\
            \sigma_{LB} & =  \text{Lochleibungsfestigkeit}\\
            \sigma_{L2} & = \text{Lochleibungsgrenze}\\
        \end{align*}
        {\small Beachte:\\
        \begin{align*}
            P_B & = j \cdot j_s \cdot P_S \text{ \hspace{0.5cm} \uline{\textit{\bfseries \footnotesize oder}}}\\
            P_B & = d_R \cdot s \cdot n \cdot \sigma_L\\
        \end{align*}}
    \end{minipage}
\end{document}

有人能帮助我吗?

谢谢!

答案1

删除最后的多余的\\s 并考虑增加 your 的 withminipage以容纳最长的不可分解单词。

\documentclass[12pt]{article}    
\usepackage{amsmath}
\usepackage[utf8]{inputenc}
\usepackage[utf8]{inputenc}
\usepackage{ulem}
\usepackage[a4paper, top = 0.8cm, left = 1cm, right = 1cm, bottom = 0.8cm]{geometry}

\begin{document}
    \begin{minipage}[t]{0.3\linewidth}
        \begin{align*}
            \sigma_{L} & =  \text{Lochleibungsspannung}\\
            \sigma_{LB} & =  \text{Lochleibungsfestigkeit}\\
            \sigma_{L2} & = \text{Lochleibungsgrenze} % <============
        \end{align*}
        {\small Beachte: % <============
        \begin{align*}
            P_B & = j \cdot j_s \cdot P_S \text{ \hspace{0.5cm} \uline{\textit{\bfseries \footnotesize oder}}}\\
            P_B & = d_R \cdot s \cdot n \cdot \sigma_L
        \end{align*}}
    \end{minipage}

\end{document}

在此处输入图片描述

答案2

也许您所追求的就是来自\shortintertext的命令?mathtools

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}

\usepackage{mathtools}
\usepackage{ulem}
\usepackage[a4paper, vmargin = 0.8cm, hmargin = 1cm]{geometry}

\begin{document}

    \begin{minipage}[t]{0.3\linewidth}
        \begin{align*}
            \sigma_{L} & = \text{Lochleibungsspannung}\\
            \sigma_{LB} & = \text{Lochleibungsfestigkeit}\\
            \sigma_{L2} & = \text{Lochleibungsgrenze}\\
   \shortintertext {\small Beachte:}
            P_B & = j \cdot j_s \cdot P_S \text{ \hspace{0.5cm} \uline{\textit{\bfseries \footnotesize oder}}}\\
            P_B & = d_R \cdot s \cdot n \cdot \sigma_L\\
        \end{align*}
    \end{minipage}

\end{document} 

在此处输入图片描述

答案3

tabstackengine提供了一种替代方案,它不会添加额外的填充,除非您需要,因为它将结果放在紧密贴合的 LaTeX 框中。在这里,我甚至在“Beachte”周围添加了一个 2pt 垂直缓冲区。

\documentclass[12pt]{article}

\usepackage{amsmath}
\usepackage[utf8]{inputenc}
\usepackage[utf8]{inputenc}
\usepackage{ulem}
\usepackage[a4paper, top = 0.8cm, left = 1cm, right = 1cm, bottom = 0.8cm]{geometry}
\usepackage{tabstackengine}
\setstackgap{L}{1.1\baselineskip}
\TABstackMath
\begin{document}
\noindent\hrulefill

    \begin{minipage}[t]{0.1\linewidth}
        \alignCenterstack{
            \sigma_{L}  =&  \text{Lochleibungsspannung}\\
            \sigma_{LB} =&  \text{Lochleibungsfestigkeit}\\
            \sigma_{L2} =& \text{Lochleibungsgrenze}
        }\\[2pt]
        {\small Beachte:\\[2pt]
        \alignCenterstack{
            P_B  =& j \cdot j_s \cdot P_S \hspace{0.5cm}
               \underline{\text{\textit{\bfseries \footnotesize oder}}}\\
            P_B  =& d_R \cdot s \cdot n \cdot \sigma_L
        }}
    \end{minipage}

\noindent\hrulefill
\end{document}

在此处输入图片描述

相关内容