bolditalic is an extension for Sphinx that enables inline bold + italic text styling.


  1. Install chios, then add bolditalic to the list of extensions in

    extensions = ['chios.bolditalic']
  2. Use the bolditalic role to style text:

    The end of this sentence :bolditalic:`displays in bold and italic`.


If you define html_context in your, you must add the bolditalic.css style sheet to it.


html_context = {
  'css_files': [
    '_static/bespoke.css',  # custom CSS styling
    '_static/bolditalic.css',  # bolditalic styling

Code listing

A Sphinx extension that enables inline bold + italic.

Copyright (C) 2021 Brian Moss

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <>.

bolditalic.bolditalic(name, rawtext, text, lineno, inliner, options=None, content=None)[source]

Add bolditalic role.

Returns 2 part tuple containing list of nodes to insert into the document and a list of system messages. Both are allowed to be empty.

  • name – The role name used in the document.

  • rawtext – The entire markup snippet, with role.

  • text – The text marked with the role.

  • lineno – The line number where rawtext appears in the input.

  • inliner – The inliner instance that called this function.

  • options – Directive options for customization.

  • content – The directive content for customization.

bolditalic.css(app, env)[source]

Add bolditalic CSS.

  • app – Sphinx application context.

  • env – Sphinx environment context.

bolditalic.setup(app) dict[source]

Set up Sphinx extension.


app – Sphinx application context.