Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
luatex
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeXLive
luatex
Commits
fc0564f7
Commit
fc0564f7
authored
8 years ago
by
Luigi Scarso
Browse files
Options
Downloads
Patches
Plain Diff
clarification \mathstyle in manual (HH)
parent
0a677d81
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
manual/luatex-math.tex
+93
-0
93 additions, 0 deletions
manual/luatex-math.tex
manual/luatex.pdf
+0
-0
0 additions, 0 deletions
manual/luatex.pdf
with
93 additions
and
0 deletions
manual/luatex-math.tex
+
93
−
0
View file @
fc0564f7
...
...
@@ -38,6 +38,99 @@ be used as numeric values, so you can write code like this:
\fi
\fi
\stoptyping
Sometimes you won't get what you expect so a bit of explanation might help to
understand what happens. When math is parsed and expanded it gets turned into a
linked list. In a second pass the formula will be build. This has to do with the
fact that in order to determine the automatically chosen sizes (in for instance
fractions) following content can influence preceding sizes. A side effect of this
is for instance that one cannot change the definition of a font family (and
thereby reusing numbers) because the number that got used is stored and used in
the second pass (so changing
\type
{
\fam
12
}
mid|-|formula spoils over to
preceding use of that family).
The style switching primitives like
\type
{
\textstyle
}
are turned into nodes so
the styles set there are frozen. The
\type
{
\mathchoice
}
primitive results in
four lists being constructed of which one is used in the second pass. The fact
that some automatic styles are not yet known also means that the
\type
{
\mathstyle
}
primitive expands to the current style which can of course be
different from the one really used. It's a snapshot of the first pass state. As a
consequence in the following example you get a style number (first pass) typeset
that can actually differ from the used style (second pass). In the case of a math
choice used ungrouped, the chosen style is used after the choice too, unless you
group.
\startbuffer
[1]
[a:
\mathstyle
]
\quad
\bgroup
\mathchoice
{
\bf
\scriptstyle
(x:d :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(x:t :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(x:s :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(x:ss:
\mathstyle
)
}
\egroup
\quad
[b:\mathstyle]
\quad
\mathchoice
{
\bf
\scriptstyle
(y:d :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(y:t :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(y:s :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(y:ss:
\mathstyle
)
}
\quad
[c:\mathstyle]
\quad
\bgroup
\mathchoice
{
\bf
\scriptstyle
(z:d :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(z:t :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(z:s :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(z:ss:
\mathstyle
)
}
\egroup
\quad
[d:\mathstyle]
\stopbuffer
\startbuffer
[2]
[a:
\mathstyle
]
\quad
\begingroup
\mathchoice
{
\bf
\scriptstyle
(x:d :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(x:t :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(x:s :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(x:ss:
\mathstyle
)
}
\endgroup
\quad
[b:\mathstyle]
\quad
\mathchoice
{
\bf
\scriptstyle
(y:d :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(y:t :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(y:s :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(y:ss:
\mathstyle
)
}
\quad
[c:\mathstyle]
\quad
\begingroup
\mathchoice
{
\bf
\scriptstyle
(z:d :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(z:t :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(z:s :
\mathstyle
)
}
{
\bf
\scriptscriptstyle
(z:ss:
\mathstyle
)
}
\endgroup
\quad
[d:\mathstyle]
\stopbuffer
\typebuffer
[1]
% \typebuffer[2]
This gives:
\blank
$
\displaystyle
\getbuffer
[
1
]
$
\blank
\blank
$
\textstyle
\getbuffer
[
1
]
$
\blank
Using
\type
{
\begingroup
}
\unknown\ \type
{
\endgroup
}
instead gives:
\blank
$
\displaystyle
\getbuffer
[
2
]
$
\blank
\blank
$
\textstyle
\getbuffer
[
2
]
$
\blank
This might look wrong but it's just a side effect of
\type
{
\mathstyle
}
expanding
to the current (first pass) style and the number being injected in the list that
gets converted in the second pass. It all makes sense and it illustrates the
importance of grouping. In fact, the math choice style being effective afterwards
has advantages. It would be hard to get it otherwise.
\subsection
{
\type
{
\Ustack
}}
There are a few math commands in
\TEX\
where the style that will be used is not
...
...
This diff is collapsed.
Click to expand it.
manual/luatex.pdf
+
0
−
0
View file @
fc0564f7
No preview for this file type
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment