Felix Wiemann | 1 Sep 2004 23:48
Picon

Re: Generating LaTeX for Python manual

David Goodger wrote:

> You can also implement them as custom roles by adding this to your
> documents:
>
>      .. role:: method(literal)
>      .. role:: class(literal)
>      .. role:: func(literal)
>      .. role:: var(literal)
>      .. role:: module(literal)
>      .. role:: code(literal)

I just tried that, and it causes Docutils to crash (error with
NestedStateMachine).

--------------------------------
.. role:: method(literal)
.. role:: class(literal)
.. role:: func(literal)
.. role:: var(literal)
.. role:: module(literal)
.. role:: code(literal)
--------------------------------

It works when putting some text between the role definitions:

--------------------------------
.. role:: method(literal)

test
(Continue reading)

David Goodger | 2 Sep 2004 00:00
Favicon

Re: Re: Generating LaTeX for Python manual

> David Goodger wrote:
>> You can also implement them as custom roles by adding this to your
>> documents:
>>
>>     .. role:: method(literal)
>>     .. role:: class(literal)
>>     .. role:: func(literal)
>>     .. role:: var(literal)
>>     .. role:: module(literal)
>>     .. role:: code(literal)

[Felix Wiemann]
> I just tried that, and it causes Docutils to crash (error with
> NestedStateMachine).

That must be a bug.

> BTW, am I right that using such roles for LaTeX output would need
> support by the writer class?

Yes, correct.  But it's better than using text-based
mappings.  Eventually, it would be nice if the LaTeX writer and/or
DocPy/LaTeX writer had generic support for custom roles.

--

-- 
David Goodger <http://python.net/~goodger>

Gmane