You are viewing the historical archive of The Philosophy Forum.
For current discussions, visit the live forum.
Go to live forum

Mathjax Tutorial (Typeset Logic Neatly So That People Read Your Posts)

fdrake March 01, 2019 at 17:40 14675 views 35 comments
This forum has Mathjax support. Mathjax is a typesetting tool for mathematics.

It turns

(x)=(x/(n+1))*arctan(x*sqrt(sum_{i=1}^{\infty} \lambda_i)) into:

[math]\frac{x}{n+1}\text{arctan}(x*\sqrt(\sum_{i=1}^{\infty} \lambda_i)[/math]

through

[math]\frac{x}{n+1}\text{arctan}(x*\sqrt(\sum_{i=1}^{\infty} \lambda_i)[/math]


or

Ex(~(x=y)&F(x))|-Ax(Px<=>Fx)

into

[math]\begin{align}\exists x (\neg(x=y)\wedge F(x))\implies \forall x (Px \Leftrightarrow Fx)\end{align}[/math]

through

[math]\begin{align}\exists x (\neg(x=y)\wedge F(x))\implies \forall x (Px \Leftrightarrow Fx)\end{align}[/math]


To use Mathjax in a post, all you need to do is use to 'math' environment. This can be summoned by
[math]...[/math]


Useful logical symbols are:

logical conjunction: [math]\wedge[/math] is
[math]\wedge[/math]

logical disjunction: [math]\vee[/math] is
[math]\vee[/math]

negation: [math]\neg[/math] is
[math]\neg[/math]

existential quantifier: [math]\exists[/math] is
[math]\exists[/math]

universal quantifier: [math]\forall[/math] is
[math]\forall[/math]

forward implication: [math]\Rightarrow[/math] is
[math]\Rightarrow[/math]

backward implication: [math]\Leftarrow[/math] is
[math]\Leftarrow[/math]

biconditional [math]\Leftrightarrow[/math] is
[math]\leftrightarrow[/math]


see here for a long list, the far right column's 'Latex' symbols usually work

Useful mathematical symbols are

subset: [math]\subset[/math] is
  [math]\subset[/math]  

superset [math]\supset[/math]
  [math]\\supset[/math]  

belongs to [math]\in[/math]
  [math]\in[/math]  


fractions: [math]\frac{x}{y}[/math] is
[math]\frac{x}{y}[/math]

subscripts and superscripts: [math]x_1 ^2[/math] is
[math]x_1 ^2[/math]

prime: [math]\prime[/math] is
[math]\prime[/math]

sigma notation: [math]\sum_{i=1}^{i=n}[/math] is
[math]\sum_{i=1}^{i=n}[/math]

note that you can bracket an expression with {} and Mathjax will treat it as a single expression in the intended place, whereas without {} it will usually treat what you write as two expressions. EG, if you want to obtain [math]x^{21}[/math], you write
[math]x^{21}[/math]
rather than
[math]x^21[/math]
which gives the wrong thing [math]x^21[/math])

limits: [math]\lim_{n\rightarrow\infty}[/math] is
[math]\lim_{n\rightarrow\infty}[/math]


you can write matrices or vectors using the \bmatrix environment

1 0
0 1

can be represented as

[math] \begin{bmatrix}1 & 0 \\ 0 & 1 \end{bmatrix} [/math]

which is given by

[math] \begin{bmatrix}1 & 0 \\ 0 & 1 \end{bmatrix} [/math]


taking a new line is \\.

If you are presenting a mathematical expression not inline consider wrapping what you write with:

[math]\begin{align} ... \end{align}[/math]


multi line derivations can be achieved by using \\ within the align environment.

You can make things a lot prettier than I have here with more effort, but hopefully people take notice and logic posts become more readable.

Comments (35)

Michael March 01, 2019 at 17:44 #260648
Here’s more info: https://thephilosophyforum.com/discussion/1424/psa-this-site-supports-mathjax/p1
fdrake March 01, 2019 at 18:08 #260652
Reply to Michael

Wasn't aware there's already a thread for it. I'll pin this one, thanks for including the reference.
fdrake March 01, 2019 at 18:22 #260654
@andrewk@SophistiCat@fishfry@Owen, missing anything vital?
andrewk March 01, 2019 at 21:35 #260683
I usually use \to for [math]\to[/math] rather than [math]\Rightarrow[/math] because it is quicker to write, and more commonly used in logic texts. It's worth noting that changing to lower case the first letter of the code for any of the arrows above changes the symbol from a double to a single arrow, eg
\leftrightarrow for [math]\leftrightarrow[/math] instead of \Leftrightarrow for [math]\Leftrightarrow[/math]

Other signs I've found useful in logic are \vdash for [math]\vdash[/math]
\bigcup_{j=1}^n for [math]\bigcup_{j=1}^n [/math]
\bigcap_{j=1}^n for [math]\bigcap_{j=1}^n [/math]

\bigvee_{j=1}^n for [math]\bigvee_{j=1}^n [/math]

\bigwedge_{j=1}^n for [math]\bigwedge_{j=1}^n [/math]





SophistiCat March 02, 2019 at 06:30 #260832
Reply to fdrake Nice. I hardly know any latex, so thanks for the convenient tutorial.
TheMadFool June 01, 2019 at 17:39 #293615
[Math]\frac{1}{2}[/math]
[Math]x^{78}+2[/math]
TheMadFool June 01, 2019 at 17:41 #293617
[Math]\ A \subset B[/math]
schopenhauer1 June 01, 2019 at 19:23 #293641
[math]\frac{x}{n+Schopenhauer}\text{arctan}(x*\sqrt(\sum_{i=1}^{\infty} \lambda_i)[/math]

Cool
TheMadFool June 05, 2019 at 13:17 #294784
[Math]\frac{1}{34}[/math]
TheMadFool June 05, 2019 at 13:19 #294785
[Math]\sqrt4[/math]
TheMadFool June 05, 2019 at 13:20 #294786
[Math]\frac{1}{\infty} = 0[/math]
TheMadFool June 06, 2019 at 13:43 #295095
[Math]\infty[/math]
TheMadFool June 06, 2019 at 13:44 #295097
[math]\lim_{n\rightarrow\infty}\frac{x}{n}=0[/math]

[Math]\lim_{x\rightarrow\infty}\frac{1}{x}=0[/math]
Wittgenstein June 09, 2019 at 09:00 #295869
Cool
Wittgenstein June 09, 2019 at 09:02 #295871
[math]\sum_{i=1}^{i=n}[/math]
Wittgenstein June 09, 2019 at 09:06 #295872
[math]\sum_{i=1}^{i=n}[/math] [math]\frac{-1^n}{n}[/math]
Wittgenstein June 09, 2019 at 09:10 #295873
[math]\sum_{n=1}^{n=\infty}[/math] [math]\frac{-1^n}{n}[/math]
Wittgenstein June 09, 2019 at 13:36 #295973
[math]\lambda[/math]
TheMadFool June 10, 2019 at 13:54 #296324
[Math]x^{2}+x-2[/math]
Mephist July 03, 2019 at 19:29 #303567
[math]x = {-b \pm \sqrt{b^2-4ac} \over 2a}[/math]

It works!!! :starstruck: :starstruck: :starstruck:
TheMadFool July 04, 2019 at 06:32 #303753
[Math]1+2+3+4+...= -\frac{1}{12}[/math]

[Math]\frac{1}{12}[/math]
TheMadFool July 04, 2019 at 07:34 #303765
[Math]\sum_{i=1}^{\infty}i=-\frac{1}{12}[/math]

edit (fdrake): \sum, it's a command.
Andrew M December 07, 2019 at 05:47 #359958
A handy feature I just found if you want to see the source of an equation in another post.

Right-click on the math and select "Math Settings | Math Renderer | Plain Source" from the context menu. You will then see the text that goes between the [ math]...[ /math] delimiters. The default renderer is HTML-CSS.
Tristan L March 08, 2020 at 11:51 #389646
1. [math]0\cdot \infty = 0 \because \forall x \colon 0 \cdot x = 0[/math]
2. [math]\therefore \frac{1}{0} > \infty[/math]
EnPassant June 06, 2020 at 10:39 #420890
[math]\exists[/math] x = [math]\frac{1}{a_1^\frac{p - 1}{2}(mod p)}[/math]
such that x = [math]\pm 1[/math]

[math]{\sqrt {ab \pm c} \over \sqrt{x/y}} \pm 1[/math]

[math]a \equiv b (mod m)[/math]

[math]\phi = [/math][math]\frac {1}{1 + \frac{1}{1 + \frac{1}{1 + ...}}}[/math]

[math]\sum_{i=1}^{\infty}[/math]

[math]{\sqrt {2 - 1/\sqrt {2}}}[/math]
Banno January 05, 2023 at 00:53 #769569
An odd case:

[math] \exists (x)(Px ) \exists (y)( Py)(x=y)[/math]

It shoudl be

[math] \exists (x)(Px ) \exists ( y)( Py)(x=y)[/math]

It's

\exists (x)(Px ) \exists ( y)( Py)(x=y)

except without the space in ( y).

Removing that space gives (y).

Any other work arounds?

from https://thephilosophyforum.com/discussion/comment/766524

And what does it have to do with onigiri?
jgill January 05, 2023 at 03:56 #769602
[math]\exists(x)(Px)\exists(y)(Py)(x=y)[/math]

I use Mathtype and set cut/paste to accomodate Wikipedia, then replace "" by "[m.th]".

In this example two empty spaces appear, between exists (x) and the other, exists (.). By closing the gaps one gets the proper symbols. I.e., exists(x) and exists(y).

Odd. Notice that ( ) with a y inside produces a thumbs up: (y)
fdrake January 05, 2023 at 06:58 #769629
[math]\exists (x)(Px ) \exists \left( y \right) ( Py)(x=y)[/math]

[math]\exists (x)(Px ) \exists \left( y \right) ( Py)(x=y)[/math]
Banno January 05, 2023 at 07:54 #769635
Reply to jgill, Reply to fdrake Thanks!

Yeah, but why?

I gather the (y) gets processed before the math? Seems odd. Isn't spacing supposed to be irrelevant in Mathjax?
fdrake January 05, 2023 at 08:46 #769639
Quoting Banno
I gather the (y) gets processed before the math? Seems odd. Isn't spacing supposed to be irrelevant in Mathjax?


I imagine it's part of how plushforums parses the math environment.

test:
(y)

(y)


Seems to be just the math environment which has the weird parsing issue. Odd.
fdrake January 05, 2023 at 08:50 #769648
:sparkle: But yes AFAIK mathjax isn't supposed to be space dependent, I'm imagining that whatever renders ( y ) into (y) passes through the text first, is substituted, then something which isn't mathjax code gets passed in - it's some css markup type that the math environment outputs, which probably corresponds to the (y).

test2: [math]:up:[/math] =
:up:

[math]:sparkle:[/math] =
:sparkle:


Edit: yes, it's substituting in whatever class would be replaced with the emoji as a text string within the math environment. Plushforums issue with mathjax.
Banno January 05, 2023 at 09:38 #769657
Ok. We agree it's odd.

Good.
Banno January 06, 2023 at 21:01 #770000
Quoting fdrake
Edit: yes, it's substituting in whatever class would be replaced with the emoji as a text string within the math environment. Plushforums issue with mathjax.


@Jamal, worth feedback to Plushforums?
jgill January 06, 2023 at 21:29 #770010
"rice ball sparkle" sounds like the AI is trying to communicate with us. Could this be an important breakthrough? :chin:
Banno January 06, 2023 at 21:49 #770015
Reply to jgill Indeed,
Quoting Banno
And what does it have to do with onigiri?


I fed "rice ball sparkle" into the OpenAI playground and got back

A pom-pom ball sparkle is a decoration made of small pom-poms that can be used to add color and texture to a variety of craft projects. It is usually made up of small pom-poms that have been dyed different colors and strung together in different sizes and shapes. Pom-pom ball sparkles can be used to decorate items such as greeting cards, scrapbook pages, gift tags, ornaments, and more.


There's a notable absence of any mention of rice.

But RiceBallRiceBallUp produced

RiceBallRiceBallUpdater

RiceBallRiceBallUpdater is a free and open source software updater for Windows that can be used to update software on your computer. It is designed to be easy to use and can be used to update programs automatically, or manually. It can also be used to check for and download updates for programs that you have installed. It supports various types of software such as games, web browsers, media players, and more. RiceBallRiceBallUpdater is available for free and is compatible with Windows XP, Vista, 7, 8, and 10.