Debian Codegraph @

texmf-dist/doc/latex/mathastext/README.md

raw
1 <!-- -->
2 +-------------------------------------------+
3 + +
4 + mathastext +
5 + +
6 + 'Use the text font in math mode' +
7 + +
8 +-------------------------------------------+
9
10 This Work may be distributed and/or modified under the conditions
11 of the [LPPL 1.3c](https://www.latex-project.org/lppl/lppl-1-3c.txt)
12
13 The Author of this Work is Jean-Francois Burnol (`jfbu at free dot fr`)
14
15 Copyright (C) 2011-2019, 2022-2024 Jean-Francois Burnol
16
17 Source: mathastext.dtx 1.4e 2024/10/26
18
19
20 DESCRIPTION
21 ===========
22
23 Optimal typographical results for documents containing
24 mathematical symbols can only be hoped for with math fonts
25 specifically designed to match a given text typeface.
26 Although the list of freely available math fonts (alongside
27 the Computer Modern and AMS extension fonts) is slowly
28 expanding (fourier, kpfonts, mathdesign, pxfonts, txfonts,
29 newpx, newtx, ...) it remains limited, and the situation is
30 even worse with Unicode fonts (XeTeX/LuaTeX). So if you can't
31 find a math font which fits well with your favorite text
32 font, and wish to still be able to typeset mathematical
33 documents, perhaps not of the highest typographical quality,
34 but at least not subjected to obvious visual incompatibilities
35 between your text font and the math fonts, try out mathastext:
36 it will simply use the text font also for the math!
37
38 - http://jf.burnol.free.fr/mathastext.html
39 - http://jf.burnol.free.fr/showcase.html
40
41 USAGE
42 =====
43
44 `mathastext` is a LaTeX package
45
46 \usepackage{mathastext}
47
48 The document will use in math mode the text font as configured at
49 package loading time, for these characters:
50
51 abcdefghijklmnopqrstuvwxyz
52 ABCDEFGHIJKLMNOPQRSTUVWXYZ
53 0123456789
54 !?,.:;+-=()[]/#$%&<>|{}\
55
56 Main options: `italic`, `frenchmath`, `subdued`, `LGRgreek`.
57 - Use the `italic` option to get the Latin letters in math mode
58 be in italics. Digits and log-like operator names (pre-defined
59 as well as user-defined) will be in the same shape as the text
60 font (usually this means upright).
61 - each `\Mathastext[<name>]` in the preamble defines a math version
62 to be later activated in the document body via the command
63 `\MTversion{<name>}`.
64 - With the `subdued` option, mathastext will be active
65 only inside such math versions.
66 - For documents needing Greek letters the following is
67 possible:
68 - no option: Greek letters defined by other packages,
69 - `eulergreek`: use the Euler font for the Greek letters,
70 - `symbolgreek`: use the Postscript Symbol font for the
71 Greek letters.
72 - `LGRgreek`: use the document text font in LGR encoding.
73 Further options specify the shape of the lowercase
74 and uppercase Greek glyphs; starting with v1.15c it is
75 possible to use multiple distinct LGR fonts in the
76 same document.
77 - Commands are provided to scale the Euler and Symbol fonts by an
78 arbitrary factor to let them fit better with the document text
79 font.
80 - `\MTsetmathskips` allows to set up extra spacings around letters.
81
82 RECENT CHANGES
83 ==============
84
85 1.4e \[2024/10/26\]
86 ----
87
88 * Fix a bug dating back to `1.3y` which caused under `LGRgreek` or
89 `LGRgreeks` options an `\MTversion{normal}` to raise an `Extra
90 \else` error (not if `subdued`). The unit test which could have
91 shown this had been left aside at `1.4d` because it was so old
92 that some matters unrelated to the package prevented its
93 immediate use... alas...
94
95 * Fix one more `1.4` regression: the (not really recommended)
96 option `unimathaccents` was broken. Again a test file existed
97 but it had been left apart from those automatically built, for
98 some unknown reason...
99
100 1.4d \[2024/10/26\]
101 ----
102
103 * Fix one more `1.4` regression (the worst one by far): `$f''$`
104 caused a crash. Fortunately, the `everymath` option which
105 re-enacts legacy code could be used as a *temporary emergency
106 work-around*. Thanks to Enrico Gregorio for report.
107
108 * The `1.4b` option `noletters` did not prevent the package from
109 defining math mode symbols `\inodot` and `\jnodot`. It now does.
110
111 * Fix a longstanding legacy bug which would have caused a crash if
112 `\MTnonlettersobeymathxx` had been used with `XeLaTeX` in a
113 document with the character `-` being a Babel shorthand.
114
115 * Usage of `\Mathastext` or `\MTDeclareVersion` to declare a
116 math version associated with an exotic non-text font encoding
117 such as `OML` is theoretically possible (although of dubious
118 practical use except for stress tests) but was broken
119 since `1.3u` due to internals
120 relying on `LaTeX` commands associated with text font encodings
121 (for example to define `\inodot`
122 using `\i`,
123 or the `\hbar` with the help of the accent command `\=`)
124 and which are not available in such context. This release
125 handles such situation gracefully via warnings, rather than
126 causing low level errors.
127
128 * Improve looks in the PDF of this Change log.
129
130 1.4c \[2024/10/21\]
131 ----
132
133 * Fix a regression at `1.4`: under `XeLaTeX`, loading `mathastext`
134 caused an error if `unicode-math` and its `\setmathfont` had been
135 used prior ("*Extended mathchar used as mathchar*" in relation to the
136 minus sign character). Thanks to Michael Roland for report.
137
138 Keep in mind though that the documentation (see 1.4.15 Unicode engines) has
139 always said that the package "*is expected to be most definitely
140 incompatible with unicode-math*".
141
142 * Fix another regression at `1.4`, related to the same code and also avoided
143 with `everymath` option, but showing with
144 all engines. It caused `\MTnonlettersdonotobeymathxx`, if used, to reset
145 the minus sign to its status as prior to the loading of `mathastext`,
146 whereas it should have used the (by default) mathversion dependent one
147 (which defaults to the en-dash in the font encoding as stored by `mathastext` in
148 the extended math version).
149
150 * `\Relbar` and `\relbar` redeclarations (needed as they are used by `LaTeX`
151 for arrows, and the equal and minus signs if picked from the text font may not
152 work well in-there) are now done via `\DeclareRobustCommand` also with
153 package `amsmath` to match the current behavior of the latter. Note though
154 that they will use the equal and minus signs as in place at package loading
155 time, the documentation does say that `mathastext` should be loaded last.
156
157 1.4b \[2024/07/27\]
158 ----
159
160 * Fix a regression at `1.4` regarding option `nodigits`.
161
162 * New option: `noletters`. *I am in old age now so I can provide an option
163 completely antithetical to my life work*.
164
165 * Option `everymath` which is destined to be removed at next major
166 release warns user about it. As major releases tend to happen once
167 per decade I think the constant nagging will become insufferable
168 and you will adapt to the `1.4` changes rather than persisting into
169 using this option.
170
171 1.4a \[2024/07/20\]
172 ----
173
174 * There was a documentation glitch in 1.4 and also a problem with the
175 `\MTprimeskip` feature being lost under the emergency fall-back
176 `everymath` option.
177
178 1.4 \[2024/07/20\]
179 ---
180
181 * Since 1.2 of 2012/12/20, mathastext has used *mathematically active*
182 characters to propose certain advanced functionalities. For reasons half
183 lost in the mists of time but whose main one was surely to keep the
184 meaning of the active shape of characters unchanged outside of math mode,
185 this mathematical activation, and (in most cases) the definitions of what
186 active characters do, were done again at *each* entrance into math mode.
187 At this 1.4 release, mathastext does *not inject any code whatsoever* into
188 the `\everymath` and `\everydisplay` toks registers anymore (*except* for
189 one font-related hack needed under `LuaLaTeX`, see below). Your documents
190 will compile a tiny bit faster.
191
192 * In (*unsual*) documents where users play with catcodes and mathcodes it is
193 *impossible* to keep exact backward compatibility, because documented user
194 commands which acted formerly as toggles with delayed action now will enact
195 changes immediately if in the document body. In practice consequences are
196 expected to be few, because catcode active characters are (as was already
197 the case with earlier releases) hacked only when they are Babel shorthands
198 and they are then modified in a way altering only their action in math
199 mode. The precise description of what mathastext does when mathematically
200 activating (or not) a character, depending on circumstances, is to be
201 found among small-print comments in the section "Extended scope of the
202 math alphabets commands". See also the documentation of the
203 `\MTmathactiveletters` command for some specifics regarding ascii letters.
204
205 * New option: `everymath`. It instructs mathastext to revert (partially)
206 to its legacy code which uses `\everymath/\everydisplay`. This reversal
207 is partial, the handling of ascii letters not being included into it. The
208 `everymath` option is there *only to try as a quick fix* in case transition
209 to this release causes a major problem in a user document and time is
210 lacking to investigate. *Please report to the author such issues*. Option
211 `everymath` is destined to be removed at next major release.
212
213 * New option: `activedigits`. Enjoy.
214
215 * It is now easier to hook into the mathastext architecture for
216 mathematically activated ascii letters. See the new section "Hacking
217 letters (and even digits) for special tasks".
218
219 * Bugfix: do not override special behavior of the math mode dot in
220 babel-spanish.
221
222 * Bugfix: A *desperate* hack related to `LuaLaTeX` font matters and dating
223 back to 1.3o 2016/05/03 had been for some years in dire need of an update
224 regarding fonts using `Renderer=HarfBuzz`. This is done now. Thanks to
225 tex.sx `user691586` for report. This is currently the sole remaining
226 usage of `\everymath/\everydisplay`.
227
228 * Bugfix: `\MTexplicitbracesobeymathxx` (which is related to `\{` and `\}`)
229 was without effect since an upstream `LaTeX` change at its 2020-02-02 release.
230
231 * With option symbolmisc, those math symbol macros formerly defined via
232 `\DeclareRobustCommand` are now declared via `\protected\def`.
233
234 * Removal of legacy branches previously kept to support `LaTeX` earlier than
235 2020-02-02.
236
237 * Removal of support for EU1 and EU2 font encodings.
238
239 * Option `noasterisk` deprecated at 1.2d 2013/01/02 has (finally) been removed.
240
241 * Four test files previously included and auto-extracted from the
242 distributed dtx have been dropped. One of them is still available
243 on the package homepage.
244
245 * Some parts of the documentation have been massively re-ordered and even to some
246 extent improved. But there may be some occasions where obsolete statements will
247 be found having the legacy `\everymath/\everydisplay` situation as background.
248