What to do when you can't get Latex formatted correctly?

  • Context: LaTeX 
  • Thread starter Thread starter find_the_fun
  • Start date Start date
  • Tags Tags
    Latex
Click For Summary

Discussion Overview

The discussion revolves around troubleshooting LaTeX formatting issues, particularly in the context of posting on a forum. Participants share their experiences with common errors, suggest methods for debugging, and recommend tools for editing LaTeX code.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested
  • Mathematical reasoning

Main Points Raised

  • One participant suggests that LaTeX errors often stem from mismatched opening and closing braces, recommending the use of the preview function to verify code before submission.
  • Another participant proposes a method of simplifying complex expressions by substituting variables, which may help in identifying errors more easily.
  • Several participants share a specific LaTeX formula but express frustration with the lack of a preview feature for their equations.
  • Some participants note that adding spaces in LaTeX code can improve rendering and readability, suggesting it as a general practice.

Areas of Agreement / Disagreement

Participants express various strategies for addressing LaTeX formatting issues, but there is no consensus on a single best approach. Multiple viewpoints on debugging methods and formatting practices remain present.

Contextual Notes

Some participants mention the importance of readability in LaTeX code and the potential for errors due to formatting choices, but specific limitations or assumptions are not fully explored.

find_the_fun
Messages
147
Reaction score
0
What should one do when they cannot solve a Latex error? Should the report tool be used to get the attention of a moderator?

Also, can anyone recommend a light weight Latex editor for Windows? It can be quite challenging to type in long and complex equations.
 
Physics news on Phys.org
Re: What to do when can't get Latex formatted correctly?

After seeing the $\LaTeX$ error in your DiffEq topic, and having seen this many times myself, I can safely say that you probably do not have matching opening and closing braces. In my experience, the error has always been on my part, and it just takes going through the code to fix my mistake. I highly recommend using the preview function to make sure your code displays as you intend before submitting your post.
 
Re: What to do when can't get Latex formatted correctly?

I just wrote out a super long post where I tried to generalize approaching syntax with levels or layers in mind, but I think that idea is easy enough not to go crazy with examples now.

Start by replacing the trig expressions with A and B and you'll be left with a much easier line to scan. Once you get the form correct for A and B add back in the trig stuff. Once you establish that some step is working properly, you know immediately when you mess up as you work.

You could count opening brackets and closing brackets and hope that adding one or deleting one will even things out but that's a bit too random for me. It's better I think to approach the code in a few pieces so mistakes are never that time-wasting.
 
Re: What to do when can't get Latex formatted correctly?

I want show codecogs
by formula
Code:
 $\displaystyle \sum_{k=1}^{n-1}\sin\left(\frac{\left(2\left\lfloor\sqrt{kn}\right\rfloor+1\right)\pi}{2n}\right)=\cot\left(\frac{\pi}{2n}\right)\cos\left(\frac{\pi}{2n}\right)$

but no preview :(

$\displaystyle \sum_{k=1}^{n-1}\sin\left(\frac{\left(2\left\lfloor\sqrt{kn}\right\rfloor+1\right)\pi}{2n}\right)=\cot\left(\frac{\pi}{2n}\right)\cos\left(\frac{\pi}{2n}\right)$
 
Re: What to do when can't get Latex formatted correctly?

hxthanh said:
I want show codecogs
by formula
Code:
 $\displaystyle \sum_{k=1}^{n-1}\sin\left(\frac{\left(2\left\lfloor\sqrt{kn}\right\rfloor+1\right)\pi}{2n}\right)=\cot\left(\frac{\pi}{2n}\right)\cos\left(\frac{\pi}{2n}\right)$

but no preview :(

$\displaystyle \sum_{k=1}^{n-1}\sin \left(\frac{\left(2\left\lfloor\sqrt{kn} \right\rfloor+1\right)\pi}{2n}\right)=\cot\left( \frac{\pi}{2n} \right)\cos\left(\frac{\pi}{2n}\right)$

You need to add in a space every so often with Mathjax. I added in some random spaces along the way and now it renders fine. :)

\displaystyle \sum_{k=1}^{n-1}\sin \left(\frac{\left(2\left\lfloor\sqrt{kn} \right\rfloor+1\right)\pi}{2n}\right)=\cot\left( \frac{\pi}{2n} \right)\cos\left(\frac{\pi}{2n}\right)
 
Re: What to do when can't get Latex formatted correctly?

Jameson said:
You need to add in a space every so often with Mathjax. I added in some random spaces along the way and now it renders fine. :)

\displaystyle \sum_{k=1}^{n-1}\sin \left(\frac{\left(2\left\lfloor\sqrt{kn} \right\rfloor+1\right)\pi}{2n}\right)=\cot\left( \frac{\pi}{2n} \right)\cos\left(\frac{\pi}{2n}\right)

I kinda feel like you should add spaces in LaTeX code either way, just for the sake of readability.. I know I, like other people, occasionally right-click to see how an equation was written.​
 

Similar threads

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