How to post this Latex code on forum?

In summary, the conversation is about the use of Latex in a forum and the difficulties that arise when trying to post code. The solution given is to use [tex] tags to enclose the Latex code, but the user is still having trouble with it. An alternative suggestion is to write the text outside of the [tex] tags and only use them for math mode, or to generate a pdf and post it as a link.
  • #1
darkestar
12
0
Hello!

I just finished typing up my first Latex document for a proof I worked on. Now, I'm having trouble posting it on these forums. Here is the source code...

\begin{document}
$f : \mathbb{R} \Rightarrow \mathbb{R}$ is odd $\;\Longleftrightarrow \;f(-x) = -f(x) \;\forall x$.
Show that if $f : \mathbb{R} \Rightarrow \mathbb{R}$ is odd and with a retriction to $[0, \infty)$ is strictly increasing, then $f : \mathbb{R} \Rightarrow \mathbb{R}$ is stricly increasing.
\begin{proof}
Suppose $f : \mathbb{R} \Rightarrow \mathbb{R}$ is odd and strictly increasing on $[0, \infty)$. Consider $x_n, x_{n+1} \in [0, \infty)$, where $n \in \mathbb{N}$ and $x_{n+1} > x_n$. Since $f$ is strictly increasing in $[0, \infty)$, then $f(x_{n+1}) > f(x_n)$. Additionally, since $f$ is odd, $f(-x_n) = -f(x_n)$ and $f(-x_{n+1}) = -f(x_{n+1})$. Thus,
\begin{align*}
\\f(x_{n+1}) > f(x_n)
\\\Rightarrow -f(x_n) > -f(x_{n+1})
\\\Rightarrow f(-x_n) > f(-x_{n+1})
\\\Rightarrow -x_n > -x_{n+1}
\end{align*}
\\Therefore, $f$ is strictly increasing on $(-\infty, 0) \cup [0, \infty)$. Hence, $f : \mathbb{R} \Rightarrow \mathbb{R}$ is strictly increasing.
\end{proof}
\end{document}


It compiles fine using TeXWorks, although I'm not sure how to modify it so I can post it here. Thanks for the help!
 
Physics news on Phys.org
  • #2
This forum uses [tex ] and [/tex ] without the space to enclose latex code.
 
  • #3
Thanks, although I already knew that. I was hoping for a different explanation because I tried to simply put those tags in but it's not working.
 
  • #4
You need to put tex tags wherever you have $ signs. All the spacing using slashes is irrelevant for the forum, as are things like \begin{document} or \begin{proof}
 
  • #5
The [ tex ] tags provides a subset of LaTeX. The underlying engine places LaTeX in math mode. Your document is in LR mode, not math mode.

A couple of alternatives:
1. Write your text outside of the [ tex ] tags, using those tags for math mode stuff. You can use the [ itex ] tags for inline math mode (e.g., $ f(x) $), but that doesn't work quite as nicely as it does in LaTeX.

2. Generate a pdf and post it as a link.
 
Last edited:

1. How do I post Latex code on a forum?

To post Latex code on a forum, you can use the "code" or "preformatted text" option provided by the forum's text editor. This will preserve the formatting of your Latex code and display it properly for other users to see.

2. Do I need to use any special formatting for Latex code on a forum?

Yes, it is important to use the appropriate formatting for Latex code on a forum. This includes using the "code" or "preformatted text" option, as well as using the necessary Latex syntax and symbols.

3. Can I use Latex code on any forum?

Not all forums support Latex code, so it is important to check the forum's guidelines or ask a moderator before posting. Some forums may have specific plugins or extensions that allow for Latex code to be displayed properly.

4. How do I troubleshoot if my Latex code is not displaying correctly on a forum?

If your Latex code is not displaying properly on a forum, check for any typos or missing syntax in your code. You may also need to adjust the formatting, such as using the "code" or "preformatted text" option, to ensure it is displayed correctly.

5. Is it possible to edit Latex code after posting it on a forum?

Yes, most forums allow you to edit your posts, including Latex code, after they have been submitted. This can be useful if you notice a mistake or want to make changes to your code.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
1K
  • Calculus and Beyond Homework Help
Replies
34
Views
2K
Replies
3
Views
1K
Replies
24
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
1
Views
740
Replies
32
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
5
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
944
Replies
14
Views
1K
Replies
16
Views
2K
Back
Top