Latex superscript of the second row overlap

In summary: H} will work?In summary, the conversation discussed solutions for the issue of overlapping subscripts and superscripts in a latex code. Options such as \vspace and \smallskip were suggested to create space between the rows and the use of \hspace to left align the array. Other alternatives such as using split or eqnarray instead of array were also mentioned. Finally, there were suggestions for adding a text explanation to the right of an equation and using \cal or \mathcal for a nice font for classical Hamiltonian H in a latex document.
  • #1
ehrenfest
2,020
1
When I compile the following latex code on my computer, the subscript of the first row and the superscript of the second row overlap. Is there any way to make the rows farther apart?

[tex]\begin{array}{ccccc}
\cos^2\phi_y^1 - \cos^2\phi_x^1 & \cos^2\phi^1_z - \cos^2\phi_x^1 & 2\cos\phi_x^1 cos\phi_y^1 & 2\cos\phi_x^1\cos\phi_z^1 & 2\cos \phi^1_y \cos\phi_z^1 \\
\cos^2\phi_y^2 - \cos^2\phi_x^2 & \cos^2\phi^2_z - \cos^2\phi_x^2 & 2\cos\phi_x^2 cos\phi_y^2 & 2\cos\phi_x^2\cos\phi_z^2 & 2\cos \phi^2_y \cos\phi_z^2 \end{array} \right)
\end{array}[/tex]
 
Physics news on Phys.org
  • #2
they shouldn't under the equation enviroment, but you could try \vspace{..cm} at the end of first line
 
  • #3
That did not work. I uploaded the file as .txt
 

Attachments

  • latex_file.txt
    1.9 KB · Views: 433
  • #4
I don't see any overlap in in firefox.

Testing...

[tex]\begin{array}{ccccc}
\cos^2\phi_y^1 - \cos^2\phi_x^1 & \cos^2\phi^1_z - \cos^2\phi_x^1 & 2\cos\phi_x^1 cos\phi_y^1 & 2\cos\phi_x^1\cos\phi_z^1 & 2\cos \phi^1_y \cos\phi_z^1 \\
\\
\cos^2\phi_y^2 - \cos^2\phi_x^2 & \cos^2\phi^2_z - \cos^2\phi_x^2 & 2\cos\phi_x^2 cos\phi_y^2 & 2\cos\phi_x^2\cos\phi_z^2 & 2\cos \phi^2_y \cos\phi_z^2 \end{array} \right)
\end{array}[/tex]

How's that?
 
  • #5
Gokul43201 said:
I don't see any overlap in in firefox.

That is true. I was compiling in TexNic center with Miktex. There should be a better solution than inserting a blank row! Why would the TeXnic center compile differently than Firefox? I need to make a pdf. Is there anyway I can do that with Firefox?
 
  • #6
What mjsd was suggesting was to use \vspace, which offers a little more control.

[tex]
\begin{array}{ccccc}
\cos^2\phi_y^1 - \cos^2\phi_x^1 & \cos^2\phi^1_z - \cos^2\phi_x^1 & 2\cos\phi_x^1 cos\phi_y^1 & 2\cos\phi_x^1\cos\phi_z^1 & 2\cos \phi^1_y \cos\phi_z^1
\\
\cos^2\phi_y^2 - \cos^2\phi_x^2 & \cos^2\phi^2_z - \cos^2\phi_x^2 & 2\cos\phi_x^2 cos\phi_y^2 & 2\cos\phi_x^2\cos\phi_z^2 & 2\cos \phi^2_y \cos\phi_z^2 \end{array} \right)
\end{array}
[/tex]

vs.

using \vspace{0.15ex} [using units which scale with the font]
[tex]
\begin{array}{ccccc}
\cos^2\phi_y^1 - \cos^2\phi_x^1 & \cos^2\phi^1_z - \cos^2\phi_x^1 & 2\cos\phi_x^1 cos\phi_y^1 & 2\cos\phi_x^1\cos\phi_z^1 & 2\cos \phi^1_y \cos\phi_z^1
\vspace{0.15ex}
\\
\cos^2\phi_y^2 - \cos^2\phi_x^2 & \cos^2\phi^2_z - \cos^2\phi_x^2 & 2\cos\phi_x^2 cos\phi_y^2 & 2\cos\phi_x^2\cos\phi_z^2 & 2\cos \phi^2_y \cos\phi_z^2 \end{array} \right)
\end{array}
[/tex]


vs.

