| Thread Closed |
latex question |
Share Thread | Thread Tools |
| Aug4-07, 06:59 PM | #1 |
|
|
latex question
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] |
| Aug4-07, 08:35 PM | #2 |
|
Recognitions:
|
they shouldn't under the equation enviroment, but you could try \vspace{..cm} at the end of first line
|
| Aug4-07, 09:04 PM | #3 |
|
|
That did not work. I uploaded the file as .txt
|
| Aug4-07, 11:52 PM | #4 |
|
|
latex question
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? |
| Aug5-07, 12:23 AM | #5 |
|
|
|
| Aug5-07, 08:09 AM | #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] |
| Aug5-07, 03:20 PM | #7 |
|
|
That works. Thanks.
|
| Aug5-07, 05:14 PM | #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? |
| Aug5-07, 05:21 PM | #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} |
| Aug5-07, 09:03 PM | #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?
|
| Aug5-07, 09:07 PM | #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. |
| Aug5-07, 09:28 PM | #12 |
|
|
\hspace{-1in} worked! Thanks.
I am really starting to hate MikTex and the stupid texnic center! |
| Aug6-07, 02:51 AM | #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. |
| Aug6-07, 04:04 AM | #14 |
|
|
|
| Aug8-07, 05:37 AM | #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?
|
| Aug8-07, 06:42 AM | #16 |
|
|
Sorry, one more thing. How would I get the nice pretty font for classical Hamiltonian H in a latex document.
|
| Aug8-07, 07:28 AM | #17 |
|
|
you could try \marginpar{my comment}...
but it might not work from within a math environment. maybe \cal{H} |
| Thread Closed |
| Thread Tools | |
Similar Threads for: latex question
|
||||
| Thread | Forum | Replies | ||
| Latex question: | Math & Science Software | 4 | ||
| laTex Question | Math & Science Software | 1 | ||
| LaTeX Question | Forum Feedback & Announcements | 3 | ||
| latex question | Math & Science Software | 4 | ||
| Latex Question #2 | Introductory Physics Homework | 4 | ||