How to post this Latex code on forum?

  • Context: LaTeX 
  • Thread starter Thread starter darkestar
  • Start date Start date
  • Tags Tags
    Code Forum Latex
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 3K views
darkestar
Messages
12
Reaction score
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
This forum uses [tex ] and [/tex ] without the space to enclose latex code.
 
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.
 
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: