[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: doc fixes (sed script)



Frank Küster <frank@kuesterei.ch> wrote:

> Yes, see http://pkg-tetex.alioth.debian.org/, the design of which was
> taken from the teTeX documentation.

Okay.

> I wouldn't mind a Build-Dep on Python.  I have never written Python, but
> from the scripts I wrote i got the impression that its well readable
> even if you don't know it, so extending regex'es in the future shouldn't
> be a problem.

Yes, its readability is one of its strong points. Some say Python is
"compilable pseudo-code", and I can attest it's often true.

I'll think about it, but it's not for this evening, because it's a bit
non-trivial. What I wanted to do is process the file line by line (maybe
after extracting the preamble) and look for \file commands in each line,
ignore them along with their arguments and do the regexp replacement in
the rest of the line. This should work because it seems
debiandoc2latex's output always has \file with its arg on the same line
(the arg is never split, it seems).

But the non-triviality comes from these calls we have in TeX-on-Debian:

  \file{ /usr /share /texmf-\{tetex,texlive\}}

  \file{\textit{HOME} /.texmf-config}

The first one means escape sequences, or at least \{, have to be
handled, and the second one, that looking for a matching non-escaped
right brace is not enough to detect the end of \file's argument.

So, to do this, we need something that can parse LaTeX commands and
their arguments.

The last example also shows that, unfortunately, <var> doesn't translate
to \envvar or something like that. Which means, should an environment
variable be called TeX-foobar, it would be translated into \TeX-foobar.
But this is very unlikely to happen (because env vars are usually all
caps) and even if it would, I think it would then be appropriate to ask
the DebianDoc maintainers to translate <var> into a new \variable
command or something like that, which we could ignore for the
replacements, just as \file.

-- 
Florent



Reply to: