Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code that has been highlighted is not displayed #10

Closed
1kastner opened this issue Aug 30, 2022 · 6 comments
Closed

Code that has been highlighted is not displayed #10

1kastner opened this issue Aug 30, 2022 · 6 comments

Comments

@1kastner
Copy link
Contributor

I used nbsphinx to create some highlighted code. The first block with the import statements looks fine, afterwards the code is not visible anymore, see here:

grafik

By the way, I am using Adobe to read the PDF.

@1kastner
Copy link
Contributor Author

1kastner commented Aug 30, 2022

Maybe some of the warnings are a reason for that?

WARNING: Font-face 'D3 Euronism' cannot be loaded
WARNING: Font-face 'D3 Euronism Bold italic' cannot be loaded
WARNING: Font-face 'D3 Euronism Bold' cannot be loaded       
WARNING: Font-face 'D3 Euronism italic' cannot be loaded     
WARNING: Font-face 'Helvetica Neue Bold' cannot be loaded    
WARNING: Font-face 'Helvetica Neue Light' cannot be loaded   
WARNING: Font-face 'Helvetica Neue Medium' cannot be loaded  
WARNING: Font-face 'Helvetica Neue Regular' cannot be loaded 
WARNING: Font-face 'Fira Sans' cannot be loaded
WARNING: Font-face 'Fira Sans' cannot be loaded
WARNING: Font-face 'Fira Sans' cannot be loaded
WARNING: Font-face 'Fira Sans' cannot be loaded
WARNING: Font-face 'Fira Sans' cannot be loaded
WARNING: Font-face 'fontawesome-webfont' cannot be loaded
WARNING: Ignored `text-shadow: none` at 635:3, unknown property.
WARNING: Ignored `flex-basis: unset` at 734:7, invalid value.
WARNING: Ignored `min-width: unset` at 767:3, invalid value.
WARNING: Ignored `max-width: unset` at 768:3, invalid value.
WARNING: Ignored `white-space: -o-pre-wrap` at 791:3, invalid value.
ERROR: Failed to load stylesheet at file:///C:/.../docs/_build/simplepdf/_static/styles/main.css: URLError: <urlopen error [WinError 2] Das System kann die angegebene Datei nicht finden: 'C:\\...\\docs\\_build\\simplepdf\\_static\\styles\\main.css'>
WARNING: Anchor defined twice: 'id1'
WARNING: Anchor defined twice: 'id2'
WARNING: Anchor defined twice: 'id3'
WARNING: Anchor defined twice: 'id4'
WARNING: Anchor defined twice: 'id5'
WARNING: Anchor defined twice: 'id6'
WARNING: Anchor defined twice: 'id1'
WARNING: Anchor defined twice: 'id10'
WARNING: Anchor defined twice: 'id7'
WARNING: Anchor defined twice: 'id3'
WARNING: Anchor defined twice: 'id9'
WARNING: Anchor defined twice: 'id8'
WARNING: Anchor defined twice: 'id6'
WARNING: Anchor defined twice: 'id5'
WARNING: Anchor defined twice: 'id4'
WARNING: Anchor defined twice: 'id2'
ERROR: No anchor # for internal URI reference
ERROR: No anchor #id11 for internal URI reference
ERROR: No anchor #id11 for internal URI reference
ERROR: No anchor #id12 for internal URI reference
ERROR: No anchor #id13 for internal URI reference
ERROR: No anchor #id13 for internal URI reference
ERROR: No anchor #id14 for internal URI reference
ERROR: No anchor #id15 for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
ERROR: No anchor # for internal URI reference
build succeeded.

The HTML page is in _build\simplepdf.

Do I need to manually install those fonts? And why does it try to open C:\\...\\docs\\_build\\simplepdf\\_static\\styles\\main.css? No such file exists. Mine is called custom.css as indicated in my conf.py. Is that bad in your case? And I have no idea where all these anchors come from. That is nothing I have created manually. However, I use some extensions that might have caused that.

@Sachin-Suresh
Copy link

I don't use any extensions. I tried with the new Sphinx installation and I still get these font warnings. Let me know if you find a workaround @1kastner

@1kastner
Copy link
Contributor Author

1kastner commented Sep 8, 2022

@Sachin-Suresh I have not found any workaround.

@danwos
Copy link
Member

danwos commented Sep 13, 2022

The fonts warnings are just warnings, and I'm not sure if we can fix them easily, as you normally set multiple fonts in CSS, in the case some of them are not installed or available on the used operating system.
This would also be more the problem of the used weasyprint lib. (Or we can configure it to suppress such messages).

For the nbsphinx-problem, do you have some example code for me?
Would help me to reproduce the problem the right way.
I would also add it to our DEMO-PDF, so that we can have an eye on it for future releases.

@1kastner
Copy link
Contributor Author

Thanks for the explanation. Well, a small show-off of nbsphinx you can find at https://github.com/spatialaudio/nbsphinx/blob/master/doc/code-cells.ipynb. If that whole notebook takes too much space, the Jupyter Notebook could also be reduced to the following cells:

grafik

The short explanation of how to set it up can be found at https://nbsphinx.readthedocs.io/en/0.8.9/ and the prerequisites at https://nbsphinx.readthedocs.io/en/0.8.9/installation.html#nbsphinx-Prerequisites.

@1kastner
Copy link
Contributor Author

See #25

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants