Formatting guide

This is a guide for those who want to learn use LaTeX\LaTeX or simple formatting. If you want to contribute on brilliant, then you should use LaTeX\LaTeX in many cases. This makes your posts more readable.

When you don't know how to write a symbol, then use the Google. I will post there only the important symbols.

There are lots of LaTeX\LaTeX guides, but I think my guide will be the most readale and complete. Let's start the learning.


Content:

  1. What is Latex
  2. Basic formatting
    • 2.1. Italics and Bold text
    • 2.2. Paragraph
    • 2.3. Quote
    • 2.4. Bulleted and numbered lists
    • 2.5. link
    • 2.6. Pictures
    • 2.7. Code blocks
    • 2.8. Formatted box
    • 2.9. Tables
    • 2.10. Titles
    • 2.11. Horizontal lines
    • 2.12 Mentioning
  3. Basic latex operators and modificators
    • 3.1. Insert a latex code
    • 3.2. Spaces and line breaks
    • 3.3. The basic operators
    • 3.4. Brackets
    • 3.5. Modificators
    • 3.6. Basic align
    • 3.7. Basic characters
    • 3.8. Greek letters
    • 3.9. Text and symbols above and under characters
    • 3.10. Text
  4. Formatting with Latex
    • 4.1. Styles
    • 4.2. Font size
    • 4.3. Coloring
  5. Matrices and arrays
    • 5.1. Matrices
    • 5.2. Arrays
    • 5.3. Another one
    • 5.4. Dots
  6. Not math codes
  7. Useful tips
  8. Tasks

What is Latex

LaTeX\LaTeX is a formatting(or markdown) language to format documents or write formulas. In this web page we can't format documents, therefore lots of commands isn't working.


Basic formatting

This paragraph will help you to format your posts without LaTeX\LaTeX.

2.1. Italics and Bold text

What you typeWhat you get
*italics* or _italics_italics
**bold** or __bold__bold

You can combine the two styles like these:

  • ***Hello!***
  • *__Hello!__*
  • ___Hello!___

All possible combinations is correct. Each will appear as Hello!.

2.2. Paragraph

See this example:

I
love
to
do
it

I love to do this

Now try it with two or more spaces at the end of the lines:

I  
love  
to  
do  
it

I
love
to
do
this

Now try to take empty spaces:

I

love


to



do




it

I

love

to

do

this

If you fil the empty lines with spaces you will get the same result. If you want to take more empty sapces you should use LaTeX\LaTeX codes. But this isn't the LaTeX\LaTeX section, so let's continue.

2.3. Quote

> It will appear like this quote

It will appear like this quote

Let's see some examples:

> This
is
an
example

This is an example

Now try it with two or more spaces at the end of each lines:

> This  
is  
an  
example

This
is
an
example

Now try to connect two quotes:

> This is


> an example

This is
an example

If you want to separate them, then you should write something between them(this can be an empty LaTeX\LaTeX code too):

> This is

an

> example

This is

an

example

2.4. Bulleted and numbered lists

- buletted or * bulleted or + bulleted and 1. numbered

Usefull things:

  • You always should take an empty line before and after the list(If you don't take before it, then it will appear like a simple text, but if you don't take after it, then the simple text will be

connected to the list) - You should take a space after the - sign

I will show the examples with only bulleted lists:

This isn't a
- bulleted list

- bulleted list  

- bulleted list  
continue

 - shifted list

This isn't a - bulleted list

  • bulleted list

  • bulleted list
    continue

    • shifted list

\\

Let's see this one:

* It

 won't

* break
  • It

    won't

  • break \\

If you should write a date:

1956. Doesn't work  
1956\. Yeah
  1. Doesn't work
    1956. Yeah

\\

2.5. link

[<link text>](<link>)

Link text will appear.

