WebTeX

Getting Started

WebTeX is a tool for technical and scientific writing. It builds on Markdown, which lets you do the basic formatting that you expect from any writing app. WebTeX extends Markdown by adding support for math expressions, citations, and cross-referencing.

Basic formatting

To make things like headings, bold text, italic text, and links, you can use Markdown. You may have used Markdown before on sites like Reddit or GitHub. Just like these sites, WebTeX is based on the CommonMark spec.

It works like this:

Editable Example
**Bold**

_Italic_

[Link](https://webtex.vercel.app/)

---

## Section

### Subsection

---

- Apples
- Oranges
- Pears

1. Eat
2. Sleep
3. Write
4. Repeat

---

![Look at this graph!](/nickelback.jpg)

---

> This is a quote.

---

Inline `code` with backticks

```
Code blocks with triple backticks
```

When you write content on the left, a preview will be shown here

In the example above, two things are different from most other Markdown tools:

  1. Section headings are automatically numbered
  2. Images are given a caption, and they are automatically numbered

Tables

Let's make some tables!

Editable Example
Here's a simple table:

| Fruit   | Count |
| ------- | ----- |
| Apples  | 4     |
| Oranges | 2     |
| Pears   | 1     |

You can set the alignment of columns like this:

| Left  | Center   | Right      |
| :---- | :------: | ---------: |
| Apple | Fruit    | $1         |
| Car   | Vehicle  | $1,000     |
| House | Property | $1,000,000 |

Note that you don't need to format it nicely, this will still work:

|Fruit|Count|
|-|-|
|Apples|4|
|Oranges|2|
|Pears|1|

When you write content on the left, a preview will be shown here

Math

Math works just like in TeX\TeX, by wrapping it in $-signs:

Editable Example
Inline math: $e^{i\pi} = -1$

And here is a math block:

$$
\binom{n}{k} = \frac{n!}{k!(n-k)!}
$$

When you write content on the left, a preview will be shown here

Many TeX\TeX functions are supported, including macros using \newcommand etc. For a full list of supported functions, refer to the KaTeX docs.

Citations

You can cite your sources using the :cite[source] command, where source is the ID of one the items in your bibliography. The Bibliography tab is where you can enter your sources in BibTeX format. You can get BibTeX citations from many places, such as Google Scholar and arXiv.

Here's an example:

Editable Example
Let's cite a source :cite[knuth1984].

And let's cite some more :cite[tesler2012, victor2012].

A section with references is created at the end of the document.

When you write content on the left, a preview will be shown here

Cross-referencing

Figures and sections can be referenced using the :ref[id] command, where id is the ID of the element you want to reference. Before something can be referenced, it must have an ID. You can give something an ID using the :id[your-id] command.

For example, this is how you reference a figure:

Editable Example
![Look at this graph!](/nickelback.jpg) :id[graph]

---

Now :ref[graph] is a reference to the figure.

When you write content on the left, a preview will be shown here

Referencing sections is even easier, because you don't have to give them an ID unless you want to. Check this out:

Editable Example
## A section :id[first-section]

Some text.

## Another section

More text.

---

:ref[first-section] works.

And :ref[another-section] works too!

When you write content on the left, a preview will be shown here

HTML

A great feature of Markdown is that you can include any HTML you want.

Just look at the possibilities:

Editable Example
You can use many HTML elements, for example to create <mark>marked text</mark>.

---

You can do custom styling with CSS:

<p style="color: blue; text-align: center;">I'm blue, da ba dee da ba daa</p>

---

And this is how you insert an image without a caption:

<img src="/nickelback.jpg">

Or a heading without numbering:

<h2>Don't count on me!</h2>

When you write content on the left, a preview will be shown here