From: Felix W. <Fel...@gm...> - 2004-09-11 22:57:31
|
David Abrahams wrote: > What about LaTeX? Is there any way to put something in the > stylesheet that will govern the formatting of a particular role? I just added --call-class-command: ------------------------------------------------------------------------ ~/tmp $ cat stylesheet.tex \renewcommand{\docutilsclass}[2]{% \ifthenelse{\equal{#1}{method}}% {<METHOD>#2</METHOD>}% {#2}% } ~/tmp $ cat roles.txt .. role:: method(literal) This is an example: :method:`foo(x, y, z)`. ~/tmp $ rst2latex.py --call-class-command --stylesheet=stylesheet.tex roles.txt roles.tex ------------------------------------------------------------------------ If you render roles.tex, you see that "foo(x, y, z)" appears as "<METHOD>foo(x, y, z)</METHOD>". Please don't rely on the existence of --call-class-command and \docutilsclass yet. It hasn't been discussed and it is untested and undocumented. It's just there for testing and can be removed or changed at any time. I'd appreciate some feedback about this option. David Goodger, do you think the dispatch_ methods in nodes.py are OK? If yes, I'll update the docstrings. Cc to Greg Ward, because it's probably of some interest for his Python-documentation writer. -- When replying to my email address, please ensure that the mail header contains 'Felix Wiemann'. http://www.ososo.de/ |