Freeduc-docLatex

From OFSET Wiki

Jump to: navigation, search

Contents

[edit] Introduction

A granule is a documentation unit written with the LaTeX text composition system. In fact it is brut text where tag like \emph{emphasize} helps to structure the document. A granule should be a software introduction document. Later the granules are aggregated to build up the documentation corpus, as a book (hypertext PDF document) or as on-line HTML documentation. The PDF composition is done with the PdfLaTeX software, the HTML one with the HyperLaTeX software.

[edit] Syntax

To structure the document, a specific set of dedicated LaTeX commands are used. These commands are explained in the following sections.

[edit] Title

[edit] Section title
\freeducSection{software name}

Each granule must start with this tag. It declares a 1st level section. Between the {}, the application name must be written. This name will show up in the table of contents.

[edit] Sub-section title
\freeducSubsection{Sub-section title}

This tag starts a second level section. It shows up in the table of contents aswell.

[edit] Sub-sub-section title
\freeducSubsubsection{Sub-sub-section title}

This tag starts a third level section. It does not show up in the table of contents aswell.

[edit] Paragraph title
\freeducParagraph{Paragraph title}

This tag starts a fourth level section. It does not show up in the table of contents aswell.

[edit] Sub-paragraph title
\freeducSubparagraph{Sub-paragraph title}

This tag starts a fifth level section. It does not show up in the table of contents aswell.

[edit] Hypertext link

\freeducLink{http://www.toto.net}

This tag created a URL link in the HTML output. Note:

  • If a tilde ~ appears in the URL, it must be escaped as \~ because it is a special caracter for LaTeX
  • The same is true for the characters _, %, & , #, you must write them as \_, \%, \& , \#.

Example: To write the URL http://www.ofset.org/~h_f, you must write:

\freeducLink{http://www.ofset.org/\~h\_f}

[edit] Picture insertion

You have several tags to insert picture in your document.

[edit] Fixed width, with legend
\freeducFigure{PictureLegend}{PictureFile}

This tag prints a centered picture with a legend.

  • PictureLegend: the associated legend to the picture, it is printed below the picture.
  • PictureFile: the name of the file picture in the PNG format. PictureName must be written without the .png part.

When the picture name is toto.png, just write it toto.

Example: \freeducFigure{Une photo de toto}{toto} where toto.png is a file.

Note: In the PDF output, the picture is adjusted with a width of 9cm, so you do not need to care about too large picture. There is another command when you want to specify a different width.

[edit] Variable width, with legend
\freeducFigureSize{PictureLegend}{PictureFile}{width in cm}

As the one above with the additional width parameter for the PDF output. This third parameter has no effect in the HTML output.

[edit] Fixed width
\freeducImage{PictureFile}

As \freeducFigure without legend.

[edit] Variable width
\freeducImageSize{PictureFile}{width in cm}

As \freeducFigureSize without legend.

[edit] Fixed width icon
\freeducIcon{PictureFile}

It displays the picture as a small icon in the text flow. Usefull to display graphic user interface icon.

[edit] Important note

\freeducNote{A text note}

It displays a text paragraph with an emphasized style. Usefull to display important remarks.

[edit] Index entry

\freeducIndex{Index-niv1}{Index-niv2}{Index-niv3}{}

It creates an index entry a the end of the book. The index will be a page number or an hyperlink. The Index entry goes from the lesser specific to the greater specific. Semantically, it must make sense to read Index-niv2 is-a-sort-of Index-niv1.

Example: DrGeo indexes

\freeducIndex{Mathematics}{Geometry}{Dr. Geo}{}
\freeducIndex{Drawing}{Interactive geometry}{Dr. Geo}{}

Note: It is a good idea to set one or two indexes at the beginning of each granule, just after the \freeducSection.

[edit] Label anchor

\label{myLabel}

It creates a label usable as an anchor link. See \freeducDocLink below.

Link to a label

\freeducDocLink{SomeTexte}{myLabel}

It creates a link reference over SomeText to the label myLabel

Example:

  1. in a given granule, define a label: \label{xfig}
  2. in another granule where you want to reference the previous granule, write: \freeducDocLink{The X Fig software}{xfig}.

[edit] Text style

To emphasize a text bloc (in general italic):

\emph{emphasize}

Bold style:

\textbf{bold}

Typer writer style:

\texttt{fixed size}

[edit] Lists

Unordered list:

\begin{itemize}
\item line 1
\item line 2
\end{itemize}

Ordered list:

\begin{enumerate}
\item line 1
\item line 2
\end{enumerate}
Personal tools