How Many Characters Do AsciiDoc, Markdown & LaTeX Need?

When writing technical documentation, simplicity and efficiency often come down to how many characters are required to apply standard formatting.

In this article, we'll compare AsciiDoc, Markdown, and LaTeX based on the number of characters needed for basic formatting, while also touching upon some of Markdown's limitations.

For the character comparison, we will include all required characters. This may also include whitespaces (e.g. for lists). Let's have a look at the results first:

1. Setup Overhead

  • AsciiDoc: No setup required.

  • Markdown: No setup required.

  • LaTeX: Requires significant setup, with at least 101 characters to initialize the document with \documentclass{article}, \usepackage{hyperref}, as well as \begin{document} & \end{document}. For basic use, LaTeX incurs a setup cost that neither AsciiDoc nor Markdown has.

2. Headings & Subheadings

Headings in all three languages are fairly straightforward:

Heading:

  • AsciiDoc: = (1 character)

  • Markdown: # (1 character)

  • LaTeX: \section{} (10 characters)

Subheading:

  • AsciiDoc: == (2 characters)

  • Markdown: ## (2 characters)

  • LaTeX: \subsection{} (13 characters)

3. Basic Text Formatting: Bold, Italic, Underline

Bold, italic, and underline formatting varies in character length:

Bold:

  • AsciiDoc: *...* (2 characters)

  • Markdown: **...** (4 characters)

  • LaTeX: \textbf{...} (9 characters)

Italic:

  • AsciiDoc: _..._ (2 characters)

  • Markdown: *...* (2 characters)

  • LaTeX: \textit{...} (9 characters)

Underline:

  • AsciiDoc: [.underline]#...# (14 characters)

  • LaTeX: \underline{...} (15 characters)

Underlining text shows the first example when Markdown requires further extensions (also called dialects or flavors) to display underlined text as it is not supported natively.

Here are three ways to underline text in Markdown, based on different approaches and dialects:

1. Using HTML Tags:

You can directly embed HTML tags within Markdown to underline text: <u>...</u>

HTML Tags are supported in most Markdown dialects like GitHub-Flavored Markdown and CommonMark.

2. Using Pandoc's Markdown Extensions:

Pandoc allows for underlining with specific extensions. You can use the following syntax: [...]{.underline}

3. Using CSS Styling:

You can apply inline CSS to underline text in Markdown: <span style="text-decoration:underline;">...</span>

Each method relies on specific Markdown dialects or renderers, so check which one fits your environment. These workarounds require 7 (HTML Tags), 14 (Pandoc) or 48 (CSS) characters to display underlined text.

adoc Studio Banner with Newsletter Form
Curious for more?
Subscribe to our Newsletter.

4. Lists and Subitems

Handling lists across these languages:

  • AsciiDoc: * ... for a list item and ** ... for a subitem (5 characters total)

  • Markdown: * ... for a list item and - ... for a subitem (6 characters total)

  • LaTeX:

\begin{itemize}

  \item ...

  \subitem ...

\end{itemize}

(50 characters total)

5. Links and Images

Both links and images are crucial in documentation:

Links:

  • AsciiDoc: www.test.com[...] (2 characters)

  • Markdown: [...](www.test.com) (4 characters)

  • LaTeX: \href{www.test.com}{...} (9 characters)

Images:

  • AsciiDoc: image:...[] (8 characters)

  • Markdown: ![...](...) (11 characters)

  • LaTeX: \includegraphics[...]{...} (38 characters)

Total Character Count Comparison

Let’s tally up the total characters used for these elements. We compare the tags with and without setup, as well as including and excluding underlining, which requires markdown dialects:

Without Setup Overhead:

  • AsciiDoc: 36 characters

  • Markdown: min. 37 characters (using HTML tags for underlining)

  • LaTeX: 153 characters

Including Setup:

  • AsciiDoc: 36 characters

  • Markdown: min. 37 characters (using HTML tags for underlining)

  • LaTeX: 254 characters

Excluding Underline & Setup:

  • AsciiDoc: 22 characters

  • Markdown: 30 characters

  • LaTeX: 138 characters

adoc Studio Banner
Create Technical Documentation in AsciiDoc.
Organize, Write and Share.

Documentation in AsciiDoc.
Organize, Write and Share.
Start Free 14-Day Trial

Conclusion: Lightweight Markup Languages Truly Deserve Their Nam

In terms of raw character count, AsciiDoc tends to require fewer characters than both Markdown and LaTeX. Especially LaTeX, although powerful and flexible, is much more verbose. Each language has its strengths depending on your needs, but for brevity and ease of use, AsciiDoc shines in this comparison.

Markdown is undoubtedly one of the most popular markup languages due to its simplicity and ease of use. However, Markdown's elegance comes at a cost: limited feature support without extensions.

As mentioned in the comparison, underlining is not available in standard Markdown. Similarly, Markdown's native support for complex features like tables, footnotes, and text & image alignment is minimal or non-existent, requiring extensions like GitHub Flavored Markdown or Pandoc Markdown. While Markdown can handle basic formatting with ease, when it comes to creating more advanced or structured documents (e.g., with complex tables, custom numbering in lists, or detailed image placement), it quickly becomes evident that Markdown alone may not suffice. Users often find themselves reaching for other dialects, plugins, or embedding raw HTML to achieve their goals.

In summary, AsciiDoc offers a happy medium—combining the conciseness of Markdown with the advanced capabilities of LaTeX—making it a strong choice for technical documentation without the need for extensions.

Have we piqued your interest? Then take a look at adoc Studio. With our app, you can organize, write and export AsciiDoc documents in no time at all.


© adoc Studio