可以自動斷線嗎?

可以自動斷線嗎?

在編寫乳膠文件時,數學文字可能會被放入兩個不同的行中,但顯然這可能會令人不快,因此我想使用以下解決方案來面對這個問題。

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}

\begin{document}
    \noindent
    This is an example of unbroken line.

    %\vspace{0.1cm}
    
    \noindent
    By the equation above we argue that the following equation (by Euler) $e^{i\pi}+1=0$ which is useful.

    \vspace{1cm}

    \noindent
    This is an example of \textbf{manually} broken line

    %\vspace{0.1cm}
    
    \noindent
    By the equation above we argue that the following equation (by Euler) 
    \linebreak
    $e^{i\pi}+1=0$ which is useful.
\end{document}

然而我不喜歡它,因為它不僅僅是自動的,所以如果我修改文本,那麼我必須記住我插入了命令\linebreak ,它將在編輯後刪除:所以這可能會在一個長文檔中導致許多“錯誤”,所以我想在這裡提出一個具體問題,我詢問是否有一些命令可以放入序言中自動執行此操作。那麼有人可以幫助我嗎?

答案1

您可能正在尋找類似的東西,可以{}防止數學中的斷行

\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{parskip}
\begin{document}
    
    This is an example of unbreaked line.

    
    By the equation above we aruge that the following equiation (by Euler) $e^{i\pi}+1=0$ which is usefull.


    This is an example of \textbf{manually} breaked line

  
    By the equation above we argue that the following equation (by Euler)
    $e^{i\pi}+1=0$ which is useful.
    
    By the equation above we argue that the following equation (by Euler)
    ${e^{i\pi}+1=0}$ which is useful.
\end{document}

但另請參閱

阻止 LaTeX 破壞內聯數學方程

相關內容