summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/optex/base/math-preload.opm
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/optex/base/math-preload.opm')
-rw-r--r--Master/texmf-dist/tex/optex/base/math-preload.opm63
1 files changed, 36 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/optex/base/math-preload.opm b/Master/texmf-dist/tex/optex/base/math-preload.opm
index 9f73ef24d12..a3ac3e44b3b 100644
--- a/Master/texmf-dist/tex/optex/base/math-preload.opm
+++ b/Master/texmf-dist/tex/optex/base/math-preload.opm
@@ -1,6 +1,6 @@
%% This is part of the OpTeX project, see http://petr.olsak.net/optex
-\_codedecl \normalmath {Math fonts CM + AMS preloaded <2022-07-22>} % preloaded in format
+\_codedecl \normalmath {Math fonts CM + AMS preloaded <2022-12-01>} % preloaded in format
\_doc ------------------------------
We have two math macros \`\normalmath` for the normal shape of all math
@@ -126,47 +126,49 @@
like `\_loadmathfamily` does it. But the second parameter is a
`\<font-switch>` declared previously by the `\font` primitive.
\nl
+ The `<number>` is saved by \^`\_loadmathfamily`, \^`\_setmathfamily`
+ to the \`\_mfam`.
+ \nl
The font family is loaded at \`\_sizemtext`, \`\_sizemscript` and
\`\_sizemsscript` sizes. These sizes are set by the
\`\setmathsizes` `[<text-size>/<script-size>/<scriptscript-size>]` macro.
These parameters are given in the \`\ptmunit` unit, it is set to
1\`\ptunit` and it is set to 1\,pt by default.
\nl
- \`\_corrmsize` `<factor><space>` can be used just before
- `\_loadmathfamily` or `\_setmathfamily`.
- The `<factor>` is decimal number, it denotes
- scale-factor \"size of loaded math font in `\textstyle` : size of text font".
- You can use it in `\_normalmath` or `\_boldmath` macros if you want to do a
- corrections (for example due to different ex-height in text and math
- font). The `\_corrmsize` is applied only to one following
- `\_loadmathfamily` or `\_setmathfamily`. If it is missing
- then the `<factor>` is 1 for such math family (i.e.\ no size corrections).
+ \`\_mfactor` sets scaling factor for given math fonts family
+ related to text font size. It does the setting `\_ptmunit=<factor>\_ptunit` where
+ the <factor> is defined by `\sdef{_mfactor:<family>}{<factor>}`.
+ For eample, you can set `\sdef{_mfactor:1}{0.95}` if you found that
+ this scaling of math family 1 gives better visual compatibility
+ with used text fonts. If not declared then scaling factor is~1.
\_cod -----------------------------
-\_def\_corrmsize#1 {\_ptmunit=#1\_ptunit} % for corrections of sizes in diferent fonts
-
-\_def\_loadmathfamily #1 #2 {%
+\_def\_loadmathfamily {\_afterassignment\_loadmathfamilyA \_chardef\_mfam}
+\_def\_loadmathfamilyA #1 {\_mfactor
\_edef\_optsizesave{\_the\_optsize}%
- \_optsize=\_sizemtext \_font\_mF=\_optfn{#2} at\_optsize \_textfont#1=\_mF
- \_optsize=\_sizemscript \_font\_mF=\_optfn{#2} at\_optsize \_scriptfont#1=\_mF
- \_optsize=\_sizemsscript \_font\_mF=\_optfn{#2} at\_optsize \_scriptscriptfont#1=\_mF
- \_optsize=\_optsizesave \_ptmunit=\_ptunit
+ \_optsize=\_sizemtext \_font\_mF \_optfn{#1} at\_optsize \_textfont\_mfam=\_mF
+ \_optsize=\_sizemscript \_font\_mF \_optfn{#1} at\_optsize \_scriptfont\_mfam=\_mF
+ \_optsize=\_sizemsscript \_font\_mF \_optfn{#1} at\_optsize \_scriptscriptfont\_mfam=\_mF
+ \_optsize=\_optsizesave
}
-\_def\_setmathfamily #1 #2{\_let\_mF=#2%
+\_def\_setmathfamily {\_afterassignment\_setmathfamilyA \_chardef\_mfam}
+\_def\_setmathfamilyA #1{\_mfactor \_let\_mF=#1%
\_edef\_optsizesave{\_the\_optsize}%
- \_optsize=\_sizemtext \_fontlet#2=#2 at\_optsize \_textfont#1=#2%
- \_optsize=\_sizemscript \_fontlet#2=#2 at\_optsize \_scriptfont#1=#2%
- \_optsize=\_sizemsscript \_fontlet#2=#2 at\_optsize \_scriptscriptfont#1=#2%
- \_optsize=\_optsizesave \_ptmunit=\_ptunit \_let#2=\_mF
+ \_optsize=\_sizemtext \_fontlet#1#1at\_optsize \_textfont\_mfam=#1%
+ \_optsize=\_sizemscript \_fontlet#1#1at\_optsize \_scriptfont\_mfam=#1%
+ \_optsize=\_sizemsscript \_fontlet#1#1at\_optsize \_scriptscriptfont\_mfam=#1%
+ \_optsize=\_optsizesave \_let#1=\_mF
}
\_def\_setmathsizes[#1/#2/#3]{\_ptmunit=\_ptunit
\_def\_sizemtext{#1\_ptmunit}\_def\_sizemscript{#2\_ptmunit}%
\_def\_sizemsscript{#3\_ptmunit}%
}
+\_def\_mfactor{\_ptmunit=\_trycs{_mfactor:\_the\_mfam}{}\_ptunit}
+
\_newdimen\_ptunit \_ptunit=1pt
\_newdimen\_ptmunit \_ptmunit=1\_ptunit
-\_public \setmathsizes \ptunit \ptmunit ;
+\_public \setmathsizes \ptunit ;
\_doc -----------------------------
\`\_setmathparam``<luatex-param> {<factor>}` sets
@@ -176,10 +178,14 @@
\_cod -----------------------------
\_def\_setmathparam#1#2{%
- #1\_displaystyle =#2\_fontdimen6\_textfont1
- #1\_textstyle =#2\_fontdimen6\_textfont1
- #1\_scriptstyle =#2\_fontdimen6\_scriptfont1
- #1\_scriptscriptstyle =#2\_fontdimen6\_scriptscriptfont1
+ #1\_displaystyle =#2\_fontdimen6\_textfont1
+ #1\_crampeddisplaystyle =#2\_fontdimen6\_textfont1
+ #1\_textstyle =#2\_fontdimen6\_textfont1
+ #1\_crampedtextstyle =#2\_fontdimen6\_textfont1
+ #1\_scriptstyle =#2\_fontdimen6\_scriptfont1
+ #1\_crampedscriptstyle =#2\_fontdimen6\_scriptfont1
+ #1\_scriptscriptstyle =#2\_fontdimen6\_scriptscriptfont1
+ #1\_crampedscriptscriptstyle =#2\_fontdimen6\_scriptscriptfont1
}
\_doc -----------------------------
@@ -243,6 +249,9 @@ For example
\_endinput
+2022-12-01 reading number by \_loadmathfamily, \_setmathfamily more robust
+2022-11-16: \_corrmsize removed, \_mfactor introduced
+2022-09-04: \crampedstyles setings added.
2022-07-22: \_setmathparam\_Umathspaceafterscript added.
2022-02-22: \rm, \it, etc moved to fonts-select, \_marm, \_mait etc. introduced
2020-05-06: \itfam, \ttfam removed, (Unicode math preferred)