[I'm happy](https://translate.google.com/?hl=hu#view=home&%3Bop=translate&%3Bsl=en&%3Btl=hu&%3Btext=I'm%20happy.&op=translate&sl=en&tl=hu&text=I'm%20happy)

I'm happy

There is the empty link

[I'm empty](#)

I'm empty

If you should use a link many times you can define links:

[link][id1]

[id1]: https://brilliant.org/discussions/thread/math-prove-marathon/  "Title"

link.

You can use links in LaTeX\LaTeX too, but this is unnecessary.

2.6. Pictures

When you upload a picture, then you will get a code. You should only insert it, if you placed to the wrong place(or if you want to insert it to the comment section). But when you want to use a

picture from the internet, then you should only copy the link of the picture: ![text under the picture](<link or uploaded link>){: .<position>}

The position can be: left,center,right. If you delete the {} brackets, then it will be left aligned.

Let's see an example for the three positions and how to combine links and pictures:

![](https://www.shutterstock.com/blog/wp-content/uploads/sites/5/2019/07/Man-Silhouette.jpg){: .left}
[![](https://www.shutterstock.com/blog/wp-content/uploads/sites/5/2019/07/Man-Silhouette.jpg){: .center}](https://d.newsweek.com/en/full/520858/supermoon-moon-smartphone-photo-picture.jpg)
Click to the picture!
![](https://www.shutterstock.com/blog/wp-content/uploads/sites/5/2019/07/Man-Silhouette.jpg){: .right}

Click to the picture!

As you can see if the picture isn't center aligned, then the text after the picture's link will appear next to the picture.

The code of the gif files are the same.

You can give a title to your picture. It won't appear: ![<text under the picture>](<link> "<Title>"){: .<position>}. You can define links to pictures too.

2.7. Code blocks

When we are talking about commands, then we use these:

`readln()`

readln()

We can take lots of ` before it, but then we should take the same amount of this signs after it.

If we want line breaks without break the code block:

```python
print "This is the best sentence"
```
1
print "This is the best sentence"

Sometimes the text after the code block doesn't appear. You should only place a title after the code and it will be good.

If you don't give the name of the programming language:

1
print "This is the best sentence"

You should take an empty line before it. If the text after the code block doesn't appear, then take a # after the block.

2.8. Formatted box

\\

If you take 4 spaces, then
it will appear like you typed

similar to the quote
          this will be if you take more than 4 spaces

2.9. Tables

\\

||1||2||3||
||4||wide column||
||||||same||

||other||table||:)||
||longer||row||than||the first||
123
4wide column
same
othertable:)
longerrowthanthe first

2.10. Titles

We can create 6 different titles(we can close them, but this is unnecessary):

# I'm your ego
## This is sometimes underlined ##
### I'm your IQ
#### Interesting
##### Nothing #####
###### Thin-king

I'm your ego

This is sometimes underlined

I'm your IQ

Interesting

Nothing
Thin-king

2.11. Horizontal lines

_ =Shift and `-` If under a text we take a - or = these will make a title. If we take an empty line, then these won't:

_

title 1
=

title 2
-

--
* * *
*
- -

title 1

title 2





2.12 Mentioning

@<name> When you start the typing to mention somebody, then the web page will give you options. If you don't choose one, then it won't work. You should choose the correct option. If the web page don't give you the required name, then continue the typing or try to type the name another way(for example without space).

Basic latex operators and modificators

3.1. Insert a latex code

The interpreter should distinct the LaTeX\LaTeX codes, so we should mark them. We can mark two types of LaTeX\LaTeX placement:

  • \(<code>\)
  • \[<code>\]

The first type of LaTeX\LaTeX placement will appear like this 1+2=31+2=3, but the second will like this 1+2=31+2=3. Both codes are placed into the sentence, but the second makes a break line before and after itself and the second is center aligned.

3.2. Spaces and line breaks

Spaces sometimes are allowed, sometimes they are necessary but sometimes they are unallowed. Let's see the rules:

RuleExample codeHow will ppear
Between the brackets the spaces are unallowed\ ( 1+3\ )\ ( 1+3\ )
In a command the spaces don't allowed\(\ta n(x)\)\tan(x)\ta n(x)
After a command if the next character is a letter, then the space is necessary\(\tanx\)\tanx\tanx
In other cases the spaces are allowed\(3    \;\;+    \;\;4 = 7\)3+4=73 + 4 = 7
Line breaks are allowed when spaces are allowed\(1 + \\ 3 = 4\)1+3=41 + 3 = 4

But these spaces won't appear. There you can see how to take a space:

CodeAppearanceNote
\,textte\,xt
\:textte\:xt
\;te  xtte\;xt
\!te ⁣xtte\!xtIf you take more\!: te ⁣ ⁣ ⁣ ⁣xtte\!\!\!\!xt
~te xtte~xt

Or you can insert a text or outside the brackets you can take one space. With these LaTeX\LaTeX codes you can take longer spaces.

You can make special spaces:

|{\kern 1pt} |{\kern 10pt} |{\kern 100pt}|\\
|\hspace{1pt} |\hspace{10pt} |\hspace{100pt}|

|{\kern 1pt} |{\kern 10pt} |{\kern 100pt}|\\ |\hspace{1pt} |\hspace{10pt} |\hspace{100pt}|

ptpt is a given length like cmcm and mmmm. InLaTeX\LaTeX (and in web building) there are other units, but the main units are: pt, px, em\text{pt, px, em}

Let's see how to make line breakes with special length:

4\\[30px]5

\(4\\[30px]5\)

You can give not integer numbers and negative numbers also.

54
5\hspace{0.7px}4
5\hspace{-4px}4

5454
545\hspace{0.7px}4
545\hspace{-4px}4

0.7=.70.7=.7

Here is some information about other length:

\rule{5in}{10px} 5 in
\rule{5cm}{10px} 5 cm
\rule{5cc}{10px} 5 cc
\rule{5nc}{10px} 5 nc
\rule{5pc}{10px} 5 pc
\rule{5em}{10px} 5 em
\rule{5ex}{10px} 5 ex
\rule{5mm}{10px} 5 mm
\rule{5dd}{10px} 5 dd
\rule{5nd}{10px} 5 nd
\rule{5px}{10px} 5 px
\rule{5bp}{10px} 5 bp
\rule{5pt}{10px} 5 pt
\rule{5sp}{10px} 5 sp

3.3. The basic operators

What you typeWhat you getNote
2=22=22=2
1+21+21+2
4*6464*6If you use other commands, then it will appear better
4\times64×64\times6If you are on mobile, then maybe you can find it at the symbols
4\cdot6464\cdot6
8/48/48/4you can use other commands too
8\div48÷48\div4On mobile you can write it without code
\frac{8}{4}84\frac{8}{4}You can use modificators. \frac 123 will be 123\frac 123
{3\choose2}(32){3\choose2}
\binom{3}{2}(32)\binom{3}{2}
2^3232^3If you want to write 2332^{33}, than you should write 2^{33}, without the { and } brackets it will appear like this 2332^33
2^{3^3}2332^{3^3}If you don't write brackets: 2^3^3
A_1A1A_1Same way as ^ if you want to write more characters you should use { and } brackets
A_{1_2}A12A_{1_2}
\sqrt{3}3\sqrt{3}
\sqrt[4]{5}54\sqrt[4]{5}
\parallel\parallel
\perp\perp

After the basic operators let's see some often used commands. There are some built in functions like \tan, \log, \gcd, \mod.... We can avoid them, but using them is easier. Let's see an

example: \tan(x)=1 and tan(x) will appear like tan(x)\tan(x) and tan(x)tan(x).

3.4. Brackets

\left ( \right )()\left ( \right )
\left \| \right \|\left \| \right \|
\left [ \right ][]\left [ \right ]
\left \langle \right \rangle\left \langle \right \rangle
\left \{ \right \}{}\left \{ \right \}
\left \lfloor \right \rfloor\left \lfloor \right \rfloor
\left | \right |\left | \right |
\left \lceil \right \rceil\left \lceil \right \rceil

3.5. Modificators

Sometimes we should use modificators. Let's see an example: 256+7+348\frac{\frac{2}{\frac{5}{6}+7}+3}{4^8}. As you can see this is too small. The modificators help us to set the size of the operators.

If we use the \displaystyle modificator before each fraction, then it will set the size automatically:

\displaystyle\frac{\displaystyle\frac{2}{\displaystyle\frac{5}{6}+7}+3}{4^8}256+7+348\displaystyle\frac{\displaystyle\frac{2}{\displaystyle\frac{5}{6}+7}+3}{4^8}

This is a long way to solve this problem, so we can use \dfrac{}{}. We will get the same result. With fractions there are some more modificators. Let's all of them in one table:

CodeAppearance
\frac{2+\frac{1}{5}}{\frac{7}{6}+4}2+1576+4\frac{2+\frac{1}{5}}{\frac{7}{6}+4}
\displaystyle\frac{2+\displaystyle\frac{1}{5}}{\displaystyle\frac{7}{6}+4}2+1576+4\displaystyle\frac{2+\displaystyle\frac{1}{5}}{\displaystyle\frac{7}{6}+4}
\dfrac{2+\dfrac{1}{5}}{\dfrac{7}{6}+4}2+1576+4\dfrac{2+\dfrac{1}{5}}{\dfrac{7}{6}+4}
\cfrac{2+\cfrac{1}{5}}{\cfrac{7}{6}+4}2+1576+4\cfrac{2+\cfrac{1}{5}}{\cfrac{7}{6}+4}
\tfrac{2+\tfrac{1}{5}}{\tfrac{7}{6}+4}2+1576+4\tfrac{2+\tfrac{1}{5}}{\tfrac{7}{6}+4}

Here is two examples with  ⁣ ⁣ ⁣ ⁣mod ⁣\!\!\!\!\mod\!:

CodeAppearance
2\mod42mod42\mod4
2\bmod42mod42\bmod4
2\pmod42(mod4)2\pmod4

The \displaystyle won't do anything.

In some cases the \displaystyle works only. Let's see some examples(I wrote the modificators before the operators):

OriginalModificated
234562^{3^{4^{5^6}}}234562\displaystyle^{3\displaystyle^{4\displaystyle^{5\displaystyle^6}}}
ABCDEA_{B_{C_{D_E}}}ABCDEA\displaystyle_{B\displaystyle_{C\displaystyle_{D\displaystyle_E}}}
ab\sum_a^bab\displaystyle\sum_a^b

Sometimes modificators cause some problem:

(46+21)(\dfrac{\dfrac{4}{6}+2}{1})

You can try the \displaystyle won't help. When we use brackets we use the \left and the \right modificators:

\left ( \dfrac{\dfrac{4}{6}+2}{1} \right )(46+21)\left ( \dfrac{\dfrac{4}{6}+2}{1} \right )

But sometimes we use only one bracket(usually when we are working with a matrix). Let's see an example:

\left | \dfrac{\dfrac{4}{6}+2}{1}\left | \dfrac{\dfrac{4}{6}+2}{1}

As you can see it's not working perfectly. When we start a bracket with a modificator then we should mark the pair of it and same way we can't end a bracket if we didn't marked the pair of it. The solution is easy:

\left | \dfrac{\dfrac{4}{6}+2}{1} \right.46+21\left | \dfrac{\dfrac{4}{6}+2}{1}\right.

3.6. Basic align

You can make left and center aligned equations already. But sometimes we make lots of modifications on only one side of the equation. Let's see that:

\begin{align}
A&=(4x+5)^2-8\\
&=16x^2+40x+25-8\\
&=16x^2+40x+17
\end{align}

A=(4x+5)28=16x2+40x+258=16x2+40x+17\begin{aligned} A&=(4x+5)^2-8\\ &=16x^2+40x+25-8\\ &=16x^2+40x+17 \end{aligned}

& means that where will the lines aligned. So the next characters after the & signs will make a straight vertical line. The \ signs means the line break. We should not take a line break after these signs, when we write the code, but if we take we can modificate easier it. We can use align* too, but it doesn't make anything. Let's see an interesting example:

\begin{align}
1&=333&=333&=22&=22&333&=22&=1\\
1&=22&22&=333&=22&1&=1&=22&=5&=1\\
4444&=1&=1&=1&=333&333&=4444&=1&=22&=55555\\
&&&&4444\\
22
\end{align}

1=333=333=22=22333=22=11=2222=333=221=1=22=5=14444=1=1=1=333333=4444=1=22=55555444422\begin{aligned} 1&=333&=333&=22&=22&333&=22&=1\\ 1&=22&22&=333&=22&1&=1&=22&=5&=1\\ 4444&=1&=1&=1&=333&333&=4444&=1&=22&=55555\\ &&&&4444\\ 22 \end{aligned}

  • Only each second & will be aligned into a line
  • We can skip lines with more & signs
  • Not only the = can make a straight line

3.7. Basic characters

Only the often used special characters:

\rightarrow\rightarrow\Rightarrow\Rightarrow
\leftarrow\leftarrow\Leftarrow\Leftarrow
\uparrow\uparrow\Uparrow\Uparrow
\downarrow\downarrow\Downarrow\Downarrow
\pm±\pm\mp\mp
\leq\leq\geq\geq
\lfloor\lfloor\rfloor\rfloor
\lceil\lceil\rceil\rceil
\therefore\therefore\because\because
\angle\angle\triangle\triangle
\equiv\equiv\approx\approx
\in\in\ni\ni
\ll\ll\gg\gg
\neq\neq
|x|,|=AltGr+Wx|x|
\infty\infty

As you can see there are modifications of the arrows. If you start with a big letter you will get a double arrow. You can use modificators too: long, leftright, updown

There are lots of characters. I won't write all of them. Here you can see more characters.

Let's see the big operators:

\int\int
\iint\iint
\oint\oint
\sum\sum
\prod\prod
\bigcap\bigcap
\bigcup\bigcup

3.8. Greek letters

\Alpha and \alphaA\Alpha and α\alpha\Nu and \nuN\Nu and ν\nu
\Beta and \betaB\Beta and β\beta\Xi and \xiΞ\Xi and ξ\xi
\Gamma and \gammaΓ\Gamma and γ\gamma\Omicron and \omicronO\Omicron and ο\omicron
\Delta and \deltaΔ\Delta and δ\delta\Pi, \pi and \varpiΠ\Pi, π\pi and ϖ\varpi
\Epsilon, \epsilonand \varepsilonE\Epsilon, ϵ\epsilon and ε\varepsilon\Rho, \rho and \varrhoP\Rho, ρ\rho and ϱ\varrho
\Zeta and \zetaZ\Zeta and ζ\zeta\Sigma, \sigma and \varsigmaΣ\Sigma, σ\sigma and ς\varsigma
\Eta and \etaH\Eta and η\eta\Tau and \tauT\Tau and τ\tau
\Theta, \theta and \varthetaΘ\Theta, θ\theta and ϑ\vartheta\Upsilon and \upsilonΥ\Upsilon and υ\upsilon
\Iota and \iotaI\Iota and ι\iota\Phi, \phi and \varphiΦ\Phi, ϕ\phi and φ\varphi
\Kappa, \kappa and \varkappaK\Kappa, κ\kappa and ϰ\varkappa\Chi and \chiX\Chi and χ\chi
\Lambda and \lambdaΛ\Lambda and λ\lambda\Psi and \psiΨ\Psi and ψ\psi
\Mu and \muM\Mu and μ\mu\Omega and \omegaΩ\Omega and ω\omega

3.9. Text and symbols above and under characters

{}'a{a}'
{}''a{a}''
\dot{}a˙\dot{a}
\ddot{}a¨\ddot{a}
\hat{}a^\hat{a}
\check{}aˇ\check{a}
\grave{}aˋ\grave{a}
\acute{}aˊ\acute{a}
\tilde{}a~\tilde{a}
\breve{}a˘\breve{a}
\bar{}aˉ\bar{a}
\vec{}a\vec{a}
\not{}\not{a}
^{\circ}aa^{\circ}
\widetilde{}abc~\widetilde{abc}
\widehat{}abc^\widehat{abc}
\overleftarrow{}abc\overleftarrow{abc}
\overrightarrow{}abc\overrightarrow{abc}
\overline{}abc\overline{abc}
\underline{}abc\underline{abc}
\overbrace{}abc\overbrace{abc}
\underbrace{}abc\underbrace{abc}
\overset{}{}abc123\overset{123}{abc}
\underset{}{}abc123\underset{123}{abc}
\xrightarrow[]{}123abc\xrightarrow[123]{abc}
\xleftarrow[]{}123abc\xleftarrow[123]{abc}

In every case the first brackets contain the 123. You can see we can't use overset and underset at the same time. Instead we can use arrays and matrices. The brackets can contain arrows also: Δt\overset{\Delta t}{\rightarrow}

And there is one interesting thing:

\boxed{12.5}=\fbox{12.5}

12.5=12.5\boxed{12.5}=\fbox{12.5}

And we can do this:

\cancel{123456789}

123456789\cancel{123456789}

3.10. Text

\text{} between the brackets everything will appear.

\text{I'm happy...}I’m happy...\text{I'm happy...}

Formatting with Latex

4.1. Styles

CodeAppearanceCodeAppearance
\textnormal{}BIG small\textnormal{BIG small}\mathnormal{}BIGsmall\mathnormal{BIG small}
\textup{}BIG small\textup{BIG small}\boldsymbol{}BIGsmall\boldsymbol{BIG small}Note: with this code we can print bold symbols: \boldsymbol{\uparrow}
\textbf{}BIG small\textbf{BIG small}\mathbf{}BIGsmall\mathbf{BIG small}
\textit{}BIG small\textit{BIG small}\mathit{}BIGsmall\mathit{BIG small}
\textrm{}BIG small\textrm{BIG small}\mathrm{}BIGsmall\mathrm{BIG small}
\textsf{}BIG small\textsf{BIG small}\mathsf{}BIGsmall\mathsf{BIG small}
\textrm{}BIG small\textrm{BIG small}\mathrm{}BIGsmall\mathrm{BIG small}
\texttt{}BIG small\texttt{BIG small}\mathbb{}BIGsmall\mathbb{BIG small}
\textmd{}BIG small\textmd{BIG small}
\mathcal{}BIGsmall\mathcal{BIG small}
\mathfrak{}BIGsmall\mathfrak{BIG small}

These are unnecessary codes, you shouldn't learn them. As you can see only the text formats will display the spaces.

4.2. Font size

\tinytiny\tiny\text{tiny}
\scriptsizescriptsize\scriptsize\text{scriptsize}
\footnotesizefootnotesize\footnotesize\text{footnotesize}
\smallsmall\small\text{small}
\normalsizenormalsize\normalsize\text{normalsize}
\largelarge\large\text{large}
\LargeLarge\Large\text{Large}
\LARGELARGE\LARGE\text{LARGE}
\hugehuge\huge\text{huge}
\HugeHuge\Huge\text{Huge}

If we place the code in a title:

Bubu\Huge \text{Bubu}

Bubu\Huge \text{Bubu}

4.3. Coloring

There are built in colores:

\red{}, \blue{}, \green{}, \orange{} etc.

redrat\red{red rat}

We can use \color{}. Between the brackets we should give the name of the color. This will be active until you don't change the color again.

There are two ways to give the color:

  • \color{red}, \color{blue}, \color{black}
  • With hexadecimal code: \color{#<code>}

Let's see an example to the second: If our color is the basic red, then with RGB(RedGreenBlue\color{#ff0000}\text{Red}\color{#00ff00}\text{Green}\color{#0000ff}\text{Blue})

coloring:

Red=100%\color{#ff0000}\text{Red}=100\%100%=(256)10100\%=(256)_{10}(256)10=(FF)16(256)_{10}=(FF)_{16}
Green=0%\color{#00ff00}\text{Green}=0\%0%=(0)100\%=(0)_{10}(0)10=(00)16(0)_{10}=(00)_{16}
Blue=0%\color{#0000ff}\text{Blue}=0\%0%=(0)100\%=(0)_{10}(0)10=(00)16(0)_{10}=(00)_{16}

So the code will be \color{#FF0000}: red\color{#ff0000}\text{red}

Let's see a complex color: #4DA3EC color\color{#4da3ec} color

Here you can set the color and get the code of it.

If we use the color command between two { } brackets, then the text after the brackets won't be colored:

{\color{green}green}black

greenblack{\color{#20A900}green}black

Let's see an interesting example:

\color{red}red{\color{green}green}unknown

redgreenunknown\color{#D61F06}red{\color{#20A900}green}unknown

We can use \textcolor{} also:

\textcolor{red}{red}

red\textcolor{#D61F06}{red}

\textcolor{red}red

red\textcolor{#D61F06}red

But we can make color boxes:

\colorbox{blue}{black\color{#FFFFFF}white}

blackwhite\colorbox{#3D99F6}{black\color{#ffffff}white}

And we can make color boxes with border:

\fcolorbox{red}{blue}{\text{The text command include the whole text, but the brackets are necessary}}

The text command include the whole text, but the brackets are necessary\fcolorbox{#D61F06}{#3D99F6}{\text{The text command include the whole text, but the brackets are necessary}}

Matrices and arrays

5.1. Matrices

Matrices are similar to tables and to the aligned equations. & means the next column an \ means the next row(If \ is annoying, then you can use \cr):

\begin{matrix}
1 & 2 & 3\\
4 & 5 & 6
\end{matrix}

123456\begin{matrix} 1 & 2 & 3\\ 4 & 5 & 6 \end{matrix}

Like with tables, there you can skip columns and you can make longer rows than the first:

\begin{matrix}
1 & 2 & 3\\
1 & 2 &
3 & 4 & 5\\
&&3&&5
\end{matrix}

1231234535\begin{matrix} 1 & 2 & 3\\ 1 & 2 & 3 & 4 & 5\\ &&3&&5 \end{matrix}

You can see if we won't write a whole line we can skip the & symbols. And you can see also that I taked a line break, but it doesn't displayed.

Let's see the types of the matrices:

  • pmatrix

\begin{pmatrix}
1 & 2 & 3\\
4 & 5 & 6
\end{pmatrix}

(123456)\begin{pmatrix} 1 & 2 & 3\\ 4 & 5 & 6 \end{pmatrix}

  • bmatrix

\begin{bmatrix}
1 & 2 & 3\\
4 & 5 & 6
\end{bmatrix}

[123456]\begin{bmatrix} 1 & 2 & 3\\ 4 & 5 & 6 \end{bmatrix}

  • Bmatrix

\begin{Bmatrix}
1 & 2 & 3\\
4 & 5 & 6
\end{Bmatrix}

(123456)\begin{pmatrix} 1 & 2 & 3\\ 4 & 5 & 6 \end{pmatrix}

  • vmatrix

\begin{vmatrix}
1 & 2 & 3\\
4 & 5 & 6
\end{vmatrix}

123456\begin{vmatrix} 1 & 2 & 3\\ 4 & 5 & 6 \end{vmatrix}

  • Vmatrix

\begin{Vmatrix}
1 & 2 & 3\\
4 & 5 & 6
\end{Vmatrix}

123456\begin{Vmatrix} 1 & 2 & 3\\ 4 & 5 & 6 \end{Vmatrix}

But we can use special matrices too:

\left\{\left. \begin{matrix}
1 & 3 & 5\\
7 & 4 & 9
\end{matrix}\right |\right.

{135749\left\{\left. \begin{matrix} 1 & 3 & 5\\ 7 & 4 & 9 \end{matrix}\right |\right.

But we can place a matrix into another matrix:

\begin{matrix}
1 & \begin{matrix}
2 & 3\\ 
4 & 5
\end{matrix}\\ 
6 & 7
\end{matrix}

1234567\begin{matrix} 1 & \begin{matrix} 2 & 3\\ 4 & 5 \end{matrix}\\ 6 & 7 \end{matrix}

We can insert horizontal lines into the matrix with \hline:

\begin{matrix}
2 & 4\\
\hline 5 & 6
\end{matrix}

2456\begin{matrix} 2 & 4\\ \hline 5 & 6 \end{matrix}

If we need a vertical line, then we should use two matrices or use an array. Let's see the arrays.

5.2. Arrays

The arrays are similar to matrices, but when we begin an array, then we should give the align of each colummn:

\begin{array}{<align>}
<array>
\end{array}

<align> can be:

  • c - center
  • l - left
  • r - right

If we have more columns than that we have declared we will get an error message. But we can skip the empty columns. Let's see an example:

\begin{array}{lcr}
7777777 & 4444 & 666666\\
4444 & 1\\
22&&999999999
\end{array}

777777744446666664444122999999999\begin{array}{lcr} 7777777 & 4444 & 666666\\ 4444 & 1\\ 22&&999999999 \end{array}

Now let's see how to insert a vertical line:

\begin{array}{c|c}
1 & 2\\
3 & 4\\
5 & 6\\
\end{array}

123456\begin{array}{c|c} 1 & 2\\ 3 & 4\\ 5 & 6\\ \end{array}

5.3. Another one

\begin{cases}
y=1 & x=5  \\ 
y=2 & x=4 \\ 
y=3 & x=3 \\ 
y=4 & x=2 \\ 
y=5 & x=1 
\end{cases}

{y=1x=5y=2x=4y=3x=3y=4x=2y=5x=1\begin{cases} y=1 & x=5 \\ y=2 & x=4 \\ y=3 & x=3 \\ y=4 & x=2 \\ y=5 & x=1 \end{cases} You can't add new columns. But if you insert a matrix, then you can solve it.

5.4. Dots

There are lots of dots. Here you can see the main codes(from wikibooks):

\dots\dotsGeneric dots (ellipsis), to be used in text (outside formulae as well). It automatically manages whitespaces before and after itself according to the context, it's a higher level command.
\ldots\ldotsThe output is similar to the previous one, but there is no automatic whitespace management; it works at a lower level.
\cdots\cdotsThese dots are centered relative to the height of a letter. There is also the binary multiplication operator, \cdot, mentioned below.
\vdots\vdotsvertical dots
\ddots\ddotsdiagonal dots

Not math codes

This web page doesn't support all LaTeX\LaTeX codes. Therefore we can't use lots of not mathematical codes. I think only basic formatting, chemical equations and square drawing are supported. Let's see the chemical equations:

You can already write chemical equations:

\text{CH}_4+2\text{O}_2\rightarrow2\text{H}_2\text{O}+\text{CO}_2

CH4+2O22H2O+CO2\text{CH}_4+2\text{O}_2\rightarrow2\text{H}_2\text{O}+\text{CO}_2

But this can be easier:

\ce{CH4 + 2O2 -> 2H2O + CO2}

CHX4+2OX22HX2O+COX2\ce{CH4 + 2O2 -> 2H2O + CO2}

Here you can see the main things(these are the examples from there):

\ce{H2O}HX2O\ce{H2O}
\ce{CrO4^2-}CrOX4X2\ce{CrO4^2-}
\ce{A <--> B}AB\ce{A <--> B}
\ce{A ->[x_i] B}AxXiB\ce{A ->[x_i] B}
\ce{CO2 + C -> 2 CO}COX2+C2CO\ce{CO2 + C -> 2 CO}
\ce{A\bond{~--}B\bond{~=}C\bond{-~-}D}A---B---C---D\ce{A\bond{~--}B\bond{~=}C\bond{-~-}D}

Spaces are necessary

And the square drawing:

\rule[raise]{width}{height}

\rule{78pt}{.4cm}\color{red}\rule[.2cm]{24px}{2 mm}\hspace{-24px}\color{blue}\rule{24px}{2mm}

\rule{78pt}{.4cm}\color{#D61F06}\rule[.2cm]{24px}{2 mm}\hspace{-24px}\color{#3D99F6}\rule{24px}{2mm}

For more information see: 3.2. Spaces and line breaks

And the big question:

  • The big question: How to write LaTeX\LaTeX
  • Answer: \LaTeX

Here is a cool website, where you can make equations without learning codes.

Useful tips

  • Don't write a lot of text in LaTeX\LaTeX. This can be annoying, and in small screens others can't read your text
  • Make your code always readable. If you have an error, then you can edit it quickly
  • If you can't follow your brackets, then take line breaks or spaces
  • Always see the spaces after each codes
  • Always see the end of the LaTeX\LaTeX code. If your code doesn't ended it will make a big problem
  • Always use readable font size, but not too big(\LARGE can be too big)
  • Use the Preview button before you post something. The LaTeX\LaTeX sometimes doesn't displayed. Use any online editor to see your codes
  • If you write a longer code, then save it, sometimes the web page delete your codes
  • Don’t take big line breaks. You can take 500000px long line breaks, but don’t do that!\color{#D61F06}\text{Don't take big line breaks. You can take 500000px long line breaks, but don't do that!}
  • Don't copy codes from others

Tasks

You can make symbols with negative spaces, rectangles, characters.... There are two examples from my note about programming tasks:

\color{#888888}\Large\bigodot \hspace{-666200sp}\rule[3px]{1.3px}{5.5px}\hspace{-289000sp}\rule[11.5px]{7.5px}{1.7px} \hspace{1pt}

\color{#888888}\rule[4px]{14px}{2.2px}\hspace{-14px}\rule{14px}{2.2px}\hspace{-14px}\rule[-4px]{14px}{2.2px}

Make a special symbol and I will include it

Note by Páll Márton
2 weeks, 1 day ago

No vote yet
1 vote

  Easy Math Editor

This discussion board is a place to discuss our Daily Challenges and the math and science related to those challenges. Explanations are more than just a solution — they should explain the steps and thinking strategies that you used to obtain the solution. Comments should further the discussion of math and science.

When posting on Brilliant:

  • Use the emojis to react to an explanation, whether you're congratulating a job well done , or just really confused .
  • Ask specific questions about the challenge or the steps in somebody's explanation. Well-posed questions can add a lot to the discussion, but posting "I don't understand!" doesn't help anyone.
  • Try to contribute something new to the discussion, whether it is an extension, generalization or other idea related to the challenge.
  • Stay on topic — we're all here to learn more about math and science, not to hear about your favorite get-rich-quick scheme or current world events.

MarkdownAppears as
*italics* or _italics_ italics
**bold** or __bold__ bold

- bulleted
- list

  • bulleted
  • list

1. numbered
2. list

  1. numbered
  2. list
Note: you must add a full line of space before and after lists for them to show up correctly
paragraph 1

paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)example link
> This is a quote
This is a quote
    # I indented these lines
    # 4 spaces, and now they show
    # up as a code block.

    print "hello world"
# I indented these lines
# 4 spaces, and now they show
# up as a code block.

print "hello world"
MathAppears as
Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.
2 \times 3 2×3 2 \times 3
2^{34} 234 2^{34}
a_{i-1} ai1 a_{i-1}
\frac{2}{3} 23 \frac{2}{3}
\sqrt{2} 2 \sqrt{2}
\sum_{i=1}^3 i=13 \sum_{i=1}^3
\sin \theta sinθ \sin \theta
\boxed{123} 123 \boxed{123}

Comments

Sort by:

Top Newest

Excellent LaTeX formatting guide! I am saving this one...

Yajat Shamji - 2 weeks ago

Log in to reply

Thank you! I'm working on this yet

Páll Márton - 2 weeks ago

Log in to reply

Don't worry. I put it in my saved collection!

Yajat Shamji - 2 weeks ago

Log in to reply

Huhh! I extended it.

Páll Márton - 2 weeks ago

Log in to reply

I hope this is better

Páll Márton - 2 weeks ago

Log in to reply

@Páll Márton Still excellent!

Yajat Shamji - 1 week, 6 days ago

Log in to reply

@Jeff Giff Here is a new formatting guide for Radmaths !

Zakir Husain - 1 week, 6 days ago

Log in to reply

@Jeff Giff See what will happen if you click to the link to this guide. Delete your link's last section from there: ?from_notification=...

Páll Márton - 1 week, 6 days ago

Log in to reply

And thank you!

Páll Márton - 1 week, 6 days ago

Log in to reply

Red Maths LOL :)

Percy Jackson - 1 week, 5 days ago

Log in to reply

Its RADMaths, but...

Jeff Giff - 1 week, 2 days ago

Log in to reply

@Jeff Giff Zakir always calls it RedMaths, maybe he doesn't know the meaning of rad :)

Percy Jackson - 1 week, 2 days ago

Log in to reply

@Percy Jackson I doubt it. What about history?

Páll Márton - 1 week, 2 days ago

Log in to reply

@Páll Márton Doubt what??? and what history???

Percy Jackson - 1 week, 2 days ago

Log in to reply

@Percy Jackson I think he can use the rad word. From there you can understand it

Páll Márton - 1 week, 2 days ago

Log in to reply

@Páll Márton Oh! ok, but he still calls it redmaths, LOL

Percy Jackson - 1 week, 2 days ago

Log in to reply

@Percy Jackson redmath\color{#D61F06}\text{redmath} is rad. BTW this isn't important

Páll Márton - 1 week, 2 days ago

Log in to reply

@Páll Márton LOL, rad :)

Percy Jackson - 1 week, 2 days ago

Log in to reply

Great! The only one with the cases, which I once spent AN HOUR looking for :P

Jeff Giff - 1 week, 6 days ago

Log in to reply

Thank you!

Páll Márton - 1 week, 6 days ago

Log in to reply

Now this is complete :) Maybe some codes are missing, but I think I finished it

Páll Márton - 1 week, 6 days ago

Log in to reply

\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\\[-3.75pt] {\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}\\[-3.75pt] \rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\\[-3.75pt] {\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}\\[-3.75pt] \rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\\[-3.75pt] {\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}\\[-3.75pt] \rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\\[-3.75pt] {\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}{\color{#FFFFFF}\rule{20px}{20px}}\rule{20px}{20px}

Páll Márton - 1 week, 2 days ago

Log in to reply

\rule{100pt}{161.8pt}
Golden ratio

Jeff Giff - 1 week, 2 days ago

Log in to reply

WHA WHAAA WHAAAAAAAAAAAAAAAA! How much time do you have? I've got 30 minutes a day to update my guide lol, this one is way better. Awesome @Páll Márton - This deserves to be turned into a Latex wiki, maybe you should ask Brilliant Mathematics, Calvin Lin, or someone else.......................

Percy Jackson - 1 week, 5 days ago

Log in to reply

Yeah, I have a lot of time. But I think the wiki page is better. I wanted to make an example, where you should search the error, but this take a lot of time

Páll Márton - 1 week, 5 days ago

Log in to reply

Yours is better than wiki page, as you have more than what the wiki has, just ask some moderator or something dude, this is good stuff

Percy Jackson - 1 week, 5 days ago

Log in to reply

@Percy Jackson The wiki page is about only LaTeX\LaTeX. There you can see more codes. But you are right, because some codes are missing.

Páll Márton - 1 week, 5 days ago

Log in to reply

Wait... the mod and bmod. Wrong code.

Jeff Giff - 1 week, 5 days ago

Log in to reply

Why? If you write only \mod then it won't work, but ~\mod~ mod ~\mod~

Páll Márton - 1 week, 5 days ago

Log in to reply

No, look- abmodn,amodn,a(modn)a\equiv b \mod n,a \bmod n, a\pmod n , mod, bmod, pmod

Jeff Giff - 1 week, 4 days ago

Log in to reply

@Jeff Giff What is the problem? Your codes are a\equiv b \mod n,a \bmod n, a\pmod n so the codes are good.

Páll Márton - 1 week, 4 days ago

Log in to reply

@Páll Márton Dude, my point is, \mod has a SPACE before it. bmod doesn’t. Check out your guide. Wrong code! :D

Jeff Giff - 1 week, 4 days ago

Log in to reply

@Jeff Giff Yeah. Thank you!

Páll Márton - 1 week, 4 days ago

Log in to reply

@Páll Márton I got it

Páll Márton - 1 week, 4 days ago

Log in to reply

@Páll Márton :)

Jeff Giff - 1 week, 4 days ago

Log in to reply

1\bra{1} \bra{1}, for qubits

Jeff Giff - 1 week, 4 days ago

Log in to reply

I can't write anything. Just stop it. I don't understand your jokes. What is so funy in facepalm?

. . . . . .. . . . . . . . . . . ,.-‘”. . . . . . . . . .``~.,
. . . . . . . .. . . . . .,.-”. . . . . . . . . . . . . . . . . .“-.,
. . . . .. . . . . . ..,/. . . . . . . . . . . . . . . . . . . . . . . ”:,
. . . . . . . .. .,?. . . . . . . . . . . . . . . . . . . . . . . . . . .\,
. . . . . . . . . /. . . . . . . . . . . . . . . . . . . . . . . . . . . . ,}
. . . . . . . . ./. . . . . . . . . . . . . . . . . . . . . . . . . . ,:`^`.}
. . . . . . . ./. . . . . . . . . . . . . . . . . . . . . . . . . ,:”. . . ./
. . . . . . .?. . . __. . . . . . . . . . . . . . . . . . . . :`. . . ./
. . . . . . . /__.(. . .“~-,_. . . . . . . . . . . . . . ,:`. . . .. ./
. . . . . . /(_. . ”~,_. . . ..“~,_. . . . . . . . . .,:`. . . . _/
. . . .. .{.._$;_. . .”=,_. . . .“-,_. . . ,.-~-,}, .~”; /. .. .}
. . .. . .((. . .*~_. . . .”=-._. . .“;,,./`. . /” . . . ./. .. ../
. . . .. . .\`~,. . ..“~.,. . . . . . . . . ..`. . .}. . . . . . ../
. . . . . .(. ..`=-,,. . . .`. . . . . . . . . . . ..(. . . ;_,,-”
. . . . . ../.`~,. . ..`-.. . . . . . . . . . . . . . ..\. . /\
. . . . . . \`~.*-,. . . . . . . . . . . . . . . . . ..|,./.....\,__
,,_. . . . . }.>-._\. . . . . . . . . . . . . . . . . .|. . . . . . ..`=~-,
. .. `=~-,_\_. . . `\,. . . . . . . . . . . . . . . . .\
. . . . . . . . . .`=~-,,.\,. . . . . . . . . . . . . . . .\
. . . . . . . . . . . . . . . . `:,, . . . . . . . . . . . . . `\. . . . . . ..__
. . . . . . . . . . . . . . . . . . .`=-,. . . . . . . . . .,%`>

@Jeff Giff isn't annoying. Peace(and glory :D )!

Páll Márton - 1 week, 4 days ago

Log in to reply

This isn't working. The space is too big :)

Páll Márton - 1 week, 4 days ago

Log in to reply

Vaguely speaking, it does look like a facepalm, albeit unusual.

Percy Jackson - 1 week, 4 days ago

Log in to reply

Di Immortales! Did it take you 2 hours to type that, or did you copy/paste?

Percy Jackson - 1 week, 4 days ago

Log in to reply

copy/paste :)

Páll Márton - 1 week, 4 days ago

Log in to reply

@Páll Márton smart, but unnecessary :)

Percy Jackson - 1 week, 4 days ago

Log in to reply

Jeff Giff isn't annoying in a He-is-a-idiot kind of way

More like a Leo-kind-of-way, so nothing bad about it :)

facepalm isn't funy, its funny :)

The jokes were courtesy of Leo, but they were pretty non-funny, if that's even a word.

Happy 7.27 day!

Before you ask what 7.27 day is its today 7/27/2020, why you may ask, because a super complex number like pi has a day, why not 7.27 :)

Percy Jackson - 1 week, 4 days ago

Log in to reply

@Páll Márton - How do you make that box, where latex doesn't work, the one where you write your syntax, and the one where you wrote the latex commands for greeks letters as an example, your guide is very long, so i didn't find it LOL

Percy Jackson - 1 week, 3 days ago

Log in to reply

2.7. and 2.8. Code blocks and Formatted box :)

Páll Márton - 1 week, 3 days ago

Log in to reply

Ctrl+f

Páll Márton - 1 week, 3 days ago

Log in to reply

Got it, thanks!

@Páll Márton

Percy Jackson - 1 week, 3 days ago

Log in to reply

Yeah.

Páll Márton - 1 week, 3 days ago

Log in to reply

You are welcome!

Páll Márton - 1 week, 3 days ago

Log in to reply

Excellent work @Páll Márton

Mahdi Raza - 5 days, 14 hours ago

Log in to reply

Thank you! But this was a long work :)

Páll Márton - 5 days, 12 hours ago

Log in to reply

  • Make your code readable. If you get an error, then you can edit it quickly.
  • Remember to check the spaces after each codes.
  • Always check the end of the LATE​X code. If your code doesn't end, your will face many errors.
  • Use readable font size, but not too big (\LARGE is usually too big).
  • Use the Preview button before you post something, because the LaTeX isn't displayed sometimes. Use an online editor to verify whether your codes work or not.
  • If you have written a lot of code, then save it, as the web page doesn't always save your codes.
@Páll Márton - I did some grammatical corrections and stuff in the Useful Tips part :)

Percy Jackson - 1 day, 21 hours ago

Log in to reply

×

Problem Loading...

Note Loading...

Set Loading...