如何在同一行写更多单词

如何在同一行写更多单词

有什么方法可以写出数字三十七从下图中可以看到同一行上有等号?

enter image description here

\textbf{3.} Afla\c ti de\^ imp\u ar\c titul \c stiind c\u a \^ intre \^ imp\u ar\c titor, c\^ at \c si rest avem rela\c tia $i^2+c^2+r^2=37$.

谢谢!

答案1

我不会像 John Kormylo 建议的那样将数学公式括在里面\mbox,而是定义一个禁止在数学公式中换行的命令。事实上,这允许公式中的粘连可以与同一行上的其他粘连一起拉伸和收缩,而 John 的解决方案则不会。

% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly 
                                 % declare the paper format.

\usepackage[T1]{fontenc}         % Not always necessary, but recommended.
% End of standard header.  What follows pertains to the problem at hand.

\makeatletter

\newcommand*{\prohibitmathbreaks}{%
    \binoppenalty \@M
    \relpenalty \@M
}

\hyphenpenalty = \@M % ONLY for this example: DO NOT INCLUDE IN YOUR DOCUMENTS!

\makeatother



\begin{document}

Some meaningless text, inserted just to get near\ldots\ the end of the line.
\( x+y=a+b\prohibitmathbreaks \).
And some more random text that adds other lines, which~contain~an unbreakable
sequence of words, to show that the spaces inside the formula \emph{are} allowed
to shrink.

On the other hand, if one uses the \verb|\mbox| solution, this does not happen:
\mbox{\( x+y=a+b \).}
And: some more random text that adds other lines, which~contain 
unbreakable~sequences~of~words.

Another paragraph, containing another formula, in order to show that the effect
of our \verb|\prohibitmathbreaks| command is kept local:
\( a+b+c+d+e = x+y+z \).

\end{document}

输出:

Output of the code

相关内容