Addition on April 2, 2009
The post below was my first atempt to use LaTeX in the WordPress environment. It shows some quick examples that I used as tests to find what works and what doesn’t work and which were the differences between WordPress LaTeX and the standard version found at CTAN (Comprehensive TeX Archive Network). Further, I made some other posts reporting more sistematic experiments that became a reference for my own use of WordPress LaTeX.
These are the other posts:
- Uses of Math Symbols and Equations
- Multiline Equations, Symbols and Matrices
- LaTeX Equations Fine-tunning
- Extra examples and some bugs found in WordPress LaTeX
This is the original post (with the so-called funny examples):
_________________________________________________________________________
March, 10, 2008
Now it’s time to try using WordPress blog support to LaTeX. It seems pretty easy. You only need two things:
- To read this announcement.
- To know a bit about LaTeX (find a LaTeX primer here).
Let’s try some basic thing:
To do it just write $ latex \frac{100}{20} = 5 $ , following the indications on the announcement.
Hint: 1. to display the LaTeX syntax without parsing it just put a space between $ and latex statements.
Hint: 2. You can write the latex statements straight on the “Visual” tab of the editing interface – you don’t have to go to the “Code” tab to do it.
Let’s now do some more complex things:
$ latex \frac{x+y}{a} + \frac{x-y}{b} = \frac{b(x+y) +a(x-y)}{ab} $ gives:
In order to display with a greater font size you add &s=X at the end of the expression, as shown below. The X value is illustrated in the announcement.
$ latex \frac{x+y}{a} + \frac{x-y}{b} = \frac{b(x+y) +a(x-y)}{ab} &s=1$ gives:
$ latex \frac{x+y}{a} + \frac{x-y}{b} = \frac{b(x+y) +a(x-y)}{ab} &s=2$ gives:
OK, now I have finished the for Dummies level. Let us improve a bit more !
More math statements
In the following examples, I’ve changed the color of the formula by adding the statement &fg=aa0000 before the &s=1. The string represents the RGB values of the desired color in hexadecimal notation: rrggbb. The statement fg indicates foreground color. Of course bg is used for the background. See the announcement.
$ latex a_0 x^2 + a_1 x + a_2 = 0 &fg=aa0000&s=1$ gives:
Warning: don’t put any spaces between statements that specify changes in the math environment. Example: &fg=aa0000&s=1 and not &fg=aa0000 &s=1.
For the next four examples, I’ve omitted the formatting statements, for the sake of clarity:
x = \frac{-b \pm \sqrt{b^2 – 4ac}}{2a} gives:
\int_a^b f(x)dx = {\cal F}_{a,b} gives:
\lim\limits_{n \rightarrow \infty} \sum\limits_{i=0}^n \sum_j \alpha_{ij} gives:
\frac{1}{1+ \frac{1}{1+x}}\leq y^2*\log_{n}{\delta} gives:
Math environments
Now we’ll try some multiline expressions:
$ latex (x+y)(x-y) = x^2 – xy + yx – y^2 \\ = x^2 – y^2 \\ (x+y)^2 = x^2 + 2xy + y^2 &fg=aa0000&s=1$
that gives:
Notice that the expression lines are correct, however they are not properly aligned. You can do the alignment by using the statement {array}. Suppose that you want to align the = signals:
$ latex \begin{array}{ccc} (x+y)(x-y) & = & x^2 – xy + yx – y^2 \\ & = & x^2 – y^2 \\ (x+y)^2 & = & x^2 + 2xy + y^2 \end{array} &fg=aa0000&s=1$
that gives:
The declaration {ccc} specifies the columns in each line, as if your multiline expression could be treated as a table. The letters specify the indentation of each column: c = center, l= left, r = right.
Matrices
Here, there is an example of how to assemble a matrix:
\left| \begin{array}{cc} x_{11} & x_{12} \\ x_{21} & x_{22} \end{array} \right|
Obs – For the sake of clarity, the $ latex &fg=aa0000&s=1$ was not shown in the last declaration.So, the ideal template to use with mathematical formulas is:
$ latex formula &fg=aa0000&s=1$
To use it, choose the font color by changing properly the values in the declaration &fg=rrggbb (remember: RGB, in hexadecimal, taking values on 00…ff) and set the font size with &s=n, being n the number indicating the size. Don’t forget that in the template above a space was put between the $ and latex, you must suppress it !
22 comments
Comments feed for this article
July 23, 2008 at 3:34 am
Mathematik-Schule online » Blog Archive » Mathematische Fundstellen 07/23/2008 (a.m.)
[…] Blogging with LaTeX content « Machine Intelligence ? […]
November 30, 2008 at 2:16 pm
Rajan Varadarajan
Dear Dr. Kogler – Thanks much for your tutorials on using LaTeX in WordPress. When I found out that WordPress supported LaTeX, I wanted to write a tutorial. But, you have made my job easier. I am new to WordPress – just recently started a blog for teaching middle through high school mathematics (after having gone through enormous frustrations in raising two intelligent sons but poorly served in math by their schools). It is rather sad that math education in the United States at the school level is quite deficient. I have been living in the USA for 35 years; came to the USA from India to get my PhD in Chemical Engineering. The blog is mathpastures.wordpress.com. Hope you don’t object to my linking your LaTeX tutorials. Thanks again.
December 1, 2008 at 1:13 am
Joao Kogler
Dear Rajan Varadarajan, your links are welcome. I have also a blog (although in Portuguese) about math and engineering topics directed to my students ( it is in jkogler.wordpress.com). Good luck with your blogs !
January 30, 2009 at 8:42 pm
So, let’s try that LaTeX support… « 355/113’s blog - Approximately a Mathematician
[…] https://kogler.wordpress.com/2008/03/10/blogging-with-latex-content/ […]
January 30, 2009 at 8:59 pm
355over113
Hi there,
I just added some LaTex stuff to my brand new blog (my first blog too) but it doesn’t work at all:
http://355over113.wordpress.com/
Can anyone help?
Thanks a lot in advance!
February 2, 2009 at 7:59 pm
Joao Kogler
Hi,
I can’t figure out exactly what was your intention, but if your problem was just to display the parsed expression $ latex \frac{100}{20} = 5 $, you must be careful to suppress the space between $ and latex, as follows
February 2, 2009 at 8:47 pm
355over113
Great stuff; thanks a lot! Now that I know it works it is safe to invest some time reading some other LaTeX primers, tutorials, etc (having access to Scientific Workplace in the past made me totally lazy about learning LaTeX…)
July 12, 2009 at 5:50 am
G
Do you know the code for expressing long division in a wordpress weblog? Write to me privately if you would like to. Is there a LaTex code for this?
July 13, 2009 at 2:22 am
Joao Kogler
For (standard) LaTeX there is the polynom package (which is not available for WordPress LaTeX ).
See documentation at:
Click to access polynom.pdf
Maybe you should try to typeset a LaTeX document using the polynom package and then convert to WordPress LaTeX using Luca Trevisan’s LaTeX2WP, see at:
I haven’t tried all these yet, however…
Other simpler possibility is to construct your example of the long division controlling the identation by yourself, using the array construction rules shown at:
August 4, 2009 at 7:17 am
Chicas Escuela Mexico
emm.. bookmarked 🙂
March 1, 2011 at 7:44 pm
Blogging with LaTeX content (via Machine Intelligence ?) | Data Supervisor
[…] Addition on April 2, 2009 The post below was my first atempt to use LaTeX in the WordPress environment. It shows some quick examples that I used as tests to find what works and what doesn't work and which were the differences between WordPress LaTeX and the standard version found at CTAN (Comprehensive TeX Archive Network). Further, I made some other posts reporting more sistematic experiments that became a reference for my own use of WordPress … Read More […]
March 2, 2011 at 2:38 pm
Joao Kogler
Thank you for the feedback. I’m glad in hearing that the post has been useful.
March 7, 2011 at 12:41 am
在博客中使用latex | 师域 www.09-10.com
[…] Blogging with LaTeX content « Machine Intelligence ? […]
June 25, 2011 at 9:40 am
LaTeX – Multiline equations, systems and matrices « Robert's World
[…] Basics and overview […]
February 19, 2013 at 8:28 pm
Asymptotic Notation | Lizi's Blog
[…] Reference: How to use LaTeX? math152.wordpress.com/latex/ Machine Intelligence? kogler.wordpress.com/2008/03/10/blogging-with-latex-content/ LaTeX Symbols omega.albany.edu:8008/Symbols.html Steven S. Skiena CSE373 Stony Brook University […]
March 4, 2013 at 7:14 am
Code snippets in wordpress pages | geotecha
[…] https://kogler.wordpress.com/2008/03/10/blogging-with-latex-content/ […]
July 15, 2015 at 3:01 pm
Blogging with LaTeX content | Life is Beautiful
[…] Please refer to: https://kogler.wordpress.com/2008/03/10/blogging-with-latex-content/ […]
October 25, 2016 at 4:29 pm
WordPressで数式を書くならJetPackプラグイン! | 縦々横々~じゅーじゅーおーおー
[…] Using LaTeX with WordPress […]
February 28, 2017 at 12:47 am
หาจำนวน Fibonacci ด้วย Matrix | Ultimateohm's Blog
[…] f(3) ถ้าเขียนในรูป matrix (ขอเขียนแบบ Python list นะครับ) […]
February 22, 2019 at 8:00 am
20190222 – The Chrysalis.
[…] <etc>https://kogler.wordpress.com/2008/03/10/blogging-with-latex-content/ […]
February 28, 2019 at 11:01 pm
Linear Transformations and TeX/LaTeX – Welcome to the Symbolic Domain
[…] This has also been a useful exercise in , which I have been learning about as well. If you want to quickly get going with to display math formulas in blog pages, go here. […]
October 6, 2019 at 5:36 am
Setting Up My First Blog – Philip's blog
[…] to embed LaTeX code in the posts. WordPress.com already has good support for inline formulas (see here), but unfortunately it lacked cross-references and did not allow embedding some “fancy” […]