The is the first paragraph of the Softcover article template. It shows how to write a document in PolyTeX, a subset of the LaTeX\ typesetting language optimized for writing ebooks.footnote{Pronunciations of “LaTeX'' differ, but emph{lay}-tech is the one I prefer.}

This is the second paragraph, showing how to emph{emphasize} text. You can also make text textbf{bold}.

section{A section} label{sec:a_section}

This is a section. We'll take a look at some of the features supported by Softcover.

subsection{Source code}

In plain Markdown, you can typeset code samples and other verbatim text using four spaces of indentation:

begin{verbatim} def hello

puts "hello, world"

end end{verbatim}

Softcover also supports GitHub-style “code fencing'' with language-specific syntax highlighting:

%= lang:ruby begin{code} # “Hello, world!” in Ruby. def hello

puts "hello, world!"

end end{code}

The second of these can be combined with Softcover's kode{codelisting} environment to make code listings via embedded LaTeX, as shown in Listing~ref{code:hello}.

begin{codelisting} codecaption{Hello, world.} label{code:hello} %= lang:ruby begin{code} # “Hello, world!” in Ruby. def hello

puts "hello, world!"

end end{code} end{codelisting}

subsection{Mathematics}

Softcover supports mathematical typesetting via embedded LaTeX. This includes both inline math, such as ( phi^2 - phi - 1 = 0, ) and centered math, such as [ phi^2 - phi - 1 = 0. ] Softcover also supports numbered equations via embedded LaTeX, as seen in Eq.~eqref{eq:phi} and Eq.~eqref{eq:gauss}.

begin{equation} label{eq:phi} phi = frac{1+sqrt{5}}{2} approx 1.618 end{equation}

begin{equation} label{eq:gauss} mathbf{nabla}cdotmathbf{B} = 0 qquadmbox{Gauss's law} end{equation}

section{Images and tables} label{sec:images_and_tables}

This is the second section. Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

subsection{Images}

Softcover supports the inclusion of images, like this:

image{images/figures/01_michael_hartl_headshot.jpg}

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}).

beginfigure begin{center} image{images/figures/01_michael_hartl_headshot.jpg} end{center} caption{Some dude.label{fig:captioned_image}} end{figure}

beginfigure begin{center} image{images/figures/01_michael_hartl_headshot.jpg} end{center} caption{label{fig:figure_number}} end{figure}

subsection{Tables}

Softcover supports raw tables via the LaTeX\ kode{table} or kode{longtable} environments.

begin{longtable}{|l|l|l|l|} hline textbf{HTTP request} & textbf{URL} & textbf{Action} & textbf{Purpose}\ kode{GET} & /users & kode{index} & page to list all users\ kode{GET} & /users/1 & kode{show} & page to show user with id kode{1}\ kode{GET} & /users/new & kode{new} & page to make a new user\ kode{POST} & /users & kode{create} & create a new user\ kode{GET} & /users/1/edit & kode{edit} & page to edit user with id kode{1}\ kode{PATCH} & /users/1 & kode{update} & update user with id kode{1}\ kode{DELETE} & /users/1 & kode{destroy} & delete user with id kode{1}\ hline end{longtable}

Softcover also supports kode{tabular} environments, as shown in Table~ref{table:figure_placement}.

begin{table} caption{Options for a float placement specifier.label{table:figure_placement}} begin{tabular}{l|l} textbf{Specifier} & textbf{Placement} \ hline kode{h} & Place the float emph{approximately} here \ kode{h!} & Place the float emph{(almost) exactly} here \ kode{t} & Place at the top of the page \ kode{b} & Place at the bottom of the page \ kode{p} & Put on a special page for floats only end{tabular} end{table}

section{Final section}

This is the final section. The previous sections were Section~ref{sec:a_section} and Section~ref{sec:images_and_tables}.