[Po4a-devel]Design of the (La)TeX module

Nicolas François nicolas.francois@centraliens.net
Sat, 11 Dec 2004 18:14:13 +0100


On Sat, Dec 11, 2004 at 02:47:51PM +0100, Denis Barbier wrote:
> On Sat, Dec 11, 2004 at 12:15:29PM +0100, Nicolas François wrote:
> [...]
> > Here is what I'm doing when I encounter the following block:
> > 
> > foo
> > bar %baz
> > qux
> > %quux
> > corge
> > grault
> > 
> > I first remove the %baz comment, and store it a table. This comment w=
ill
> > disappear from the final document, but I will show it in the PO (poss=
ibly
> > at a wrong place) because it may help the translation.
> > Then, for the %quux comment, I consider that this comment separate tw=
o
> > paragraphs, which will be translated separately.
> 
> But this is wrong, in LaTeX this comment is ignored and there is only
> one paragraph in your example above.

In this case, I'm modifying the parse function;)

> [...]
> > Here is a Python paragraph:
> > A Python program is read by a \emph{parser}.  Input to the parser is =
a
> > stream of \emph{tokens}, generated by the \emph{lexical analyzer}.  T=
his
> > chapter describes how the lexical analyzer breaks a file into tokens.
> > \index{lexical analysis}
> > \index{parser}
> > \index{token}
> > 
> > The indexes here are trailing commands. They are translated separatel=
y
> > from the paragraph (in this case, they are maybe untranslated)
> 
> Okay, I see, but I wonder whether this is the right way to go.
> IMO you should first try to have a working implementation, then people
> use it in ways you did not imagine, and you then have to fix/extend it.

With the previous prototype, I found it more practical to translate
separately leading and ending commands.

Do you think it is better not to translate them separately, except for the
commands of a category?
Then I would like to add indent, noindent, index, label and footnote in
this category.

> Sometimes authors put \label at the beginning of paragraphs, maybe it
> is similar with \index.

Yes, I've seen \index both at the beginning and end of paragraphs in the
Python documentation.


-- 
Nekral