(抱歉我的英语不好)我正在使用枚举命令。但它产生了不同的对齐。如下所示。为什么会发生这种情况?我想使用第一种情况,但要在第二种情况下进行对齐。可能吗?谢谢。
\documentclass[a4paper,brazil, 12pt]{report}
\usepackage{amsmath,amsfonts,amscd,bezier}
\usepackage{amssymb}
\usepackage{babel}
\usepackage[latin1]{inputenc}
\usepackage[dvips]{graphicx}
\usepackage{color}
\usepackage{hyperref}
\usepackage{enumerate}
\usepackage{multicol}
\usepackage{tasks}
\begin{document}
\pagestyle{myheadings} \thispagestyle{empty}
\begin{enumerate}[(a)]
\item $\displaystyle f(x) = x^4 - 2x^3 + 2x$
\item $\displaystyle f(x) = xe^{-2x}$
\item $\displaystyle f(x) = e^{-x} - e^{-2x}$
\item $\displaystyle f(x) = \sqrt[3]{x^2 - x^3}$
\item $\displaystyle f(x) = \frac{x^3}{1 + x^2}$
\item $\displaystyle f(x) = x \ln x$
\item $\displaystyle f(x)=xe^{\frac{1}{x}}$.
\item $\displaystyle f(x)=\frac{x^3}{x^2-1}$.
\end{enumerate}
\begin{enumerate}
\item[(a)] $\displaystyle f(x) = x^4 - 2x^3 + 2x$
\item[(b)] $\displaystyle f(x) = xe^{-2x}$
\item[(c)] $\displaystyle f(x) = e^{-x} - e^{-2x}$
\item[(d)] $\displaystyle f(x) = \sqrt[3]{x^2 - x^3}$
\item[(e)] $\displaystyle f(x) = \frac{x^3}{1 + x^2}$
\item[(f)] $\displaystyle f(x) = x \ln x$
\item[(g)] $\displaystyle f(x)=xe^{\frac{1}{x}}$.
\item[(h)] $\displaystyle f(x)=\frac{x^3}{x^2-1}$.
\end{enumerate}
\end{document}
答案1
使用enumitem
,带选项代替[shortlabels]
枚举。使用键before=\everymath{displaystyle}
,您不必displaystyle
为每个项目的每个公式键入。此外,最好使用utf8
输入编码,这是所有现代编辑器的默认设置:
\documentclass[a4paper,brazil, 12pt]{report}
\usepackage{amsmath,amsfonts,amscd,bezier}
\usepackage{amssymb}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage[dvips]{graphicx}
\usepackage{color}
\usepackage{hyperref}
\usepackage[shortlabels]{enumitem}
\usepackage{multicol}
\usepackage{tasks}
\usepackage[showframe]{geometry}
\begin{document}
\pagestyle{myheadings} \thispagestyle{empty}
\begin{enumerate}[(a), before = \everymath{\displaystyle}]
\item $ f(x) = x^4 - 2x^3 + 2x$
\item $ f(x) = xe^{-2x}$
\item $ f(x) = e^{-x} - e^{-2x}$
\item $ f(x) = \sqrt[3]{x^2 - x^3}$
\item $ f(x) = \frac{x^3}{1 + x^2}$
\item $ f(x) = x \ln x$
\item $ f(x)=xe^{\frac{1}{x}}$.
\item $ f(x)=\frac{x^3}{x^2-1}$.
\end{enumerate}
\begin{enumerate}
\item[(a)] $\displaystyle f(x) = x^4 - 2x^3 + 2x$
\item[(b)] $\displaystyle f(x) = xe^{-2x}$
\item[(c)] $\displaystyle f(x) = e^{-x} - e^{-2x}$
\item[(d)] $\displaystyle f(x) = \sqrt[3]{x^2 - x^3}$
\item[(e)] $\displaystyle f(x) = \frac{x^3}{1 + x^2}$
\item[(f)] $\displaystyle f(x) = x \ln x$
\item[(g)] $\displaystyle f(x)=xe^{\frac{1}{x}}$.
\item[(h)] $\displaystyle f(x)=\frac{x^3}{x^2-1}$.
\end{enumerate}
\end{document}