2022
I love reading books, especially beautiful books. Everytime I read a nicely formatted book, I told myself I would want to make a book that looks exactly like this. But I’m yet to find an app that allows me to do that. Alright, now I’m writting it myself and call it Bookless!
This is the first book written using Bookless, about how to use it to write a book just like this one.
Bookless is built on top of Pandoc. Hence many parts of this book will come from Pandoc manual. You should check them out if you want to build a writing app. Still, this book is about how to write a book, so let’s get started!
Writing a book is hard. It’s harder if we don’t have a powerful enough tool for it.
When onto writing something, I want to turn on the full focus mode. Concentrate only to what I am thinking and writing at the moment. Nothing else. That the first thing I want when creating Bookless: the distraction-free mode.
There is rarely anyone who are writing a one-chapter book. I love to organize things for the sake of self-sanity. So my book should be divided into chapters. That the second things Bookless must have: the chapters explorer.
Plain text files are kings. Of course they are! Not every computers come with a pre-installed expensive Microsoft Word. But I assure you, every single one can edit a plain text file! So Bookless book’s chapters are, not very surprisingly, just plain text files on your computer.
Just download Bookless from its GitHub, and then install it to your computer. Get started with 3 simple steps:
A typical book contain many chapters. They will be displayed on your left bar. Click the bookmark icon to expand it if it’s hidden. Click again to enter focus mode. You can double click on the top area to toggle the mode if you like.
All chapters belong to the book will be shown on the left. You can drag and drop to re-order them. Each chapter is a Markdown file on your choosen working folder. You can rename or delete them as you see fit. Just be aware that the delete action is permanent, there is no recycle bin for you to look for deleted files.
Each chapter file must start immediately with the chapter title using
the first-level heading, e.g., # Chapter Title
. All
Markdown files must be encoded in UTF-8, especially when they contain
multi-byte characters such as Chinese, Japanese, and Korean. Here is an
example (the bullets are the filenames, followed by the file
content):
preface.md
# Preface {-}
In this book, we will introduce an interesting method.
intro.md
# Introduction
This chapter is an overview of the methods that we propose to solve an **important problem**.
method.md
# Methods
We describe our methods in this chapter.
application.md
# Applications
Some _significant_ applications are demonstrated
in this chapter.
## Example one
## Example two
summary.md
# Final Words
We have finished a nice book.
The content are automatically saved so you don’t have to. You should put your book on a backup system like Dropbox or iCloud to prevent any unwanted accident that may happen to your computer.
This chapter demonstrates the syntax of common components of a book written in Bookless. The approach is based on Pandoc, so we start with the syntax of Pandoc’s flavor of Markdown.
In this section, we give a very brief introduction to Pandoc’s Markdown. Readers who are familiar with Markdown can skip this section. The comprehensive syntax of Pandoc’s Markdown can be found on the Pandoc website.
You can make text italic by surrounding it with underscores
or asterisks, e.g., _text_
or *text*
.
For bold text, use two underscores
(__text__
) or asterisks (**text**
).
Text surrounded by ~
will be converted to a subscript
(e.g., H~2~SO~4~
renders H2SO4), and
similarly, two carets (^
) produce a superscript (e.g.,
Fe^2+^
renders Fe2+).
To mark text as inline code
, use a pair of backticks,
e.g., `code`
.1
Small caps can be produced by the HTML tag span
, e.g.,
<span style="font-variant:small-caps;">Small Caps</span>
renders Small Caps.
Links are created using [text](link)
, e.g.,
[RStudio](https://www.rstudio.com)
, and the syntax for
images is similar: just add an exclamation mark, e.g.,

.
Footnotes are put inside the square brackets after a caret
^[]
, e.g., ^[This is a footnote.]
.
Section headers can be written after a number of pound signs, e.g.,
# First-level header
## Second-level header
### Third-level header
If you do not want a certain heading to be numbered, you can add
{-}
after the heading, e.g.,
# Preface {-}
This may cause the chapter doesn’t have correct chapter name on the page header. You need to add a TeX command to an unnumbered header to fix this:
# Preface {-}
\markboth{}{}
Unordered list items start with *
, -
, or
+
, and you can nest one list within another list by
indenting the sub-list by four spaces, e.g.,
- one item
- one item
- one item
- one item
- one item
The output is:
Ordered list items start with numbers (the rule for nested lists is the same as above), e.g.,
1. the first item
2. the second item
3. the third item
The output does not look too much different with the Markdown source:
Blockquotes are written after >
, e.g.,
> "I thoroughly disapprove of duels. If a man should challenge me,
I would take him kindly and forgivingly by the hand and lead him
to a quiet place and kill him."
>
> --- Mark Twain
The actual output (we customized the style for blockquotes in this book):
“I thoroughly disapprove of duels. If a man should challenge me, I would take him kindly and forgivingly by the hand and lead him to a quiet place and kill him.”
— Mark Twain
Plain code blocks can be written after three or more backticks, and you can also indent the blocks by four spaces, e.g.,
```
This text is displayed verbatim / preformatted
```
Or indent by four spaces:
This text is displayed verbatim / preformatted
Inline LaTeX equations can be written in a pair of dollar signs using
the LaTeX syntax, e.g.,
$f(k) = {n \choose k} p^{k} (1-p)^{n-k}$
(actual output:
f(k)={n \choose k}p^{k}(1-p)^{n-k});
math expressions of the display style can be written in a pair of double
dollar signs, e.g.,
$$f(k) = {n \choose k} p^{k} (1-p)^{n-k}$$
, and the output
looks like this:
f\left(k\right)=\binom{n}{k}p^k\left(1-p\right)^{n-k}
You can also use math environments inside $ $
or
$$ $$
, e.g.,
$$\begin{array}{ccc}
x_{11} & x_{12} & x_{13}\\
x_{21} & x_{22} & x_{23}
\end{array}$$
\begin{array}{ccc} x_{11} & x_{12} & x_{13}\\ x_{21} & x_{22} & x_{23} \end{array}
$$X = \begin{bmatrix}1 & x_{1}\\
1 & x_{2}\\
1 & x_{3}
\end{bmatrix}$$
X = \begin{bmatrix}1 & x_{1}\\ 1 & x_{2}\\ 1 & x_{3} \end{bmatrix}
$$\Theta = \begin{pmatrix}\alpha & \beta\\
\gamma & \delta
\end{pmatrix}$$
\Theta = \begin{pmatrix}\alpha & \beta\\ \gamma & \delta \end{pmatrix}
$$\begin{vmatrix}a & b\\
c & d
\end{vmatrix}=ad-bc$$
\begin{vmatrix}a & b\\ c & d \end{vmatrix}=ad-bc
\
Generate this image:
If you want to create a figure, remove the last backslash:

Table: A simple table in Markdown.
|Sepal.Length| Sepal.Width | Petal.Length | Petal.Width |
|------------|-------------|--------------|-------------|
| 5.1 | 3.5| 1.4| 0.2|
| 4.9 | 3.0| 1.4| 0.2|
| 4.7 | 3.2| 1.3| 0.2|
| 4.6 | 3.1| 1.5| 0.2|
| 5.0 | 3.6| 1.4| 0.2| | 5.4 | 3.9| 1.7| 0.4|
Will generate the table below.
Sepal.Length | Sepal.Width | Petal.Length | Petal.Width |
---|---|---|---|
5.1 | 3.5 | 1.4 | 0.2 |
4.9 | 3.0 | 1.4 | 0.2 |
4.7 | 3.2 | 1.3 | 0.2 |
4.6 | 3.1 | 1.5 | 0.2 |
5.0 | 3.6 | 1.4 | 0.2 |
5.4 | 3.9 | 1.7 | 0.4 |
Bookless supports HTML / PDF / ePub exports using embedded Pandoc.
You can export Bookless books into a single HTML file using the HTML export option.
You need to install Latex on your system before using this feature.
To be written…
Bookless allows you to customize these book preferences:
All configuration will be saved on _bookless.yaml file. This is a valid Pandoc defaults file so you can use Pandoc command line to generate the book without Bookless.
To be written…
To be written…
You can export either the whole book or each chapter using Share icons.
To be written…
To be written…
To be written…
A: It would never be.
To include literal backticks, use
more backticks outside, e.g., you can use two backticks to preserve one
backtick inside: `` `code` ``
.↩︎