Why this LaTeX typing doesn't display?

  • LaTeX
  • Thread starter mcastillo356
  • Start date
  • Tags
    Latex
  • #1
mcastillo356
Gold Member
560
267
Hi PF
I've been for a while taking a glance to recent posts of mine, in search for right or wrong LaTeX performance; everything correct, except for this thread:

https://www.physicsforums.com/threa...n-understanding-different-approaches.1056106/

The following typing has not worked

$$=\frac{1}{2}\ln{|u-1|}-\frac{1}{2}\ln{|u+1|}$$

Where is the mistake?

Regards
 
Physics news on Phys.org
  • #2
What equals?
 
  • Love
Likes mcastillo356
  • #3
$$x=\frac{1}{2}\ln{|u-1|}-\frac{1}{2}\ln{|u+1|}$$
 
  • Like
Likes mcastillo356
  • #4
mcastillo356 said:
Hi PF
I've been for a while taking a glance to recent posts of mine, in search for right or wrong LaTeX performance; everything correct, except for this thread:

https://www.physicsforums.com/threa...n-understanding-different-approaches.1056106/

The following typing has not worked

$$=\frac{1}{2}\ln{|u-1|}-\frac{1}{2}\ln{|u+1|}$$

Where is the mistake?

Regards
You cannot use colors in formulas.
 
  • Like
Likes mcastillo356
  • #5
fresh_42 said:
You cannot use colors in formulas.
One can use colours in a formula, provided one states it explicitly using the ##\rm{LaTeX}## command, rather than choose a different colour for some part of the formula only from the drop down menu that's available in physicsforum's writing space.

For example : I can correctly type ##a\color{red}{+}b.\quad## I typed ##\quad\texttt{##a\color{red}{+}b}##.##

Try writing the same choosing the + only in red from the drop-down color menu here and you'd get incoherent compiling from the editor. I don't know why it happens though.

Let me do it here to the right. ##a+b##.

See what I got above. 👆🤷‍♂️. It didn't compile and the LaTeX math declarations are visible!



Of course if you don't use ##\rm{LaTeX}## for it, you're fine. For instance, (a+b) comes out alright.
 
Last edited:
  • #6
I would encourage you not use the fanciest of features:
  1. They are less tested and therefore more likely to break
  2. They may make the message less accessible to the visually impaired
  3. It usually is better to spend more time formulating the words of your post that formatting of the equations.
 
  • Like
Likes mcastillo356 and berkeman
  • #7
brotherbobby said:
Try writing the same choosing the + only in red from the drop-down color menu here and you'd get incoherent compiling from the editor. I don't know why it happens though.

LaTeX rendering is an optional extension of the software. I doubt that standard UI elements - such as those for text formatting - have been modified to parse the entire draft in order to determine whether they should be inserting phpBB or LaTeX commands in the particular case.
 
  • #8
mcastillo356 said:
The following typing has not worked

$$=\frac{1}{2}\ln{|u-1|}-\frac{1}{2}\ln{|u+1|}$$
This works:
$$=\frac{1}{2}\ln|u-1|-\frac{1}{2}\ln|u +1|$$

Mixing BBCode (for example [ COLOR]) in LaTeX expressions fouls up the LaTeX rendering.

Incidentally, for simple fractions like 1/2 you don't need to use braces around each digit. By "simple" I mean each part is a single character. In other words, this will work \frac 1 2, but this won't \frac 1 10.
Also, don't use braces around function arguments. For example, use \ln(|x + 1|) or \ln|x + 1|but not \ln{|x + 1|}. The latter doesn't cause problems, but it's just extra cruft that you don't need to type.
 
Last edited:
  • #9
brotherbobby said:
One can use colours in a formula, provided one states it explicitly using the ##\rm{LaTeX}## command, rather than choose a different colour for some part of the formula only from the drop down menu that's available in physicsforum's writing space.
The dropdown menu inserts BBCode markup, which doesn't play well with LaTeX.

Vanadium 50 said:
It usually is better to spend more time formulating the words of your post that formatting of the equations.
Amen!
 

1. Why is my LaTeX typing not displaying correctly?

There could be several reasons for this. One common issue is missing or incorrect syntax. Make sure all necessary commands and braces are included and properly placed. Another possibility is incompatible packages or document classes. Check that the packages and class files you are using are compatible with each other. Additionally, check for any errors or warnings in the log file that may indicate the source of the issue.

2. How can I fix the spacing in my LaTeX document?

LaTeX automatically handles spacing within a document, but sometimes it may not be to your liking. To adjust spacing, you can use commands such as \hspace and \vspace to add or remove horizontal or vertical space, respectively. You can also use the \hspace* and \vspace* commands to force these spacing adjustments.

3. Why is my LaTeX document not compiling?

There are a few potential reasons for a LaTeX document not compiling. First, make sure all necessary packages and class files are included and properly specified. Next, check for any errors or warnings in the log file that may indicate the source of the issue. If you are using a specific editor or compiler, make sure it is up to date and compatible with your LaTeX document. Finally, double check your code for any syntax errors or missing commands.

4. Can I use images in my LaTeX document?

Yes, you can include images in your LaTeX document. The recommended way to do so is by using the \includegraphics command from the graphicx package. This command allows you to specify the file path and desired size of the image. Make sure to also include the graphicx package in your preamble. Additionally, some document classes may have their own commands for including images, so check the documentation for your specific class.

5. How do I create a table in LaTeX?

To create a table in LaTeX, you will need to use the tabular environment. This allows you to specify the number of columns, alignment, and content of each cell in the table. You can also use the booktabs package for improved table formatting. For more complex tables, you can use the longtable or tabu packages. It is recommended to consult the documentation for each package to learn more about the available options and syntax for creating tables.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
911
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
275
  • MATLAB, Maple, Mathematica, LaTeX
Replies
16
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
2K
Replies
14
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
1K
Replies
8
Views
180
Back
Top