Minipage 中的空白区域

Minipage 中的空白区域

代码:

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{makeidx}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
\usepackage{graphicx}
\usepackage[width=0.00cm, height=0.00cm, left=0.80in, right=0.80in, top=0.80in, bottom=0.80in]{geometry}
\begin{document}
    \large
\noindent\begin{minipage}{0.5\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{2cm}
    \begin{minipage}{0.5\textwidth}
\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

我建议您 (a) 使minipage环境稍微窄一些,例如,0.45\textwidth而不是0.5\textwidth; (b) 在它们之间插入; (c)在右侧的开头\hspace{\fill}插入一条指令。 (默认情况下, 中的项目是完全对齐的,即,它们从左边缘开始。)\flushrightminipageminipage

在此处输入图片描述

\documentclass[12pt,a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{makeidx}
\usepackage{tkz-euclide}
\usetkzobj{all}
\usetikzlibrary{calc,angles,positioning,intersections,quotes,decorations.markings}
%\usepackage{graphicx}
\usepackage[margin=0.8in]{geometry}
\begin{document}
\large
\noindent
\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}

相关内容