GeneralIssue with adjusting equations in a line

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
omkardpd
Posts: 86
Joined: Sun Feb 24, 2008 7:23 am

Issue with adjusting equations in a line

Post by omkardpd »

Hi,

I have mathematical expressions (eg. a < b < c) in sentences. I use $expression$ form. Sometimes, I get the entire expression in one line and at other times it breaks-off between two consecutive lines. Sometimes, the expression fits within the page margin in one line and at other times the entire expression sits in one line but a portion of it falls outside the margin. Sometimes, only comma or full-stop falls on the next line. Is there a smarter way to have automatic and sensible adjustment of such expressions or do I have to track such expressions every time and adjust length manually (say by using \mbox or \hspace)?

Thank you,

Omkar

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

omkardpd
Posts: 86
Joined: Sun Feb 24, 2008 7:23 am

equation margin

Post by omkardpd »

Hello,

How do I control a mathematical portion of a statement (written as $*****$) from going out of the page margin? I did not see any pattern in it going out of margin at one place and being written on two consecutive lines by cutting the expression in between. Please find the attached document to see what I am talking about.

Thank you,

Omkar
Attachments
margin issue.JPG
margin issue.JPG (24.42 KiB) Viewed 3239 times
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Issue with adjusting equations in a line

Post by localghost »

omkardpd wrote:[...] Is there a smarter way to have automatic and sensible adjustment of such expressions or do I have to track such expressions every time and adjust length manually (say by using \mbox or \hspace)? [...]
I'm not aware of any automatism to get a line break as desired. Perhaps you can change some internal parameters to influence this behaviour.

Code: Select all

\emergencystretch2em
\tolerance2000
These lines go into the preamble of your document.

Remark: Next time if you got no answer to a request, please use the old topic and bump it up by renewing your request with an additional post.


Best regards
Thorsten¹
omkardpd
Posts: 86
Joined: Sun Feb 24, 2008 7:23 am

Re: Issue with adjusting equations in a line

Post by omkardpd »

Hi Thorsten,

Thank you for the prompt reply. Your suggestion has solved my problem. Sorry for putting up a separate request message with the same content.

Thank you once again.

Omkar
phi
Posts: 577
Joined: Tue Oct 21, 2008 8:10 pm

Issue with adjusting equations in a line

Post by phi »

omkardpd wrote:I did not see any pattern in it going out of margin at one place and being written on two consecutive lines by cutting the expression in between.
TeX can break inline math expressions after relational (<, >, …) and binary (+, −, …) operators. Your first example contains such an operator, your second doesn't. You should see the warning "overfull \hbox" during compilation.

Changing the hyphenation parameters is possible, but can lead to unpleasant line breaks. Sometimes it is better to convert longer inline formulas to displayed equations.
Post Reply