如何自定义对齐一大块文本?

如何自定义对齐一大块文本?

我刚刚开始使用 LaTex,遇到了麻烦。下面附有一张图片。本质上,我不知道如何只缩进段落的第二行。在此处输入图片描述

我希望“公式”排列在“查找”下。以下是我的 LaTex 链接:关联

答案1

最好使用 将项目设置为列表enumerate。您可以使用以下方式格式化演示文稿enumitem

在此处输入图片描述

\documentclass[12pt, letterpaper]{article}

\usepackage[margin=1in]{geometry}
\usepackage{amsmath}
\usepackage{fancyhdr,enumitem}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}

\author{not gonna make it that easy}
\title{Math Homework}

\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\setlength{\headheight}{40pt}

\fancyhf{}
\rhead{
  nope           \\
  AP Calculus AB \\
  \today
}
\rfoot{Page \thepage}

\setlist[enumerate,1]{font=\bfseries,label=\arabic*.}
\setlist[enumerate,2]{font=\bfseries\itshape,label=\Alph*)}
\setlength{\parindent}{0pt}% Remove paragraph indent

\begin{document}

{\huge\bfseries \LaTeX{} Homework Intro}

%%%%%%%%%%%%%%%%%%%%%%%%%   

\itshape
\begin{enumerate}
  \item
  \begin{enumerate}
    \item
    Find the sum of $34$ and $126$ using a calculator.
    \[
       34 + 126 = \boxed{160}
    \]

    \item
    Find the sum of $24$ and $126$ by hand.
    \[
      \setlength{\arraycolsep}{.5\arraycolsep}%
      \begin{array}{ r }
              34 \\
        {} + 126 \\
        \hline
             160
       \end{array}
    \]
     
%%%%%%%%%%%%%%%%%%%%%%%%%%%%     
  \end{enumerate}
  
  \item
  \begin{enumerate}
    \item
    Find the roots of the quadratic equation $f(x) = x^2 + 2x - 3$ using the quadratic formula.
    \begin{align*}
      x &= \frac{-2 \pm \sqrt{2^2 - 4(1)(-3)}}{2(1)} \\
      x &= \frac{-2 \pm \sqrt{16}}{2} = \frac{-2 \pm 4}{2} = \boxed{1, -3}
    \end{align*}
  
    \item
    Determine the roots of that same equation by graphing.
     
    \begin{center}
      \begin{tikzpicture}
        \begin{axis}[
          xlabel=$x$,
          ylabel=$y$,
          xmin=-4,xmax=2, ymin=-5, ymax=2
        ]
          \addplot{x^2+2*x-3};
          \addplot[mark=*, red, only marks]
          plot coordinates {
            (-3, 0)
            (1, 0)
          };
        \end{axis}
      \end{tikzpicture}
    \end{center}
     
     %%%%%%%%%%%%%%%%%%%
  \end{enumerate}
  
  \item
  Find the derivative of $x^x$.
  \begin{align*}
    \frac{\mathrm{d}}{\mathrm{d}x}(x^x) &= \frac{d}{dx} \bigl( e^{x \ln x} \bigr) \\
                                        &= e^{x \ln x} \cdot \bigl( \ln x + x \bigl( \tfrac{1}{x} \bigr) \bigr) \\
                                        &= \boxed{x^x \cdot (\ln x + 1)}
  \end{align*}

\end{enumerate}

\end{document}

相关内容