Small tweaks to documentation (#1527)

This commit is contained in:
Erik Demaine
2018-07-29 23:25:38 -04:00
committed by ylemkimon
parent a76c4b9a2f
commit c88fa70a62
10 changed files with 31 additions and 30 deletions

View File

@@ -8,7 +8,7 @@ several properties of the way fonts are used can be changed.
## Font size and lengths
By default, KaTeX math is rendered in a 1.21× larger font than the surrounding
context, which makes super- and subscripts easier to read. You can control
this using CSS, for example:
this using CSS, for example, to set to 1.1×:
```css
.katex { font-size: 1.1em; }
@@ -27,7 +27,7 @@ will appear larger than 1cm in browser units.
The default build of KaTeX includes each of the needed fonts in three different formats: `ttf`, `woff`, and `woff2`.
- `ttf`s are included to support old versions of Chrome, Safari, Firefox, etc. (By old, I mean Firefox 3.5, Chrome <5, Safari <=5.1 all of which are no longer supported: see [woff](http://caniuse.com/#search=woff) vs [ttf](http://caniuse.com/#search=ttf)).
- `ttf`s are included to support old versions of Chrome, Safari, Firefox, etc. (Here "old" means Firefox 3.5, Chrome < 5, and Safari <= 5.1, all of which are no longer supported: see [woff](http://caniuse.com/#search=woff) vs. [ttf](http://caniuse.com/#search=ttf)).
- `woff` is the format that is most widely supported (all modern browsers support it), so it probably provides the most benefit to being included.
- `woff2`s are included for very new versions of Chrome, because they are much smaller and faster to load.
@@ -37,11 +37,11 @@ For example, if you wanted to create a trimmed down version of KaTeX, you could
1. Set `@use-ttf`, and `@use-woff2` to `false` at the top of [fonts.less](https://github.com/KaTeX/katex-fonts/blob/master/fonts.less).
2. Rebuild KaTeX by running `yarn run build` from the top-level directory.
3. Include only the `build/fonts/*.woff2` files in your distribution.
3. Include only the `build/fonts/*.woff` files in your distribution.
## Location of font files
The default build of KaTeX expects the KaTeX fonts to be located in a directory called `fonts` which is a sibling of the `katex.min.css` stylesheet. This can be changed as such:
The default build of KaTeX expects the KaTeX fonts to be located in a directory called `fonts` which is a sibling of the `katex.min.css` stylesheet. This can be changed as follows:
1. At the top of the [fonts.less](https://github.com/KaTeX/katex-fonts/blob/master/fonts.less) file, set `@font-folder` to the location of your fonts. You can use relative or absolute paths, so setting it to `"/fonts"` would cause it to search for the fonts in a root `fonts` folder, while `"../fonts"` would search in a `fonts` directory one level above the `katex.min.css` file.
2. Rebuild KaTeX by running `yarn run build` from the top-level directory.