居中問題

居中問題

我想將item清單中的一個居中,而不將清單編號置中。

\section*{Redovisning}
\begin{enumerate}
    \item  \begin{equation}
        f(x) = x(x-2)\end{equation}
    \vspace{0.3cm}  
    \begin{equation}
        g(x) = x(2-x)\end{equation}
    \vspace{0.3cm}
    \item {$\frac{8}{3}$ a.e.}
    \item  \begin{equation}
    \int\limits_a^b f(x) \, \mathrm{d} x
    \end{equation}
    \vspace{0.3cm}      
    \item 
\end{enumerate}

一切看起來都很好,除了\item {$\frac{8}{3}$ a.e.}.我嘗試過的所有內容要么全部居中,要么刪除了項目編號。

答案1

我想將清單中的一項居中,而不將清單編號置中。

從範例程式碼的其餘部分來看,我假設您不僅希望將術語居中設置,$\frac{8}{3}$ a.e.還希望 (a) 在顯示數學模式下對其進行排版,以及 (b) 將其單獨顯示在一行上。如果這些假設正確,我建議您使用未編號的顯示數學組,以 開頭\[和結尾\]

在此輸入影像描述

\documentclass{article} % remove "demo" 
\usepackage{amsmath}
\begin{document}
\section*{Redovisning}
\begin{enumerate}
    \item  
        \begin{align}
        f(x) &= x(x-2)\\
        g(x) &= x(2-x)
        \end{align}
    \item
        \[
        \frac{8}{3}\ \text{a.e.}
        \]
    \item  
        \begin{equation}
        \int_a^b f(x) \, \mathrm{d}x
        \end{equation}
\end{enumerate}
\end{document}

相關內容