Can I improve depth reading of my Latex?

  • Topic: LaTeX 
  • Thread starter Thread starter arildno
  • Start date Start date
Join the discussion
Registration is free. Start your own thread to ask a follow-up.
4 replies · 728 views
Science Advisor
Homework Helper
Gold Member
Dearly Missed
Messages
10,165
Reaction score
138
Hi there!
Consider my answer in: https://www.physicsforums.com/showthread.php?t=711324
I had to make a clunky split into two tex-commands, because if I tried to write it as a single one, Latex wouldn't read one of my fraction commands.

I have experienced this before, and wonder if there is some forcing command I can use, or some other device.

Thanks in advance.
 
Physics news on Phys.org
I don't know why it does it, but it seems to not like

Code:
}+\frac

So

Code:
[tex]\sin(\sqrt{x+Dx})=\sin(\frac{\sqrt{x}}{\sqrt{1+\frac{Dx}{\sqrt{x}}}}+\frac{\frac{Dx}{\sqrt{x}}}{\sqrt{1+\frac{Dx}{\sqrt{x}}}})[/tex]

is broken:

[tex]\sin(\sqrt{x+Dx})=\sin(\frac{\sqrt{x}}{\sqrt{1+\frac{Dx}{\sqrt{x}}}}+\frac{\frac{Dx}{\sqrt{x}}}{\sqrt{1+\frac{Dx}{\sqrt{x}}}})[/tex]

but

Code:
[tex]\sin(\sqrt{x+Dx})=\sin(\frac{\sqrt{x}}{\sqrt{1+\frac{Dx}{\sqrt{x}}}}
+\frac{\frac{Dx}{\sqrt{x}}}{\sqrt{1+\frac{Dx}{\sqrt{x}}}})[/tex]

is fine

[tex]\sin(\sqrt{x+Dx})=\sin(\frac{\sqrt{x}}{\sqrt{1+\frac{Dx}{\sqrt{x}}}}<br /> +\frac{\frac{Dx}{\sqrt{x}}}{\sqrt{1+\frac{Dx}{\sqrt{x}}}})[/tex]

So it seems that adding some carriage returns will work without actually using tex or html commands to split the lines.
 
hmm..interesting! Thanks!
 
The forum software doesn't like "words" (things without a space or newline) that are more than fifty characters long. The solution is simple: Use whitespace!

When you are writing a "real" LaTeX document, it's best to use whitespace (*lots* of whitespace) for the sake of those who are reading the LaTeX rather than the generated document. Think of it as writing computer code. Which is more readable?

Code:
r=std::max((arrays.lin_alg_1*std::abs(data_prepj.yj)),(data_prepj.r0/arrays.error_weight[0]));

versus

Code:
r = std::max( arrays.lin_alg_1 * std::abs(data_prepj.yj) ,
              data_prepj.r0 / arrays.error_weight[0] );

The same rules apply to LaTeX. You aren't writing a document so much as programming it. Use lots of whitespace. You'll never run into the forum's 50 character limit if you apply these rules out of habit.
 
D H said:
The forum software doesn't like "words" (things without a space or newline) that are more than fifty characters long. The solution is simple: Use whitespace!

When you are writing a "real" LaTeX document, it's best to use whitespace (*lots* of whitespace) for the sake of those who are reading the LaTeX rather than the generated document. Think of it as writing computer code. Which is more readable?

Code:
r=std::max((arrays.lin_alg_1*std::abs(data_prepj.yj)),(data_prepj.r0/arrays.error_weight[0]));

versus

Code:
r = std::max( arrays.lin_alg_1 * std::abs(data_prepj.yj) ,
              data_prepj.r0 / arrays.error_weight[0] );

The same rules apply to LaTeX. You aren't writing a document so much as programming it. Use lots of whitespace. You'll never run into the forum's 50 character limit if you apply these rules out of habit.

Okay! :smile: