You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
2.8 KiB
81 lines
2.8 KiB
\chapter{Formater du texte} |
|
|
|
Manipuler du texte, afin de le modifier, de le mettre en forme, |
|
de le présenter de façon harmonieuse, tout le monde l'a déja |
|
fait, avec des outils divers et variés et des résultats parfois |
|
(ou souvent) hasardeux. |
|
|
|
\section{fmt et ses copains} |
|
\index{fmt}\index{tr} |
|
|
|
Nous allons voir quelques outils de base, simple et efficace, |
|
mais qui ont parfois quelques limitations. Le premier est |
|
\texttt{fmt} qui permet de remettre en forme un texte. |
|
|
|
\begin{verbatim} |
|
tth@plop:~/Ecriture/Ordinateur$ cat texte.txt |
|
Ce morceau de texte n'est pas |
|
bien |
|
formaté. |
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. |
|
Phasellus nunc sapien, porta id pellentesque at, elementum et felis. |
|
Curabitur condimentum |
|
ante in metus |
|
iaculis quis congue diam commodo. |
|
tth@plop:~/Ecriture/Ordinateur$ fmt texte.txt |
|
Ce morceau de texte n'est pas bien formaté. |
|
|
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus |
|
nunc sapien, porta id pellentesque at, elementum et felis. Curabitur |
|
condimentum ante in metus iaculis quis congue diam commodo. |
|
\end{verbatim} |
|
|
|
%------------------------------------------------------------- |
|
|
|
\section{roff} |
|
\index{roff}\label{roff} |
|
|
|
\textbf{Roff} est l'outil qui a permis à quelques hackers légendaire |
|
de justifier auprès de leur hiérarchie le développement d'une machine |
|
de jeu, il est donc légitime d'en parler, non ? |
|
|
|
Après quelques minutes d'expérimentation, un premier souci arrive. |
|
Il semble bien que \texttt{groff} ne sache pas lire les fichiers |
|
encodés en \textbf{utf8}\index{utf8}. Il faut donc utiliser |
|
un hack avec \texttt{recode} en prenant bien soin d'utiliser |
|
une redirection vers \texttt{stdin} comme ceci : |
|
|
|
\begin{verbatim} |
|
< $BASENAME.txt recode utf8..latin1 | groff -Tutf8 |
|
\end{verbatim} |
|
|
|
D'un autre coté, c'est \texttt{roff} qui est utilisé pour formater |
|
les pages du manuel Unix. La documentation, c'est important. |
|
C'est pour ça que j'en cause page \pageref{chap:manpages}. |
|
|
|
|
|
%------------------------------------------------------------- |
|
\section{yodl} |
|
\index{yodl} |
|
|
|
\begin{quote} |
|
Yodl is a package that implements a pre-document language and tools |
|
to process it. The idea of Yodl is that you write up a document in a |
|
pre-language, then use the tools (e.g. yodl2html) to convert it to some |
|
final document language. Current converters are for HTML, man, LaTeX SGML |
|
and texinfo, a poor-man's text converter and an experimental xml converter. |
|
\end{quote} |
|
|
|
%------------------------------------------------------------- |
|
\section{zoem} |
|
\index{zoem} |
|
|
|
\begin{quote} |
|
Zoem is a language for transforming text. It supports the creation of |
|
light-weight mark-up languages as macro packages built on top of zoem. |
|
PUD (Portable Unix Documentation) provides two such mini-languages and |
|
is shipped with zoem. The PUD languages are for generating manpages and |
|
FAQ documents in both HTML and troff. |
|
\end{quote} |
|
|
|
|