Re: styling a replacement

David Goodger <[email protected]>
Newsgroups gmane.text.docutils.user
Message-ID <CABiJP=+M-d4Pvo8sRfB5+6B2zLA7zQMCdo8e41wdQVVQo7rL=A@mail.gmail.com>
On Sun, Feb 28, 2016 at 5:00 PM, Tom Roche <[email protected]> wrote:
>
> [footnotes follow .sig]
>
> Can one style a non-link replacement (e.g., emphasize text with a subscript) without a `raw` directive? What I mean:

What you're asking for is nested inline markup via substitution, and
that is not currently possible, no.

Suggestion: rather than a substitution, use the Unicode subscript
characters, e.g. CO₂, FFCO₂, H₂O. Superscripts too: E=mc². These can
be styled with emphasis: *CO₂*, **FFCO₂**, etc. For easy character
entry, explore the "compose key" functionality
(https://en.wikipedia.org/wiki/Compose_key) standard in Linux distros
and easily added to MacOS & Windows systems.

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


> 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 <[email protected]>
>
> [1]: http://docutils.sourceforge.net/FAQ.html#is-nested-inline-markup-possible
>

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
Docutils-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.