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:
**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:
- Section headings are automatically numbered
- Images are given a caption, and they are automatically numbered
Headings with one #
are not numbered, so you can use these as the title of
the document. If you don't want to use captions or automatic numbering, check out the
section on HTML.
Tables
Let's make some tables!
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 , by wrapping it in $-signs:
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 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:
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.
@book{knuth1984, title={The {TeX}book}, author={Knuth, Donald Ervin and Bibby, Duane}, volume={15}, year={1984}, publisher={Addison-Wesley Reading} } @article{tesler2012, author = {Tesler, Larry}, title = {A Personal History of Modeless Text Editing and Cut/Copy-Paste}, year = {2012}, volume = {19}, number = {4}, doi = {10.1145/2212877.2212896}, journal = {ACM Interactions}, pages = {70–75} } @misc{victor2012, title={Inventing on Principle}, author={Victor, Bret}, year={2012}, url={https://youtu.be/PUv66718DII} }
When you write content on the left, a preview will be shown here
Currently, WebTeX supports the ACM citation style. We plan to support other styles in the future.
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:
![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:
## 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
Be careful when referencing sections without giving them an ID. When you change the title of the section, the reference will break.
You can find the ID of any section by hovering over the heading in the preview.
HTML
A great feature of Markdown is that you can include any HTML you want.
Just look at the possibilities:
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
There are a lot of HTML elements, here's a list of some useful ones.