數學模式下沒有連字符的連字符

數學模式下沒有連字符的連字符

我希望能夠在數學模式下分隔公式,而不會出現連字符“-”。我知道沒有數學模式它適用於“”。

例子 採取這個公式:

$Algorithms = (Generate, Add, Delete, Setup, Calculate)$

使用連字符就沒問題:

$Algorithms\- = (Generate,\- Add,\- Delete,\- Setup,\- Calculate)$

但這是行不通的:

$Algorithms"" = (Generate,"" Add,"" Delete,"" Setup,"" Calculate)$

相反,它顯示“”

在此輸入影像描述

我很感激任何幫助!

答案1

您不應該在數學模式下使用單字而不將它們包裝在\mathrm或類似的命令中。

如果您想在逗號後允許換行,請使用

,\linebreak[0]

順便說一句,""是 或其他語言的簡寫babel-german,但其目的不是您所聲稱的,並且正如您發現的那樣,它在數學模式下不起作用。

不管怎樣,這麼長的公式最好排版在顯示器上。

\documentclass{article}
\usepackage{amsmath}

\begin{document}

Some words to see what happens
$\mathrm{Algorithms} = (\mathrm{Generate}, \mathrm{Add},
  \mathrm{Delete},\linebreak[0] \mathrm{Setup},\linebreak[0] \mathrm{Calculate})$ and other words
$\mathrm{Algorithms} = (\mathrm{Generate}, \mathrm{Add},
  \mathrm{Delete}, \mathrm{Setup},\linebreak[0] \mathrm{Calculate})$ and other words

But it's better in a display
\[
\mathrm{Algorithms} = (\mathrm{Generate}, \mathrm{Add},
  \mathrm{Delete}, \mathrm{Setup}, \mathrm{Calculate})
\]
so no splitting problem appears.

\end{document}

在此輸入影像描述

相關內容