LaTex question - keeping variables on the line

In summary, the conversation discusses how to prevent variables in LaTex expressions from being displayed raised above the surrounding text. The use of "itex" and "tex" tags can help keep the expressions in line, but may cause issues with certain expressions. The speaker also mentions their preference for putting "tex" on separate lines.
  • #1
Stephen Tashi
Science Advisor
7,861
1,598
Is there a way to keep variables in LaTex expressions from being displayed slightly raised above the line of text that surrounds them? Or am I doing something inadvertently that causes some of them to pop-up from the line? For example, the second "n", in the following:

a. Prove or disprove the following statement: For each integer [tex] n > 0 [/tex] there exists a base [tex] B > 1 [/tex] so that [tex]n[/tex] is palandromic when written in base [tex] B [/tex]..
 
Physics news on Phys.org
  • #2
Using [ itex ] and [ /itex ] (without the spaces) for shorter expressions will keep them in line- but can cause problems with "high" expressions.

For example, I am using "itex" for [itex]3x^2- 2x[/itex], [itex]\frac{3}{4}[/itex] and [itex]\sqrt{x^2+ y^2+ z^2}[/itex]
but "tex" for [tex]3x^2- 2x[/tex], [tex]\frac{3}{4}[/tex] and [tex]\sqrt{x^2+ y^2+ z^2}[/tex]

I prefer to put "tex" on separate lines:
[tex]3x^2- 2x[/tex]
[tex]\frac{3}{4}[/tex]
[tex]\sqrt{x^2+ y^2+ z^2}[/tex]
 
  • #3
Thank you. I didn't know about the "itex" tag.
 

What is LaTex?

LaTex is a typesetting language used for creating professional and high-quality documents, particularly in the fields of mathematics, science, and engineering.

How do I keep variables on the same line in LaTex?

To keep variables on the same line in LaTex, you can use the \mbox{} command to create a box around the variable and prevent it from being split onto multiple lines.

Why are my variables being split onto multiple lines in LaTex?

This can happen if your equations are too long for the page width. To prevent this, you can use the \raggedright command to align the equations to the left and allow for more space on the right for variables to stay on the same line.

Can I use LaTex for non-mathematical documents?

Yes, LaTex can be used for any type of document. While it may be most commonly used for mathematical and scientific documents, it can also be used for creating professional-looking reports, letters, and even books.

Are there any limitations to using LaTex?

LaTex does have a bit of a learning curve and may take some time to get used to. Additionally, it may not be the best option for documents that require a lot of visual design and layout, such as marketing materials or presentations.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
275
  • Quantum Physics
Replies
7
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
3K
Replies
1
Views
825
  • Quantum Interpretations and Foundations
2
Replies
45
Views
3K
Replies
80
Views
4K
Replies
26
Views
2K
Replies
1
Views
768
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
3K
  • Astronomy and Astrophysics
Replies
4
Views
1K
Back
Top