Skip to content

Commit

Permalink
Disable thickening MathJax strokes in print media
Browse files Browse the repository at this point in the history
  • Loading branch information
yhatt committed Mar 29, 2022
1 parent 2c334ca commit 5487feb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

## [Unreleased]

### Added

- Transform Unicode 14.0 emojis into images ([#289](https://github.com/marp-team/marp-core/pull/289))

### Fixed

- Disable thickening MathJax strokes in print media ([#287](https://github.com/marp-team/marp-core/issues/287), [#290](https://github.com/marp-team/marp-core/pull/290))

### Changed

- Upgrade Marpit to [v2.2.3](https://github.com/marp-team/marpit/releases/v2.2.3) ([#289](https://github.com/marp-team/marp-core/pull/289))
- Upgrade Node and dependent packages to the latest version ([#289](https://github.com/marp-team/marp-core/pull/289))

## v2.3.2 - 2022-01-23

### Fixed
Expand Down
14 changes: 14 additions & 0 deletions src/math/mathjax.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* Disable thickening strokes in print media (e.g. PDF).
*
* https://github.com/mathjax/MathJax-src/blob/2dd53ce6c8af3c9cceba0baf014ea9b065130774/ts/output/svg/Wrappers/TextNode.ts#L49-L53
* https://github.com/marp-team/marp-core/issues/287
*/
@media print {
mjx-container[jax='SVG'] {
use[data-c],
path[data-c] {
stroke-width: 0;
}
}
}
3 changes: 2 additions & 1 deletion src/math/mathjax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { AllPackages } from 'mathjax-full/js/input/tex/AllPackages'
import { mathjax } from 'mathjax-full/js/mathjax'
import { SVG } from 'mathjax-full/js/output/svg'
import { getMathContext, setMathContext } from './context'
import mathjaxScss from './mathjax.scss'

interface MathJaxContext {
adaptor: LiteAdaptor
Expand Down Expand Up @@ -69,4 +70,4 @@ export const block = (marpit: any) =>
{ scaled: true }
)

export const css = (marpit: any) => context(marpit).css
export const css = (marpit: any) => context(marpit).css + '\n' + mathjaxScss

0 comments on commit 5487feb

Please sign in to comment.