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

  • LaTeX
  • Thread starter find_the_fun
  • Start date
  • Tags
    Latex
In summary: 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.
  • #1
find_the_fun
148
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
  • #2
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.
 
  • #3
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.
 
  • #4
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)$
 
  • #5
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)
 
  • #6
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.​
 

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

Why is my Latex not formatting correctly?

There are several reasons why Latex may not be formatting correctly. One possibility is that there is an error in your code, such as missing brackets or incorrect syntax. Another possibility is that you are using a package or command that is not compatible with your document class. Additionally, there may be conflicts between different packages or settings in your document.

How can I troubleshoot Latex formatting issues?

To troubleshoot Latex formatting issues, you can start by checking your code for errors or inconsistencies. You can also try removing any packages or commands that may be causing conflicts. It may also be helpful to consult online resources or forums for common solutions to formatting problems.

Should I use a specific document class for better Latex formatting?

The choice of document class depends on the type of document you are creating. Some document classes may have better compatibility with certain packages or commands, but there is no one "best" document class for Latex formatting. It is important to choose a document class that suits your needs and is appropriate for your document type.

Can I use a WYSIWYG editor for Latex formatting?

No, Latex is a markup language and cannot be edited using a WYSIWYG editor. This is because Latex requires specific syntax and commands to format text and equations, which cannot be generated by a visual editor. It is important to learn the basics of Latex syntax in order to effectively use the language for formatting.

Are there any tools or resources that can help with Latex formatting?

Yes, there are several tools and resources available to help with Latex formatting. Some popular options include online editors such as Overleaf or ShareLatex, which provide templates and tutorials for beginners. There are also various packages and add-ons that can assist with specific formatting tasks, such as creating tables or formatting equations. Additionally, many online communities and forums offer support and advice for Latex users.

Similar threads

Replies
12
Views
2K
Replies
6
Views
3K
Replies
4
Views
3K
Replies
16
Views
3K
Replies
11
Views
5K
Replies
2
Views
5K
Replies
3
Views
877
Replies
1
Views
3K
Back
Top