Can I improve depth reading of my Latex?

  • Context: LaTeX 
  • Thread starter Thread starter arildno
  • Start date Start date
Click For Summary

Discussion Overview

The discussion revolves around issues related to formatting LaTeX commands in a forum setting, specifically addressing problems with line breaks and character limits in LaTeX expressions. Participants explore potential solutions and best practices for improving readability and functionality when posting LaTeX code.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Conceptual clarification

Main Points Raised

  • One participant describes a problem with LaTeX not reading a fraction command when combined with other commands, suggesting a need for a forcing command or alternative approach.
  • Another participant notes that adding carriage returns seems to resolve the issue without needing to split commands explicitly.
  • Some participants propose that the forum software has limitations with long "words" (commands without spaces or newlines) exceeding fifty characters, recommending the use of whitespace to enhance readability.
  • There is a suggestion that writing LaTeX should be approached similarly to programming, emphasizing the importance of whitespace for clarity.

Areas of Agreement / Disagreement

Participants generally agree on the importance of using whitespace in LaTeX for better readability and to avoid issues with the forum's character limits. However, there is no consensus on a definitive solution to the initial problem with the fraction command.

Contextual Notes

Participants express uncertainty regarding the specific mechanics of LaTeX commands in the forum context, particularly how formatting affects command recognition and display.

arildno
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:

\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}}}})

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

\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}}}})

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:
 

Similar threads

  • · Replies 12 ·
Replies
12
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 9 ·
Replies
9
Views
6K