using \smallskip [alt: \bigskip]
[tex]
\begin{array}{ccccc}
\cos^2\phi_y^1 - \cos^2\phi_x^1 & \cos^2\phi^1_z - \cos^2\phi_x^1 & 2\cos\phi_x^1 cos\phi_y^1 & 2\cos\phi_x^1\cos\phi_z^1 & 2\cos \phi^1_y \cos\phi_z^1
\smallskip
\\
\cos^2\phi_y^2 - \cos^2\phi_x^2 & \cos^2\phi^2_z - \cos^2\phi_x^2 & 2\cos\phi_x^2 cos\phi_y^2 & 2\cos\phi_x^2\cos\phi_z^2 & 2\cos \phi^2_y \cos\phi_z^2 \end{array} \right)
\end{array}
[/tex]
 
  • #7
That works. Thanks.
 
  • #8
[tex]\begin{equation}
\left( \begin{array}{ccccc}
\cos^2\phi_y^1 - \cos^2\phi_x^1 & \cos^2\phi^1_z - \cos^2\phi_x^1 & 2\cos\phi_x^1 cos\phi_y^1 & 2\cos\phi_x^1\cos\phi_z^1 & 2\cos \phi^1_y \cos\phi_z^1 \bigskip \\
\cos^2\phi_y^2 - \cos^2\phi_x^2 & \cos^2\phi^2_z - \cos^2\phi_x^2 & 2\cos\phi_x^2 cos\phi_y^2 & 2\cos\phi_x^2\cos\phi_z^2 & 2\cos \phi^2_y \cos\phi_z^2 \bigskip \\

\vdots & \vdots & \vdots & \vdots & \vdots \bigskip\\


\cos^2\phi_y^n - \cos^2\phi_x^n & \cos^2\phi^n_z - \cos^2\phi_x^n & 2\cos\phi_x^\n cos\phi_y^n & 2\cos\phi_x^n\cos\phi_z^n & 2\cos \phi^2_n \cos\phi_z^n \end{array} \right)

\end{equation}[/tex]

One more thing. Can someone help me figure out what is wrong in my equation environment? Why is the (1) below the equation and not beside it?
 
  • #9
Your line is too long...

[tex]\begin{equation}
\left( \begin{array}{ccccc}
\cos^2\phi_y^1 - \bigskip \\
\cos^2\phi_y^2 - \bigskip \\

\vdots & \vdots & \vdots & \vdots & \vdots \bigskip\\ \cos^2\phi_y^n - \end{array} \right)

\end{equation}[/tex]

You might be able to force a longer line using
\setlength{\textwidth}{6.0in}
 
  • #10
It is not too long for my pdf, however. Is there a way I can left align the array, because it starting way too far to the right with miktex?
 
  • #11
You might be able to use \hspace{-1in} or hspace*{-1in}.

Alternatively, you might try \lefteqn
http://www.google.com/search?q=lefteqn

I'm not sure if \smash{your equation} followed by an appropriate \hspace would work as well.
 
  • #12
\hspace{-1in} worked! Thanks.

I am really starting to hate MikTex and the stupid texnic center!
 
  • #13
You can also use split or eqnarray, instead of array inside equation.
I think array switches to textstyle be default, which is also ugly when you have fractions.
 
  • #14
CompuChip said:
You can also use split or eqnarray, instead of array inside equation.
I think array switches to textstyle be default, which is also ugly when you have fractions.

I would still need an array inside of the eqnarray since I have a matrix that is part of the equation, right?
 
  • #15
Also, is there a way I could have an equation and then a text explanation to the right that is against the margin on that same line?
 
  • #16
Sorry, one more thing. How would I get the nice pretty font for classical Hamiltonian H in a latex document.
 
  • #17
you could try \marginpar{my comment}...
but it might not work from within a math environment.

maybe \cal{H}
 

What is "Latex superscript of the second row overlap"?

Latex superscript of the second row overlap refers to the use of a superscript symbol in the second row of a Latex equation. This is commonly used in mathematical and scientific equations to indicate the overlap of two variables or terms.

How do you format a Latex superscript of the second row overlap?

To format a Latex superscript of the second row overlap, you can use the caret symbol (^) followed by the desired superscript symbol. For example, "x^{2}" would result in x². You can also use curly braces to indicate the scope of the superscript.

Why is the Latex superscript of the second row overlap important in scientific equations?

The Latex superscript of the second row overlap is important in scientific equations because it allows for a clear and concise representation of complex mathematical relationships. It also helps to avoid confusion and ensure accuracy in calculations.

Can the Latex superscript of the second row overlap be used in other contexts besides equations?

Yes, the Latex superscript of the second row overlap can be used in other contexts besides equations. It is commonly used in scientific and mathematical texts, but can also be used in technical writing, programming, and other fields where precise notation is necessary.

Are there any limitations to using the Latex superscript of the second row overlap?

The main limitation of using the Latex superscript of the second row overlap is that it may not be easily readable for individuals who are not familiar with Latex notation. Additionally, in some cases, it may be necessary to use alternative notation to represent complex equations that cannot be easily expressed using the superscript symbol.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
310
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
869
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
222
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
Replies
47
Views
5K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
4K
Back
Top