The first chapter¶ ↑
label{cha:a_chapter}
This is the first paragraph of the Softcover
Markdown template produced with the softcover\ command-line interface. It shows how to write a document in Markdown, a lightweight markup language, augmented with the kramdown converter and some custom extensions, including support for embedded PolyTeX, a subset of the powerful LaTeX\ typesetting system.1 For more information, see {The Softcover Book}. To learn how to easily publish (and optionally sell) documents produced with Softcover
, visit Softcover.io.
This is the second paragraph, showing how to emphasize text.2 You can also make text bold or emphasize a second way. Via embedded PolyTeX, Softcover
also supports colored text, such as coloredtext{red}{red}, coloredtext{CornflowerBlue}{cornflower blue}, and coloredtexthtml{E8AB3A}{arbitrary HTML colors}.
A section¶ ↑
label{sec:a_section}
This is a section. You can refer to it using the LaTeX\ cross-reference syntax, like so: Section~ref{sec:a_section}.
Source code¶ ↑
This is a subsection.
You can typeset code samples and other verbatim text using four spaces of indentation:
def hello puts "hello, world" end
Softcover
also comes with full support for syntax-highlighted source code using kramdown's default syntax, which combines the language name with indentation:
{lang=“ruby”} def hello puts “hello, world” end
Softcover's Markdown mode also extends kramdown to support so-called “code fencing” from GitHub-flavored Markdown:
def hello puts "hello, world!" end
The last of these can be combined with PolyTeX's codelisting
environment to make code listings with linked cross-references (Listing~ref{code:hello}).
begin{codelisting} codecaption{Hello, world.} label{code:hello}
def hello puts "hello, world!" end
end{codelisting}
Mathematics¶ ↑
Softcover's Markdown mode supports mathematical typesetting using LaTeX\ syntax, including inline math, such as ( phi^2 - phi - 1 = 0, ) and centered math, such as [ phi = frac{1+sqrt{5}}{2}. ] It also supports centered equations with linked cross-reference via embedded PolyTeX\ (Eq.~eqref{eq:phi}).
begin{equation} label{eq:phi} phi = frac{1+sqrt{5}}{2} end{equation}
Softcover
also supports an alternate math syntax, such as {$$}phi^2 - phi - 1 = 0{/$$}, and centered math, such as
{$$} phi = frac{1+sqrt{5}}{2}. {/$$}
The LaTeX\ syntax is strongly preferred, but the alternate syntax is included for maximum compatibility with other systems.
Images and tables¶ ↑
This is the second section.
Softcover
supports the inclusion of images, like this:
Using LaTeX\ labels, you can also include a caption (as in Figure~ref{fig:captioned_image}) or just a figure number (as in Figure~ref{fig:figure_number}).
Tables¶ ↑
Softcover
supports raw tables via a simple table syntax:
|HTTP request | URL | Action | Purpose | | GET
| /users | index
| page to list all users | | GET
| /users/1 | show
| page to show user with id 1
| | GET
| /users/new | new
| page to make a new user | | POST
| /users | create
| create a new user | | GET
| /users/1/edit | edit
| page to edit user with id 1
| | PATCH
| /users/1 | update
| update user with id 1
| | DELETE
| /users/1 | destroy
| delete user with id 1
|
See {The Softcover Book} to learn how to make more complicated tables.
Command-line interface¶ ↑
Softcover
comes with a command-line interface called softcover
. To get more information, just run softcover help
:
$ softcover help Commands: softcover build, build:all # Build all formats softcover build:epub # Build EPUB softcover build:html # Build HTML softcover build:mobi # Build MOBI softcover build:pdf # Build PDF softcover build:preview # Build book preview in all formats . . .
noindent You can run softcover help <command>
to get additional help on a given command:
$ softcover help build Usage: softcover build, build:all Options: -q, [--quiet] # Quiet output -s, [--silent] # Silent output Build all formats
Miscellanea¶ ↑
This is the end of the template—apart from two mostly empty chapters. In fact, let’s include the last chapter in its entirety, just to see how mostly empty it is:
<<(chapters/yet_another_chapter.md, lang: text)
Visit {The Softcover Book} to learn more about what Softcover
can do.
1 Pronunciations of “LaTeX” differ, but lay-tech is the one I prefer.
2 This is a footnote. It is numbered automatically.