From: Tom R. <Tom...@po...> - 2016-02-28 23:00:47
|
[footnotes follow .sig] Can one style a non-link replacement (e.g., emphasize text with a subscript) without a `raw` directive? What I mean: I see FAQ section 2.16[1]: > Inline markup can be combined with hyperlinks using substitution definitions and references with the "replace" directive. For example: However I want to combine inline markup and a substitution providing a subscript, for something like the following reST: fail1> Cities produce more than 70% of global fossil-fuel |CO2| emissions (*|FFCO2|*). We have cutting-edge science relating how cities and regions settle and use their land (LULC) to their |FFCO2| emissions. fail1> .. |CO2| replace:: CO\ :sub:`2` fail1> .. |FFCO2| replace:: FFCO\ :sub:`2` to show (when rendered, e.g., by `restview`) "FFCO2" * the first time in italic, the second time not * both times with '2' subscripted * neither times with the '|' showing The above fragment fails, as - only the second "FFCO2" is subscripted - the first "FFCO2" both shows the pipes and does not subscript I also tried fail2> Cities produce more than 70% of global fossil-fuel |CO2| emissions (|iFFCO2|). We have cutting-edge science relating how cities and regions settle and use their land (LULC) to their FFCO2 emissions. fail2> .. |CO2| replace:: CO\ :sub:`2` fail2> .. |FFCO2| replace:: FFCO\ :sub:`2` fail2> .. |iFFCO2| replace:: *|FFCO2|* which produces identical (failed results). Thanks to FAQ section 2.16[1] I learned I could do the following, which works: works> Cities produce more than 70% of global fossil-fuel |CO2| emissions (|iFFCO2|). We have cutting-edge science relating how cities and regions settle and use their land (*LULC*) to their |FFCO2| emissions. works> .. |CO2| replace:: CO\ :sub:`2` works> .. |FFCO2| replace:: FFCO\ :sub:`2` works> .. |iFFCO2| raw:: html works> works> <em>FFCO<sub>2</sub></em> but I'd prefer to do this (and similar simple styling of replacements) without `raw` directives. Is that currently possible? If possible please reply to me (directly) as well as the list, and TIA, Tom Roche <Tom...@po...> [1]: http://docutils.sourceforge.net/FAQ.html#is-nested-inline-markup-possible |