第二行开头的一些额外空格

第二行开头的一些额外空格

参考我目前所做的。问题:非常简单的问题,为什么第二行开头有一些额外的空白,如红色箭头所示。我已经问过这个问题了,我们的两位用户帮了我很多忙,在此处输入图片描述但问题仍然没有完全解决。请告诉我问题出在哪里。我对此非常好奇。

代码:

\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}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usetikzlibrary{intersections}
\makeatother
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{lastpage}
\lhead{ }
\rhead{}
\chead{}
\rfoot{Page \thepage \hspace{1pt} of \pageref{LastPage}}
\lfoot{}
\cfoot{}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\begin{document}
\large
\noindent This is the first line. And why there is some blanks space between the first and second line \\ 
\begin{minipage}{0.45\textwidth}
In $\triangle{ABC}$ $\angle B = 90^{\circ}$,\\
By using Pythagoras Theorem,
\begin{align*}
AC^2&=AB^2+BC^2& \tag{$*$}
\end{align*}
\end{minipage}\hspace{\fill}%
\begin{minipage}{0.45\textwidth}
\flushright
\begin{tikzpicture}

    \tkzDefPoint(0:0){B}
    \tkzDefPoint(0:5){A}
    \tkzDefPoint(90:4){C}

    \tkzLabelPoint[above](C){$C$}
    \tkzLabelPoint[below,yshift=-0.6mm](A){$A$}
    \tkzLabelPoint[below,yshift=-0.8mm](B){$B$}

    \tkzDrawSegment[black!60!black](C,B)
    \tkzDrawSegment[black!60!black](B,A)
    \tkzDrawSegment[black!60!black](C,A)

    \tkzLabelSegment[auto,swap,rotate=-38.5,xshift=-15mm,yshift=0mm](A,C){Hypotenuse}
    \tkzLabelSegment[auto,rotate=0,xshift=0.3mm,yshift=-0.7mm](A,B){Adjacent Side}
    \tkzLabelSegment[auto,rotate=90,xshift=15.3mm,yshift=3.8mm](B,C){Opposite Side}

    %% here use the correct order. For example, BCA is inner angle and ACB is outer angle
    \tkzMarkAngle[size=0cm,color=red,mark=](C,A,B)
    \tkzMarkAngle[size=1cm,color=black,mark=](C,A,B)
    \tkzMarkRightAngle(C,B,A)
    \tkzLabelAngle[pos=1.4](C,A,B){$\theta$}
\end{tikzpicture}
    \end{minipage}  \\  
    \end{document}

答案1

在包含图片的迷你页面顶部使用\begin{minipage}[t],和。最后使用 。\vspace{0pt}\medskip

我对页眉和页脚的定义做了一些更改;我还headheight=14.5pt根据要求添加了内容fancyhdr

我不建议\large一开始就使用。如果你想要 14pt 大小(但它真的大),extarticle使用该14pt选项加载类(headheight并按fancyhdr建议进行设置)。

不要使用\flushright(这会启动一个环境,但方式错误):在这种情况下\raggedleft是正确的命令。哦,不要用它\\来结束段落:永远不能

\documentclass[12pt, letterpaper]{article}
\usepackage[
  a4paper,
  top=1in,
  bottom=1in,
  left=0.7in,
  right=0.7in,
  headheight=14.5pt,
]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[misc]{ifsym}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{forest}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usetikzlibrary{intersections}
\makeatother
\usepackage{fancyhdr}
\pagestyle{fancy}
\usepackage{lastpage}

\fancyhf{}
\fancyfoot[R]{Page \thepage \hspace{1pt} of \pageref{LastPage}}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}

\begin{document}

This is the first line. And why there is some blanks space between the first and second line

\begin{minipage}[t]{0.45\textwidth}
In $\triangle{ABC}$ $\angle B = 90^{\circ}$.

By using Pythagoras' Theorem,
\begin{align*}
AC^2&=AB^2+BC^2& \tag{$*$}
\end{align*}
\end{minipage}\hspace{\fill}%
\begin{minipage}[t]{0.45\textwidth}
\vspace{0pt} % to anchor the minipage at the very top
\raggedleft
\begin{tikzpicture}

    \tkzDefPoint(0:0){B}
    \tkzDefPoint(0:5){A}
    \tkzDefPoint(90:4){C}

    \tkzLabelPoint[above](C){$C$}
    \tkzLabelPoint[below,yshift=-0.6mm](A){$A$}
    \tkzLabelPoint[below,yshift=-0.8mm](B){$B$}

    \tkzDrawSegment[black!60!black](C,B)
    \tkzDrawSegment[black!60!black](B,A)
    \tkzDrawSegment[black!60!black](C,A)

    \tkzLabelSegment[auto,swap,rotate=-38.5,xshift=-15mm,yshift=0mm](A,C){Hypotenuse}
    \tkzLabelSegment[auto,rotate=0,xshift=0.3mm,yshift=-0.7mm](A,B){Adjacent Side}
    \tkzLabelSegment[auto,rotate=90,xshift=15.3mm,yshift=3.8mm](B,C){Opposite Side}

    %% here use the correct order. For example, BCA is inner angle and ACB is outer angle
    \tkzMarkAngle[size=0cm,color=red,mark=](C,A,B)
    \tkzMarkAngle[size=1cm,color=black,mark=](C,A,B)
    \tkzMarkRightAngle(C,B,A)
    \tkzLabelAngle[pos=1.4](C,A,B){$\theta$}
\end{tikzpicture}
    \end{minipage}

\medskip

Some text after the picture.

\end{document}

在此处输入图片描述

相关内容