AllenDowney / plastex-oreilly

Branch of plastex that generates DocBook 4.5 that meets O'Reilly style guidelines.
7 stars 7 forks source link

Need to remove redundant text in front of xref tags #30

Closed AllenDowney closed 12 years ago

AllenDowney commented 12 years ago

In LaTeX most references look like "Figure~\ref{blah}" or "Chapter~\ref{blah}"

In the DocBook we want to drop the redundant "Figure" or "Chapter"

In my previous books I have done this by pre-scanning the LaTeX input.

But here I think we want to add it to tree_cleaner.

Working...

AllenDowney commented 12 years ago

Well, doing this in tree_cleaner turns out to be difficult.

And doing it by intercepting the stream of input tokens turns out to be difficult.

So I think the solution for now is to put the responsibility on the author to leave off the extra text.

However, I have a short program called preprocess.py that automates this, and I've changed the Makefile to run it automatically.

See commit 101db49..fea69e8