2

I had no idea that changing page margin size can cause problems with line break with in-line math. I have this MWE that shows one problem.

I like to make the page margins smaller, so I can fit more things on the page. But when I do that, sometimes I notice problems, like this:

enter image description here

\documentclass[12pt]{article}
%uncommenting this line below shows the problem
%\usepackage[left=.7in,right=.7in,top=.9in,bottom=.9in]{geometry}

\begin{document}
So the point $p$ appears to move is the opposite direction with tangential
acceleration $-\left(  \sqrt{13}\dot{\omega}_{3}\right)  \sin\theta
\mathbf{i-}\left(  \sqrt{13}\dot{\omega}_{3}\right)  \cos\theta\mathbf{k}$ and
normal acceleration $-\left(  \sqrt{13}\omega_{3}^{2}\right)  \cos
\theta\mathbf{i+}\left(  \sqrt{13}\omega_{3}^{2}\right)  \sin\theta\mathbf{k}$
Where $\theta=\tan^{-1}\left(  \frac{3}{2}\right)  $, hence $\cos\theta
=\frac{2}{\sqrt{13}}$ and $\sin\theta=\frac{3}{\sqrt{13}}$therefore%        
\end{document}

Using TL 2013. ps. code above is auto-generated.

Do I really have to worry about these problems if I change page size? I thought Latex math breaking algorithm is supposed to take care of these things automatically? Or Am I doing something wrong?

Nasser
  • 20,220
  • TeX only breaks math content at specific locations - around binary relations and operators. Not around "atoms". So, of course, changing the geometry could cause different elements to fall close to the line-break, causing the problem. In such cases, rewording the sentence is a viable option for changing the breaking point (apart from initiating possible breaking points inside the math structure). – Werner Oct 22 '13 at 22:29
  • @Werner thanks. I had no idea. This means each time one changes page margin, they need to go review it all over and change latex code if needed. The problem, I never can make up my mind on what margin size to use, and keep changing them all the time. – Nasser Oct 22 '13 at 22:32
  • That "never" has to have an end, which should be just before you consider the work to be complete (publishing, archiving, or whatever). Then you can skim over the entire document and take care of such (minor) things. – Werner Oct 22 '13 at 22:34
  • 1
    tex doesn't break lines between \left..\right so if you want line breaking you should remove most of those. (there is also a space missing before therefore) – David Carlisle Oct 22 '13 at 22:59
  • If you write longer paragraphs with more text then TeX paragraph engine tends to be kinder to you, because it has more potential break points to play with. It's also important not to omit periods (like you have before "Where") or spaces (as you have before "therefore") as these all affect the paragraph breaking algorithm. TeX considers the whole paragraph when trying to come up with the best set of line breaks. You might also like to make your formulae shorter: eg use $r\sin\theta...$ instead of writing the explicit value. – Thruston Oct 22 '13 at 22:59
  • As David says, one of the common errors is to think that adding \left and \right before all delimiters is a good thing. To the contrary, it is a bad thing, because it freezes spaces around binary operators so they can't participate to the space adjustments for justification and they make the formula unbreakable inside them. In this particular case, after removing them still an overfull line is produced: you're unlucky because you have to quite long formulas near to each other. – egreg Oct 22 '13 at 23:12
  • Thanks to all for comments. But as I said, this is auto generated code by Scientific word. I do not look at the code, but look at the screen. What I see on the screen looks fine to me. So I do not see these problems you mention on the screen. Here is a screen shot of the problem area: Mathematica graphics – Nasser Oct 23 '13 at 01:20
  • sadly, another weakness of scientific word. as a user, you could complain. (this does cause problems in production at ams.) – barbara beeton Oct 23 '13 at 07:41
  • @barbarabeeton I am not going to defend the Latex code quality generated by SW, but for me, the time saved in writing my HW's and reports using SW vs. direct Latex coding is really critical. I can write something in 5% the time using SW vs. direct Latex coding (and it is more fun also). Yes, there are some problems with SW, but overall, still its benefits far outweigh its problems (for me). I only use it as a screen editor really, to enter the math, but use TL 2013 to build everything. (It also has a computer algebra program build-in, which is very useful and saves me lots of time). – Nasser Oct 23 '13 at 13:24
  • @Werner if you like to make your comment as answer, so I can accept it and close this question please. – Nasser Oct 24 '13 at 15:32
  • Nasser, you have more experience now. Can you provide a self answer? Maybe summarizing the comments? Seems like @werner didn't want to answer. – Johannes_B Mar 15 '15 at 17:39
  • @Johannes_B: This may have not found me. I'll convert my comments into an answer. – Werner Mar 15 '15 at 17:52

1 Answers1

3

TeX only breaks math content at specific locations - around binary relations and operators. Not around "atoms". So, of course, changing the geometry could cause different elements to fall close to the line-break, causing the problem. In such cases, rewording the sentence is a viable option for changing the breaking point (apart from initiating possible breaking points inside the math structure).

Wait until "the last minute" once you've finalized your page layout. This should be just before you consider the work to be complete (publishing, archiving, or whatever). Then you can skim over the entire document and take care of such (minor) things.

Werner
  • 603,163