question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Missing icon and incorrect border for admonition in PDF output

See original GitHub issue

Contribution guidelines

I’ve found a bug and checked that …

  • … the problem doesn’t occur with the mkdocs or readthedocs themes
  • … the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • … the documentation does not mention anything about my problem
  • … there are no open or closed issues that are related to my problem

Description

When using mkdocs-pdf-export-plugin, icons are no longer shown for admonitions in the PDF output since mkdocs-material rev b345a0b65 and the border does not look correct.

Expected behaviour

It should look like this (this is with c79b786ea):

c79b786ea

Actual behaviour

But it looks like this (this is with master):

master

Note the lack of icon, and how the blue border extends all around the admonition.

Steps to reproduce

Test input test/docs/index.md (test/mkdocs.yml as below under Configuration)

# Welcome to MkDocs

!!! note
    This is a note

Incorrect behavior with master

python3 -m venv bad_env
source bad_env/bin/activate
pip install wheel
pip install mkdocs mkdocs-pdf-export-plugin git+ssh://git@github.com/squidfunk/mkdocs-material.git
mkdocs build -f test/mkdocs.yml && xdg-open test/site/index.pdf

Correct behavior with rev c79b786ea

python3 -m venv good_env
source good_env/bin/activate
pip install wheel
pip install mkdocs mkdocs-pdf-export-plugin git+ssh://git@github.com/squidfunk/mkdocs-material.git@c79b786ea
mkdocs build -f test/mkdocs.yml && xdg-open test/site/index.pdf

I git bisect:ed and the first bad commit seems to be b345a0b65:

b345a0b65 Prototyped material icon SVG integration

Package versions

  • Python: 3.8.10
  • MkDocs: 1.3.0 (git rev 7418e7961)
  • Material: 4.6.3

Configuration

site_name: My Docs
theme:
  name: material
plugins:
  - pdf-export
markdown_extensions:
  - admonition

System information

  • Operating system: Ubuntu 20.04.4 LTS
  • Browser: Firefox 98.0.2 and Okular 1.9.3 for PDF viewing

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
estancommented, Mar 27, 2022

Turns out there was an open issue for mask-image support in weasyprint already: https://github.com/Kozea/WeasyPrint/issues/1458

1reaction
estancommented, Mar 27, 2022

Thanks. I think this info will be of use. Possibly the place to fix is in weasyprint which the plugin is using.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Admonition Styles (PDF) - Paligo
The admonitions for PDF publications are styled via the Layout tab. ... and after an admonition, positioning, border style, used icons, ...
Read more >
Adobe icon missing when embedding a .pdf file in Word 2013
In the file path specified, I tried copying an existing icon and renaming it to (OLE2.DLL) to see if it picked it up,...
Read more >
CSS Tip: Creating Styled Boxes for Notes, Warnings ...
The styles with the border look great in web output. However, I too had problems in print output. The right border is not...
Read more >
PDF Styling - Paligo - Zendesk
To control the look and feel of your PDF outputs, we recommend that ... an admonition, positioning, border style, used icons, font style, ......
Read more >
Convertng Markdown admonition syntax to HTML, using Lua ...
@Gustavo Reis pandoc read wrong indentation before filter processing the ... then title_html = '<p class="admonition-title no-title"/>' else ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found