How to post this Latex code on forum?

  • Context: LaTeX 
  • Thread starter Thread starter darkestar
  • Start date Start date
  • Tags Tags
    Code Forum Latex
Click For Summary

Discussion Overview

The discussion revolves around how to properly post LaTeX code on a forum, specifically addressing the challenges faced by a user attempting to share a proof written in LaTeX format. The scope includes technical explanations and practical advice for formatting LaTeX for online forums.

Discussion Character

  • Technical explanation, Debate/contested

Main Points Raised

  • One participant shares their LaTeX document and seeks assistance in posting it on the forum.
  • Another participant suggests using [tex ] and [/tex ] tags to enclose LaTeX code.
  • A different participant expresses prior knowledge of the tags and requests an alternative explanation due to unsuccessful attempts at posting.
  • Another reply indicates that tex tags should be placed around math expressions, noting that certain LaTeX commands like \begin{document} are not necessary for forum posting.
  • One participant explains that the forum's LaTeX implementation operates in math mode, contrasting it with the user's document which is in LR mode, and offers two alternatives for posting: using tags for math mode only or generating a PDF to link.

Areas of Agreement / Disagreement

Participants express differing views on the best method to format and post LaTeX code, indicating that there is no consensus on a single solution.

Contextual Notes

The discussion highlights limitations in the forum's LaTeX capabilities, particularly regarding the need for specific formatting and the distinction between math mode and document mode.

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.
 
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}
 
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:

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 21 ·
Replies
21
Views
2K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 17 ·
Replies
17
Views
2K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 0 ·
Replies
0
Views
4K
Replies
34
Views
3K
  • · Replies 1 ·
Replies
1
Views
4K