Fraction bars disappear when printing webpages into PDFs.
See original GitHub issueHello, I’m using KaTeX 0.10.0-beta and a fresh installation of Google Chrome Beta 69.0.3497.23 on Ubuntu 18.04 (to make sure that all preferences are defaults). I’m considering printing webpages with math formulas into PDFs. But I came across some issues with fractions.
For example:
<!DOCTYPE html>
<html>
<head>
<link href="katex/katex.min.css" type="text/css" rel="stylesheet">
<script src="katex/katex.min.js" type="text/javascript"></script>
<script src="katex/contrib/auto-render.min.js" type="text/javascript"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
renderMathInElement(document.body, options = {delimiters: [{ left: "$$", right: "$$", display: true }, { left: "$", right: "$", display: false }]});
});
</script>
</head>
<body>
<p>inline math: ${2 \over n}$.</p>
<p>display math:
$$
f^{(n)}(x) = \begin{cases}
x + nb & (a = 1) \\
a^n\ x + {a^n - 1 \over a - 1} \cdot b & (a > 1)
\end{cases}
$$
</p>
</body>
</html>
Print it via Chrome and will get:

Press “F12” to add the following CSS code:
.katex {
font-size: 1em; /* or even smaller */
}
Reprint and get:

I have also tried https://khan.github.io/KaTeX/ and set font-size to 0.3em and came across the same issue. I wonder why printed PDFs would be different from original webpages. Is that a bug in Chrome or KaTeX?
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (3 by maintainers)
Top Results From Across the Web
When You See Thin White Lines in Your PDF Files
The lines will still show up when your pdf is rasterized which means they may cause problems in print, and they will definitely...
Read more >Disappearing or Strange Looking Elements in the PDF
If elements disappear from the PDF after uploading to E-pages it may be because of the use of layers and layers with transparency...
Read more >Hiding the toolbars surrounding an embedded pdf?
It works for me with the caveat that when I refresh (using Chrome) the toolbar appears again. I am trying to figure out...
Read more >If you can't find a button or control in Pages on Mac
Click your Pages document and make sure the menu bar shows Pages next to the Apple menu . If the toolbar is missing...
Read more >10 annoying Word features (and how to turn them off)
Solution: Direct the user's attention to the Close Full Screen View button at the bottom of the window (depending on the version) or...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@mbourne Thanks for the feedback. I’ve re-opened the PR.
I came here looking to complain about exactly that 😉
That’s a screenshot of PDF, printed from a webpage, of an in-line fraction.
Update before I leave for winter: Here’s screenshots of a PDFs created by chrome-beta (left) and by firefox (right) with only CSS specifying 9pt font.
Increasing the font-size to 12pt got rid of the visual difference. This isn’t a serious problem for me though, and looking through the issues y’all know about this.