Fixing Latex Errors: Tips for Achieving a Polished Document

In summary: Plus, if you submit a paper for publication, you don't want to have a bunch of warnings that will make you look sloppy or unprofessional. It's better to take the extra time to fix the errors now rather than risk causing bigger problems down the line.
  • #1
tgt
522
2
Do you do it? I tend to not do it as long as it looks fine.
 
Physics news on Phys.org
  • #2
What sort of errors do you mean? Errors in latex tend to make it not compile!
 
  • #3
cristo said:
What sort of errors do you mean? Errors in latex tend to make it not compile!

I've got 12 errors currently and I'm still able to edit and view it in PDF.
 
  • #4
tgt said:
I've got 12 errors currently and I'm still able to edit and view it in PDF.

You didn't really answer my question: what sort of errors are you talking about? Presumably you mean aesthetic errors, or typos?
 
  • #5
tgt said:
I've got 12 errors currently and I'm still able to edit and view it in PDF.
First thing to note here is that LaTeX has two types of "bad messages": Errors and Warnings (you may know this).

Errors mean that there is certainly something wrong and incomplete with your output. Even if you can view the output, likely some pages are missing or something. Fix those, by all means.

Warnings you can ignore, but shouldn't. They mean that for example some lines are too long (which look ugly) or labels and crossreferences are off. You will probably want to fix those as well.

Despite all this, cristos remarks still apply: You are certainly doing everyone (including yourself) a favor if you are as verbose (but concise!) about your problem as you can. It is usually best to flat out post exactly what you have and what is not working. So copy the errors latex gives you from the command line (this should work by selecting all the relevant output with the mouse and copying it via the context menu) and post them here. If you are a bit more latex savvy and can tell an error/warning from regular latex output, then you can make our lives a lot easier by posting the errors alone.

At any rate, please be more specific with your questions, because you'll get help much quicker, and, for that matter, at all.

regards,
/W
 
  • #6
It's got i.e '1.84 \end{subsection}' What does 1.84 mean? I do have trouble locating the error. How do I end a subsection?
 
  • #7
tgt said:
It's got i.e '1.84 \end{subsection}' What does 1.84 mean? I do have trouble locating the error. How do I end a subsection?
At line 84 of your file, you must be starting a new subsection with a "\begin{subsection}{Subsection heading goes here}" command before (or probably without) ending the previous subsection with an "\end{subsection}" command. Even better, you could replace all of your "\begin{subsection}{Subsection heading goes here}" commands with "\subsection{Subsection heading goes here}" commands.
 
  • #8
las3rjock said:
At line 84 of your file, you must be starting a new subsection with a "\begin{subsection}{Subsection heading goes here}" command before (or probably without) ending the previous subsection with an "\end{subsection}" command. Even better, you could replace all of your "\begin{subsection}{Subsection heading goes here}" commands with "\subsection{Subsection heading goes here}" commands.


How would I end a subsection?

'\end{name of subsection}'?
 
  • #9
tgt said:
How would I end a subsection?

'\end{name of subsection}'?

No, by "\end{subsection}" (literally). BUT. Don't even bother. Just use the \section, \subsection, etc. commands, rather than the environments (I didn't even know they existed until now).

regards,
/W
 
  • #10
The thing is if it compiles and viewing with PDF is possible with the desired output, why correct the errors?
 
  • #11
Longer documents (at least) which have prepared often yield some warnings which am too lazy to correct if get the desired output and tend to let them be, but in general they tend to spill over to the document and something looks awful. Especially occasionally when the document should really be presentable and not just "about there". Sort of a balancing act. Overall think it's a bit like writing code ... if you write 100 pages of error filled crap the next time around you'll probably do it proper and adjust "your ways" to accomplish that.
 
  • #12
tgt said:
The thing is if it compiles and viewing with PDF is possible with the desired output, why correct the errors?
You want to correct your minor bad habits now so that it will be easier to debug more serious errors in the future.
 

Related to Fixing Latex Errors: Tips for Achieving a Polished Document

1. What are some common Latex errors?

Some common Latex errors include missing packages, syntax errors, undefined commands, and missing or incorrect arguments.

2. How can I fix missing packages in Latex?

To fix missing packages, you can use the \usepackage{package name} command in the preamble of your document. Make sure to include all necessary packages for your desired features.

3. What should I do if I encounter a syntax error in Latex?

If you encounter a syntax error, carefully check your code for any missing or incorrect symbols, commands, or brackets. You can also use online resources or a Latex editor's built-in error checker to help identify the issue.

4. How do I handle undefined commands in Latex?

If you encounter an undefined command, make sure to check for any typos or missing packages. You can also use the \newcommand{}{} command to define your own custom commands.

5. How can I ensure a polished document in Latex?

To achieve a polished document in Latex, make sure to proofread for any spelling or grammar errors, use consistent formatting, and include all necessary packages. You can also use a Latex editor's built-in features like spell check and formatting tools to help improve the overall look of your document.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
447
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
23
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
994
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
959
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
370
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
6K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
1K
Back
Top