Troubleshooting LaTeX Code: \frac{1}{q_{2}} = \frac{A q_{1} + B}{C q_{1} + D}

In summary, to properly display math equations in LaTex, you should enclose them in math mode using either \[ ... \] or $$ ... $$ for display equations, or $ ... $ for in-line equations. Additionally, for displaying special symbols such as the Angstrom symbol, you can use the \mathring{} command to properly position the symbol.
  • #1
Doom of Doom
86
0
I'm having some trouble with LaTex.

Here is the LaTex code:

\frac{1}{q_{2}} = \frac{A q_{1} + B}{C q_{1} + D}

And it should produce this:

[tex]\frac{1}{q_{2}} = \frac{A q_{1} + B}{C q_{1} + D}[/tex]

Here, it's produced just fine. But in TeXnicCenter, it produces this instead:

[tex]1\frac{}{q_{2} = \frac{A q_{1} + B}{C q_{1} + D}}[/tex]


What am I doing wrong?
 
Physics news on Phys.org
  • #2
Well, I figured it out, but I don't know why I should have to do this: I surrounded both fractions with \left. and \right. (the invisible boundaries) and it works fine now.

\left.\frac{1}{q_{2}\right.= \left.\frac{A q_{1} + B}{C q_{1} + D}\right.

[tex]\left.\frac{1}{q_{2}}\right.= \left.\frac{A q_{1} + B}{C q_{1} + D}\right.[/tex]
 
  • #3
When you want to display math you should switch to math mode by enclosing the equations like the following:

\[
\frac{1}{q_2} = \frac{A q_{1} + B}{C q_{1} + D}
\]

OR

$$
\frac{1}{q_2} = \frac{A q_{1} + B}{C q_{1} + D}
$$

If you want have have math within a block of text, ie. in-line, use single $ ... $.
 
  • #4
Tagging on here, as it appears the above question has been answered (and it seemed excessive to start a new thread).

How does one correctly display the Angstrom symbol with the A correctly positioned below the circle?

The standard approach gives me this: [tex]\AA[/tex]

I know there's a workaround that I've used before but can not recall.

Edit: Nevermind, got it: Mathring [tex]\mathring{A}[/tex]
 
Last edited:
  • #5
[tex]10^{-10}\text{m}= 1 \mathring{\text{A}}[/tex]
 

1. What does the code \frac{1}{q_{2}} represent?

The code \frac{1}{q_{2}} represents a fraction with the numerator 1 and the denominator q_{2}. This is a common way to write fractions in LaTeX.

2. Why are there curly brackets around q_{2} and not q2?

In LaTeX, curly brackets are used to group characters together and to indicate subscripts or superscripts. In this case, the curly brackets around q_{2} indicate that it is a subscript, which is commonly used in mathematical equations.

3. What do the variables A, B, C, and D represent?

The variables A, B, C, and D represent coefficients in the equation. These coefficients are used to perform operations on the variables q_{1} and q_{2}.

4. Why is there a backslash before the code for fractions?

The backslash is used in LaTeX to indicate a command. In this case, the command \frac{}{} is used to create a fraction with the given numerator and denominator. The backslash is necessary for the code to be recognized as a command and not just plain text.

5. Can I change the appearance of the fraction in the code?

Yes, the appearance of the fraction can be changed by using different commands or packages in LaTeX. For example, the \dfrac{}{} command can be used to create a larger fraction, and the \cfrac{}{} command can be used to create a fraction with a horizontal line instead of a diagonal line. There are also packages available that allow for more customization of the appearance of fractions in LaTeX.

Similar threads

  • Introductory Physics Homework Help
Replies
10
Views
2K
  • Quantum Physics
Replies
15
Views
2K
  • General Math
Replies
1
Views
825
  • Mechanical Engineering
Replies
9
Views
1K
  • Introductory Physics Homework Help
Replies
2
Views
754
  • Introductory Physics Homework Help
Replies
26
Views
476
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
851
  • Introductory Physics Homework Help
Replies
2
Views
499
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • Beyond the Standard Models
Replies
1
Views
2K
Back
Top