Latex keeps on getting parsing errors

  • LaTeX
  • Thread starter andrewkirk
  • Start date
  • Tags
    Errors Latex
In summary, Latex is causing errors with the code. Latex is a typesetting language that is used to create documents, such as scientific papers. The code that was provided has errors, and when it is broken down into pieces it all works. However, when it is put back together it has errors. There is a way to fix the errors, but it requires using a program called Texmaker.
  • #1
andrewkirk
Science Advisor
Homework Helper
Insights Author
Gold Member
4,119
1,717
I keep on getting errors from Latex. For instance the following code looks OK to me but won't parse:

[itex]g(\vec{\bar{V}}_S, \vec{U}(1)) =\ _Sg_{ik}(O) _S\bar{V}_S^i _SU(1)^k [/itex]

However if I break it with the insertion of a close and then an open itex delimiter, the first bit parses but the second won't.

[itex]g(\vec{\bar{V}}_S, \vec{U}(1)) =[/itex][itex]\ _Sg_{ik}(O) _S\bar{V}_S^i _SU(1)^k [/itex]

Now if I break it yet again, it all parses OK.

[itex]g(\vec{\bar{V}}_S, \vec{U}(1)) =[/itex][itex]\ _Sg_{ik}(O) [/itex][itex]_S\bar{V}_S^i [/itex][itex]_SU(1)^k [/itex]

The three strings are identical, except for the insertion of [/itex][itex] first once and then twice.

I have put enough spaces into deactivate the vBulletin 'no more than 50 consecutive nonspace characters' bug, but it still seems to go wrong.

Any help in fixing this would be much appreciated. I have a derivation I want to post, but it's impractical with this amount of latex problems.

Thanks very much.

PS is there any way to get that first arrow to sit over the V rather than off to the left?
 
Physics news on Phys.org
  • #2
The problem is towards the end of your LaTeX where you have
Code:
\bar{V}_S^i _S U(1)^k
And the error message from LaTeX is "double subscript". If you write
Code:
A_b^c_d E
LaTeX thinks the "b" and "d" are both subscripts applied to "A".

One way to get round this is attach subscripts to an empty group, for example
Code:
A_b^c {}_d E

PS is there any way to get that first arrow to sit over the V rather than off to the left?
I think that is a MathJax problem. It looks OK in "real" LaTeX.
 
  • #3
andrewkirk said:
PS is there any way to get that first arrow to sit over the V rather than off to the left?
For what it's worth, I had the same problem viewing the message on someone else's computer earlier today (IE8 on XP) but I see no problem now on my own computer (FF10 or IE9 on Vista, all MathJax renderers tried).
 
  • #4
Thanks for the replies. I presume MathJax is the TeX rendering engine for this site.
I tried the empty group suggestion and it worked, after I put in a few extra spaces "\ ", without which it also seemed to get upset.

I downloaded Texmaker and experimented with that and had a lot of intermittent 'double subscript' errors there too, but at least that was user-friendly enough to give an error message saying 'double subscript'.

When working with tensors there's sometimes no easy way to avoid using pre-subscripts (I use them to denote different coordinate systems) so it's good to know how to make it handle them correctly.

PS Texmaker seems to put my vector arrows in the right place.:smile:
 
  • #5


It seems that there may be an issue with the way you are inputting the code into Latex. It is difficult to determine the exact cause without seeing the full code and error messages, but it is possible that there may be a missing or misplaced character or symbol causing the parsing errors. I would suggest double-checking your code and making sure all characters and symbols are correctly placed and matched. It may also help to consult a Latex tutorial or reference guide to ensure proper syntax. Regarding your question about the arrow placement, you may need to use a different command or symbol in order to achieve the desired positioning. Again, consulting a Latex resource may be helpful in finding the appropriate command. If the issue persists, you may also want to consider reaching out to the Latex community for further assistance.
 

What is a parsing error in Latex?

A parsing error in Latex occurs when the compiler is unable to understand or interpret the code written in the document. This can be due to incorrect syntax, missing or mismatched braces, or other errors in the code.

Why does Latex keep giving me parsing errors?

There can be several reasons for Latex to give parsing errors. Some common reasons include using incorrect syntax, forgetting to close braces, using unsupported packages, or having errors in the preamble of the document.

How can I fix parsing errors in Latex?

To fix parsing errors in Latex, you will need to carefully review your code and identify where the error is occurring. Check for any missing or mismatched braces, incorrect syntax, or unsupported packages. You may also need to consult online resources or ask for help from other Latex users.

What are some common mistakes that can cause parsing errors in Latex?

Some common mistakes that can cause parsing errors in Latex include forgetting to close braces, using incorrect syntax for commands, using unsupported packages, or having errors in the preamble of the document. It's important to carefully review your code and check for these mistakes.

Is there a way to prevent or reduce the number of parsing errors in Latex?

To prevent or reduce the number of parsing errors in Latex, it's important to familiarize yourself with the correct syntax and structure of Latex code. You can also use tools such as linter programs to help catch errors before compiling the document. Additionally, regularly checking for updates and using supported packages can help prevent errors.

Similar threads

  • Introductory Physics Homework Help
Replies
1
Views
890
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
275
  • Linear and Abstract Algebra
Replies
12
Views
2K
  • Advanced Physics Homework Help
Replies
4
Views
1K
  • Advanced Physics Homework Help
Replies
7
Views
1K
Replies
4
Views
1K
  • High Energy, Nuclear, Particle Physics
Replies
13
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
  • Advanced Physics Homework Help
Replies
26
Views
4K
  • Advanced Physics Homework Help
Replies
1
Views
696
Back
Top