@section{Simple mark-up}

Text can be @em{emphasized} or @bf{bold}.

@section{Paragraphs}

Begin of
a paragraph.
This paragraph ends here.

Begin of a new paragraph.
This paragraph ends here.

The last new paragraph. This paragraph ends here.

@section{Lists}

@subsection{Simple lists}

Here is a list:
@begin{itemize}
@item with some item
@item other item
@item more items
@end{itemize}

@subsection{Nested lists}

A list with nested items:
@begin{itemize}
@item item 1
@begin{itemize}
@item subitem 1-1
@item subitem 1-2
@begin{itemize}
@item subitem 1-2-1
@end{itemize}
@item subitem 1-3
@end{itemize}
@item item 2
@begin{itemize}
@item subitem 2-1
@end{itemize}
@item item 3
@end{itemize}

@subsection{Enumerated lists}

Enumerated list with automatic numbering:
@begin{enumerate}
@item First
@item Second
@item Third
@end{enumerate}

@noindent Enumerated list with explicit numbering:
@begin{enumerate}
@item{1} First
@item{2} Second
@item{3} Third
@end{enumerate}

@noindent Enumerated list with non-consecutive explicit numbering:
@begin{enumerate}
@item{2} First
@item{4} Second
@item{6} Third
@end{enumerate}

@begin{alert}
  The following only works in some backends.
@end{alert}

@noindent Enumerated list mixing all above:
@begin{enumerate}
@item{2} First
@item{4} Second
@item Third
@item Fourth
@item{10} Fifth
@item Sixth
@end{enumerate}

@subsection{Description lists}

Description lists:
@begin{description}
@item{opt} First
@item{foo} Second
@item{bar} Third
@end{description}

@subsection{Description lists (more complex cases)}

Description lists with richer items:
@begin{description} 
@item{@tt{atom}} an atom.
@item{@pred{append/3}} a predicate or functor name.
@item{@tt{f(X0,...,Xn)}} some term with variables @var{X0}, ..., @var{Xn}.
@item{@var{X}} a variable.
@item{@math{x^2}} some math.
@item{@math{\bigwedge_j f_j(x_0, \ldots, x_n)}} some complex math.
@end{description} 

@section{Sections and subsections}
Text for the section.

@subsection{Subsection}
Text for the subsection.

@subsubsection{Subsubsection}
Text for the subsubsection.

@section{Links}

A link to @href{https://ciao-lang.org} showing its URL.

A link to @href{https://ciao-lang.org}{Ciao} hiding its URL.

A link to @href{https://ciao-lang.org}{The @bf{Ciao} System} hiding its
URL with a complex string.

@section{Anchors, labels, references, bibliographical citations}

A reference to the first section in this document @ref{Paragraphs}.

@begin{alert}
  Implement symbolic labels. Fix the @tt{texinfo} backend by resolving
  them to the section title.
@end{alert}

@section{Other elements}

We will not include lightweight mark-up syntax for anything else
not described in this document (e.g., images).

@section{Syntax for code}

@subsection{Code spans}

This is a predicate name @pred{append/3}, a variable name @var{X}, an
atom name @tt{foo}, a quoted atom name @tt{'foo'}.

@subsection{Blocks of code}

Text that is 4-char indented is recognized as code:

@begin{verbatim}
list([]).
list([X|Xs]) :- list(Xs)
@end{verbatim}

Code itself can have comments:

@begin{verbatim}
% definition for lists
list([]). % see append/3
list([X|Xs]) :- list(Xs)
@end{verbatim}

Code itself can have documentation comments:

@begin{verbatim}
%! definition for lists
list([]). %< see `append/3`
list([X|Xs]) :- list(Xs)
@end{verbatim}

@subsection{Blocks of other code}

This is a piece of C code:

@begin{verbatim}
#include <stdio.h>
int main(void) { return 0; }
@end{verbatim}
