Вход на сайт

Просмотр новости

Найдите то, что Вас интересует

Comment on Prevent Line Breaking Inline Formula in TeX/LaTeX by Jonathan Levi

Дата публикации: 13-06-2026 23:25:53

If you need the math line to be unbreakable only at (a) certain place(s) I've found (on the basis of a single experience, with plain TeX) that you can enclose the unbreakable portion in brackets, e.g.
[Breakable text]
{\relpenalty=10000
[unbreakable expression]
}
[More breakable text]

Основное содержимое страницы с новостью.

Skip to content

If you ever wrote a document in LaTeX (or TeX) that used inline formulas, you know how frustrating it is when LaTeX insists on breaking your inline formula across two lines. The easiest solution to this problem, in my opinion, is to prevent line breaks in inline formulas at all except under extreme cases. To prevent line breaks in inline formulas, just add the following two lines to your preamble:

relpenalty=9999
binoppenalty=9999

Now I will explain what we did. relpenalty=[number parameter]: the parameter specifies the penalty for breaking a math formula after a relation when the formula appears in a paragraph. Plain TeX sets relpenalty to 500. binoppenalty=[number parameter]: the parameter specifies the penalty for breaking a math formula after a binary operator when the formula appears in a paragraph. Plain TeX sets binoppenalty to 700. Both parameters can be set anywhere from 0 to 10000. If set to 10000, the inline formulas will never break, even in extreme cases. Setting it a bit lower would prevent line breaking except where TeX would encounter extreme cases that must have a line break because of the situation.

Post navigation

Схожие новости

#Наименование новостиТональностьИнформативностьДата публикации
1Let table rows wrap over several lines07.9803-10-2026
2Can’t split topic (replies)05.129-06-2026
3 Comment on USB Keyboard Not Working in Dracut When Connected via Thunderbolt Dock by Guy 08.414-06-2026
4Three things I decided not to parse, building a live-preview editor012.6927-08-2026
5Reply To: A Lovable Clonewebx file not resizing to full page width. Theme constraint?08.1901-10-2026
6Using link reference definitions as invisible structural markers — sound, or a bad idea?01027-09-2026
7 Comment on How to Embed an MP4 Video in WordPress (Block Editor, Classic, HTML, Shortcode, & Plugin) by Konstantin Obenland 07.6503-03-2026
8Post adjustment for rigid thread011.4902-10-2026
9Prevent replies to posts?01526-04-2026

Классификация: . Схожих патентов: 0. Схожих новостей: 9. Тональность: 0. Информативность: 6.46. Источник: www.guyrutenberg.com.