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

Font issue #3

Closed
SubtleMuffin opened this issue Dec 22, 2023 · 8 comments · Fixed by #5
Closed

Font issue #3

SubtleMuffin opened this issue Dec 22, 2023 · 8 comments · Fixed by #5
Labels
enhancement New feature or request

Comments

@SubtleMuffin
Copy link

SubtleMuffin commented Dec 22, 2023

Hi, great work! I am having trouble with the rendered HTML font. It seems that if I

  1. download the folder from here, place it under the same folder of the generated HTML file, and
  2. add <link media="all" rel="stylesheet" href="/assets/ar5iv-site.0.2.1.css"> to the generated HTML file

the fonts are just fine. How could we fix this issue? Thanks!

@dginev
Copy link
Owner

dginev commented Dec 22, 2023

Hi @SubtleMuffin - I am not sure I follow the exact issue you are resolving.

Are you running your own Rocket web service using this ar5iv repository? Or are you saving an ar5iv article locally, and trying to open it on your local machine?

As you have remarked, as long as the font assets are made available and the web page is successfully pointing to them, you should be able to reproduce the usual web rendering.

@dginev dginev added the question Further information is requested label Dec 22, 2023
@dginev
Copy link
Owner

dginev commented Dec 22, 2023

Oh, this is filed under the ar5ivist repository, now I see.

Right, while this Dockerfile allows to convert the latex sources using the same process used in ar5iv, you still need a separate web service setup (as with the Rocket web service in the ar5iv repository), which will make the fonts available, especially for math expressions.

@dginev
Copy link
Owner

dginev commented Dec 22, 2023

For example, the "STIX Two Math" fonts are pointed to by ar5iv-site.0.2.1.css via:
https://github.com/dginev/ar5iv/blob/73d60c3c45b3806c2ca6ef63c12ed653b69d1525/assets/ar5iv-site.0.2.1.css#L86

Which implies there is a web service that will provide the files on GET request to /assets/fonts/STIXTwoMath-Regular.woff2.

I wonder if there is a more convenient way to include these for specifically using the standalone Dockerfile... Maybe it's possible to create a self-contained "standalone" CSS bundle that uses remote CDN access for the web fonts...

@SubtleMuffin
Copy link
Author

Hi @dginev , thanks for the prompt reply. Yes, I was trying to use the Docker to generate the HTML file. Is it possible to import some stylesheets that contain online fonts? Such as

<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Noto+Serif" />

@dginev
Copy link
Owner

dginev commented Dec 22, 2023

Yes, I think there is a good case to create a new ar5iv-fonts.css set of directives, bundled with the ar5iv-css repository, and have that included by default for the ar5ivist Dockerfile.

Thanks, I'll write back when that lands.

@dginev dginev added enhancement New feature or request and removed question Further information is requested labels Dec 22, 2023
@SubtleMuffin
Copy link
Author

Awesome, thanks! I plan to use this toolset to generate HTML versions of my papers and host those files on GitHub.io etc.

I saw a few glitches such as superscripts (non-equation mode) and bibliography, and I will report with a new issue containing a minimal Tex example that can reproduce the issue.

Thanks!

@dginev
Copy link
Owner

dginev commented Feb 26, 2024

@SubtleMuffin let me know if the latest recipe in this repository is workable for you. I have added the fonts via @import directives and using Google's CSS CDN.

@SubtleMuffin
Copy link
Author

All good now! Thanks :) @dginev

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

Successfully merging a pull request may close this issue.

2 participants