為什麼描述清單中的 pmatrix 會破壞文件流?

為什麼描述清單中的 pmatrix 會破壞文件流?

提供MWE的程式碼

\documentclass{article}

\usepackage{amsmath}

\usepackage[brazil]{babel}   
%\usepackage[latin1]{inputenc}  
\usepackage[utf8]{inputenc}  
% UTF-8 encoding is recommended by ShareLaTex

\title{MWE}

\begin{document} 

\maketitle

\section{Grande Resumo de Álgebra}

\begin{description}

\item[Igualdade de Matrizes] \hfill \\Duas matrizes são iguais se tem a mesma dimensão e elementos iguais.

\item[Matriz Transposta] \hfill \\Troca de posição as linhas e as colunas.\\
A = \begin{pmatrix} 3 & -2 & 4 \\ 1 & 3 & 7 \end{pmatrix}
\Rightarrow 
A' = \begin{pmatrix} 3 & 1 \\ -2 & 3 \\ 4 & 7 \end{pmatrix} 

A transposta da transposta é a matriz original.\\
(A^{t})^{t} = A

\item[Matriz Simétrica] \hfill \\Quando a transposta da matriz é a mesma matriz original, dizemos que a matriz é simétrica. A^{t} = A\\
A = \begin{pmatrix} 3 & 2 & 6 \\ 2& 10 & -7 \\ 6 & -7 & 9 \end{pmatrix} 

Toda Matriz Simétrica é quadrada.

\item[Matriz Diagonal] \hfill \\É uma matriz que contém zeros em todas as posições fora da diagonal.\\
A = \begin{pmatrix} 2 & 0 & 0 \\ 0 & 3 & 0 \\ 0 & 0 & 11 \end{pmatrix}

\end{description}

\end{document}

我想為什麼我的描述清單中的文檔流被破壞了,所以我注意到在我第一次矩陣出現後文檔流被破壞了。

你們知道如何解決或避免這種情況嗎?我想寫一個清單來總結一些數學科目,但我想在清單中寫一些範例。我可以在沒有清單的情況下做到這一點,但會給我更多的工作。

有任何想法嗎?

感謝您的幫助,加油!

pmatrix 內部描述

答案1

問題是您需要將數學包含在內聯方程式和顯示方程中$...$或用於內聯方程式和顯示方程式。由於您沒有這樣做,您的程式碼無法編譯(存在錯誤!),這會導致描述環境被破壞。\(...\)\[...\]

就風格而言,與其使用\\插入顯式換行符,不如將對應的方程式置於顯示模式。這樣做會為您帶來以下結果:

在此輸入影像描述

編輯 我建議\\\hfil使用列舉項包裹。如果您載入此包,則使用以下命令啟動您的描述環境

\begin{description}[labelwidth=\textwidth]

將使這自動發生。這是更正後的代碼:

\documentclass{article}
\usepackage{amsmath}
\usepackage{enumitem}
\usepackage[brazil]{babel}
%\usepackage[latin1]{inputenc}
\usepackage[utf8]{inputenc}
% UTF-8 encoding is recommended by ShareLaTex

\begin{document}
\begin{description}[labelwidth=\textwidth]
  \item[Igualdade de Matrizes]
  Duas matrizes são iguais se tem a mesma dimensão e elementos iguais.

  \item[Matriz Transposta]
  Troca de posição as linhas e as colunas.
  \[ A = \begin{pmatrix} 3 & -2 & 4 \\ 1 & 3 & 7 \end{pmatrix}
  \Rightarrow
  A' = \begin{pmatrix} 3 & 1 \\ -2 & 3 \\ 4 & 7 \end{pmatrix}
  \]
  A transposta da transposta é a matriz original.
  \[(A^{t})^{t} = A\]

  \item[Matriz Simétrica]
  Quando a transposta da matriz é a mesma matriz original, dizemos que a matriz é simétrica. $A^{t} = A$
  \[A = \begin{pmatrix} 3 & 2 & 6 \\ 2& 10 & -7 \\ 6 & -7 & 9
  \end{pmatrix}\]

  Toda Matriz Simétrica é quadrada.

  \item[Matriz Diagonal]
  É uma matriz que contém zeros em todas as posições fora da diagonal.
  \[A = \begin{pmatrix} 2 & 0 & 0 \\ 0 & 3 & 0 \\ 0 & 0 & 11 \end{pmatrix}\]
\end{description}
\end{document}

相關內容