如何减少 minipage 之前的空间

如何减少 minipage 之前的空间

问题:我想减少答案第一行和小页面开始之间的额外空格。

这是我目前所做的:

\documentclass[12pt, letterpaper]{article}
\usepackage[a4paper,top=1 in,bottom=1 in,left=0.7 in,right=0.7 in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[misc]{ifsym}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{forest}
\usepackage{tikz}
\usetikzlibrary{intersections}
\makeatother
\usepackage[parfill]{parskip}
\setlength{\parskip}{1ex}
\begin{document}
\textbf{Answer:}~Let the points are $A\,\left(x_1 , x_2\right)$, $B\,\left(y_1 , y_2\right)$ and $C\,\left(z_1 , z_2\right)$.

 \begin{minipage}[b]{.5\textwidth}
    \begin{flalign*}
        \rightarrow AB^2&=&\\
        &=&\\
        \therefore\;AB&=&   
    \end{flalign*}
\end{minipage}%
\begin{minipage}[b]{0.5\textwidth}
    \begin{flalign*}
        \rightarrow BC^2&=&\\
        &=&\\
        \therefore\;BC&=&
    \end{flalign*}  
\end{minipage}
\end{document}

答案1

在您的设置中,\parskip在之前有一个,一旦小页面开始,在每个方程组顶部minipage都会有一个。您可以通过在小页面之前发出或来撤消这些垂直空间中的任何一个。您选择哪一个取决于您希望拥有的间距:\abovedisplayskip\vspace{-\parskip}\vspace{-\abovedisplayskip}

示例输出

\documentclass[12pt, letterpaper]{article}

\usepackage[a4paper,top=1 in,bottom=1 in,left=0.7 in,right=0.7 in]{geometry}

\usepackage[utf8]{inputenc}
\usepackage[misc]{ifsym}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{forest}
\usepackage{tikz}
\usetikzlibrary{intersections}

\usepackage[parfill]{parskip}
\setlength{\parskip}{1ex}

\begin{document}
\textbf{Answer:} Let the points be $A = (x_1 , x_2)$, $B = (y_1 ,
y_2)$ and $C = (z_1 , z_2)$.  Remove \verb+\parskip+.

\vspace{-\parskip}
\begin{minipage}[b]{.5\textwidth}
    \begin{flalign*}
        \rightarrow AB^2&=&\\
        &=&\\
        \therefore\;AB&=&
    \end{flalign*}
\end{minipage}%
\begin{minipage}[b]{0.5\textwidth}
    \begin{flalign*}
        \rightarrow BC^2&=&\\
        &=&\\
        \therefore\;BC&=&
    \end{flalign*}
\end{minipage}

\textbf{Answer:} Let the points be $A = (x_1 , x_2)$, $B = (y_1 ,
y_2)$ and $C = (z_1 , z_2)$.  Remove \verb+\abovedisplayskip+.

\vspace{-\abovedisplayskip}
\begin{minipage}[b]{.5\textwidth}
    \begin{flalign*}
        \rightarrow AB^2&=&\\
        &=&\\
        \therefore\;AB&=&
    \end{flalign*}
\end{minipage}%
\begin{minipage}[b]{0.5\textwidth}
    \begin{flalign*}
        \rightarrow BC^2&=&\\
        &=&\\
        \therefore\;BC&=&
    \end{flalign*}
\end{minipage}

\textbf{Answer:} Let the points be $A = (x_1 , x_2)$, $B = (y_1 ,
y_2)$ and $C = (z_1 , z_2)$.  Remove nothing.

\begin{minipage}[b]{.5\textwidth}
    \begin{flalign*}
        \rightarrow AB^2&=&\\
        &=&\\
        \therefore\;AB&=&
    \end{flalign*}
\end{minipage}%
\begin{minipage}[b]{0.5\textwidth}
    \begin{flalign*}
        \rightarrow BC^2&=&\\
        &=&\\
        \therefore\;BC&=&
    \end{flalign*}
\end{minipage}

\end{document}

答案2

在命令前添加\vspace{-...}负距离,\begin{minipage}... 例如

\textbf{Answer:}~Let the points are $A\,\left(x_1 , x_2\right)$, $B\,\left(y_1 , y_2\right)$ and $C\,\left(z_1 , z_2\right)$.

\vspace{-4ex}
\begin{minipage}[b]{.5\textwidth}

\vspace但请确保在命令前留一个空行。

相关内容