LaTeX Why this LaTeX typing doesn't display?

  • Thread starter Thread starter mcastillo356
  • Start date Start date
  • Tags Tags
    Latex
AI Thread Summary
The discussion centers on issues with LaTeX formatting in a specific post regarding the integral of the cosecant function. The main problem identified is that mixing BBCode (like color formatting from a dropdown menu) with LaTeX commands leads to rendering errors. Users are advised to use LaTeX commands explicitly for colors and to avoid unnecessary braces around function arguments and simple fractions. It is emphasized that focusing on clear wording is more important than intricate formatting, as complex features may hinder accessibility and reliability in rendering. Overall, the conversation highlights best practices for using LaTeX in forum posts to ensure proper display and comprehension.
mcastillo356
Gold Member
Messages
634
Reaction score
342
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
What equals?
 
  • Love
Likes mcastillo356
$$x=\frac{1}{2}\ln{|u-1|}-\frac{1}{2}\ln{|u+1|}$$
 
  • Like
Likes mcastillo356
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
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:
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
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.
 
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:
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!
 

Similar threads

Replies
6
Views
74
Replies
8
Views
3K
Replies
16
Views
4K
Replies
3
Views
2K
Replies
2
Views
2K
Replies
1
Views
4K
Replies
4
Views
4K
Back
Top