Skip to content

Image in-line with text doesn't vertically match HTML output #131

@dkonigsberg

Description

@dkonigsberg

I frequently put images in-line with text to indicate icons/buttons in documentation. They never look right unless correctly vertically aligned.

In HTML, with the "book" theme, it looks like this:

Image (Not perfect, and this is always a headache with Sphinx, but close enough.)

With SimplePDF, the same document section looks like this:
Image

The images are defined something like this:

.. |ic_foo| image:: images/ic_foo.svg
   :align: middle
   :width: 32

And are then used in the text like this:

This is some text about clicking |ic_foo| to do stuff.

If I try replacing the "middle" alignment instruction with custom CSS, then I need "baseline" alignment to get the desired behavior in HTML and "center" alignment to get the same behavior in SimplePDF. Ideally both should behave the same. If this is not possible, then is there an easy way to make CSS do one thing for SimplePDF and another thing for HTML? (the CSS currently gets included with the html_css_files directive in the Sphinx configuration file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions