Is there possible for bold and italic text

1,368 views
Skip to first unread message

lyhcode

unread,
Dec 12, 2011, 12:10:45 AM12/12/11
to sphinx-dev
rst has
*italic*
**bold**

but if I need a text bold and italic in the same time.
something like

***italic.bold***

Is there a easy way to implement this?
thanks a lot

Guenter Milde

unread,
Dec 12, 2011, 2:55:10 AM12/12/11
to sphin...@googlegroups.com

> ***italic.bold***

Currently, nested inline markup is not supported. The workaround is easy but
not nice:

define a custom role, e.g.

.. role:: bfit

and use it to mark up :bfit`bold italic text`.

You also need to define styling rules for the bfit class in the CSS
stylesheet for HTML and in the LaTeX preamble for LaTeX.

Günter


Kathy

unread,
Dec 16, 2011, 1:44:52 PM12/16/11
to sphinx-dev
Thanks for posting this. We ran into the same problem since any
reference to our product name is always bold & italic. Since our
problem was specific to a certain word, we just formatted it in LaTex
and used a substitution. We'll keep our substitution for this specific
situation since it makes it much easier for the develops to add the
product name. But, this solution will be great for other instances.

Substitution file (we may be adding to with repeated equations)

.. role:: raw-html(raw)
:format: html

.. role:: raw-latex(raw)
:format: latex

.. |f3d| replace:: :raw-html:`<strong><em>FLOW-3D</em></strong>`:raw-
latex:`{\textbf {\em FLOW-3D}}`

Sample from an rst file:

.. _00_model_reference_overview::

.. include:: ../substitutions

Overview
==============

In this chapter, |f3d| models

Kathy

Reply all
Reply to author
Forward
0 new messages