1
0
Fork 0

Doc: updated english manual to reflect changes in menu name: Format->Adjust

This commit is contained in:
Miguel de Benito 2014-01-28 09:44:23 +00:00
parent cd01f95762
commit 2131042de4
3 changed files with 125 additions and 164 deletions

View File

@ -1,19 +1,19 @@
<TeXmacs|1.0.0.17> <TeXmacs|1.0.7.21>
<style|tmdoc> <style|<tuple|tmdoc|english>>
<\body> <\body>
<expand|tmdoc-title|Mathematical typesetting> <tmdoc-title|Mathematical typesetting>
<section|Introduction> <section|Introduction>
In this chapter we describe the algorithms used by <apply|TeXmacs> in order In this chapter we describe the algorithms used by <TeXmacs> in order to
to typeset mathematical formulas. This is a difficult subject, because typeset mathematical formulas. This is a difficult subject, because
esthetics and effectiveness do not always go hand in hand. Until now, esthetics and effectiveness do not always go hand in hand. Until now, <TeX>
<apply|TeX> is widely accepted for having achieved an optimal compromise in is widely accepted for having achieved an optimal compromise in this
this respect. Nevertheless, we thought that several improvements could respect. Nevertheless, we thought that several improvements could still be
still be made, which have now been implemented in <apply|TeXmacs>. We will made, which have now been implemented in <TeXmacs>. We will shortly
shortly describe the motivations behind them. describe the motivations behind them.
In order to obtain esthetic formulas, what criteria should we use? It is In order to obtain esthetic formulas, what criteria should we use? It is
often stressed that good typesetting allows the reader to concentrate on often stressed that good typesetting allows the reader to concentrate on
@ -22,22 +22,19 @@
typesetted in a non uniform way: typesetted in a non uniform way:
<\description> <\description>
<expand|item*|Different base lines.>The eye expects text of a similar <item*|Different base lines>The eye expects text of a similar nature to
nature to be typesetted with respect to a same base line. For instance, be typesetted with respect to a same base line. For instance, in
in <with|mode|math|x+y+z>, the bottoms of the <with|mode|math|x> and <math|x+y+z>, the bottoms of the <math|x> and <math|z> should be at the
<with|mode|math|z> should be at the same height as the bottom of the same height as the bottom of the <math|u>-part in the <math|y>. This
<with|mode|math|u>-part in the <with|mode|math|y>. This should again be should again be the case in <math|2<rsup|x>+2<rsup|y>+2<rsup|z>>.
the case in <with|mode|math|2<rsup|x>+2<rsup|y>+2<rsup|z>>.
<expand|item*|Unequal spacing.>Different components of text with <item*|Unequal spacing>Different components of text with approximately
approximately the same function should be separated by equal amounts of the same function should be separated by equal amounts of space. For
space. For instance, in <with|mode|math|a<rsup|2>+f<rsup|2>>, the instance, in <math|a<rsup|2>+f<rsup|2>>, the typesetter should notice the
typesetter should notice the hangover of the <with|mode|math|f>. This hangover of the <math|f>. This should again be the case in
should again be the case in <with|mode|math|e<rsup|a>+e<rsup|f>+e<rsup|x>\ <math|e<rsup|a>+e<rsup|f>+e<rsup|x>>. Similarly, the distance between the
>. Similarly, the distance between the baselines of the baselines of the <math|a> and the <math|i> in <math|a<rsub|i>> should not
<with|mode|math|a> and the <with|mode|math|i> in be disproportially large with respect to the height of an <math|x>.
<with|mode|math|a<rsub|i>> should not be disproportially large with
respect to the height of an <with|mode|math|x>.
</description> </description>
Additional difficulties may arise when considering automatically generated Additional difficulties may arise when considering automatically generated
@ -46,58 +43,57 @@
Unfortunately, the different esthetic criteria may enter into conflict with Unfortunately, the different esthetic criteria may enter into conflict with
each other. For instance, consider the formula each other. For instance, consider the formula
<with|mode|math|x<rsub|p>+x<rsub|p><rsup|2>>. On the one hand, the <math|x<rsub|p>+x<rsub|p><rsup|2>>. On the one hand, the baselines of the
baselines of the scripts should be the same, but the other hand, the first scripts should be the same, but the other hand, the first subscript should
subscript should not be ``disproportionally low'' with respect to the not be ``disproportionally low'' with respect to the <math|x>.
<with|mode|math|x>. Unfortunately, this dilemma can not been solved in a Unfortunately, this dilemma can not been solved in a completely
completely satisfactory way without the help of a human for the simple satisfactory way without the help of a human for the simple reason that the
reason that the computer has no way to know whether the computer has no way to know whether the <math|x<rsub|p>> and
<with|mode|math|x<rsub|p>> and <with|mode|math|x<rsub|p><rsup|i>> are <math|x<rsub|p><rsup|i>> are ``related''. Indeed, if the <math|x<rsub|p>>
``related''. Indeed, if the <with|mode|math|x<rsub|p>> and and <math|x<rsub|p><rsup|i>> are close (like in
<with|mode|math|x<rsub|p><rsup|i>> are close (like in <math|x<rsub|p>+x<rsub|p><rsup|i>>), then it is natural to opt for a common
<with|mode|math|x<rsub|p>+x<rsub|p><rsup|i>>), then it is natural to opt base line. However, if they are further away from each other (like in
for a common base line. However, if they are further away from each other <math|x<rsub|p>+<big|sum><rsub|i=0><rsup|\<infty\>>c<rsub|i>x<rsub|p><rsup|i>>),
(like in <with|mode|math|x<rsub|p>+<big|sum><rsub|i=0><rsup|\<infty\>>c<rsu\ then we might want to opt for different base lines and locally optimize the
b|i>x<rsub|p><rsup|i>>), then we might want to opt for different base lines rendering of the first <math|x<rsub|p>>.
and locally optimize the rendering of the first <with|mode|math|x<rsub|p>>.
Consequently, <apply|TeXmacs> should offer a reasonable compromise for the Consequently, <TeXmacs> should offer a reasonable compromise for the most
most frequent cases, while offering methods for the user to make finer frequent cases, while offering methods for the user to make finer
adjustments in the remaining ones. Currently, we just provided the adjustments in the remaining ones. We provide the constructs
<apply|menu|Format|Transform|Move> and <apply|menu|Format|Transform|Resize> <menu|Format|Adjust|Move> and <menu|Format|Adjust|Resize> to move and
constructs to move and resize boxes in order to perform such adjustments. resize boxes in order to perform such adjustments. For instance, if the
For instance, if the brackets around the two sums brackets around the two sums
<\expand|equation*> <\equation*>
\<phi\><left|(><big|sum><rsub|i>a<rsub|i>x<rsup|i><right|)>=\<psi\><left|\ \<phi\><around*|(|<big|sum><rsub|i>a<rsub|i>x<rsup|i>|)>=\<psi\><around*|(|<big|sum><rsub|<smash|j>>b<rsub|j>y<rsup|j>|)>
(><big|sum><rsub|j>b<rsub|j>y<rsup|j><right|)> </equation*>
</expand>
have different sizes, then one may resize the bottom of the subscript have different sizes, then one may resize the bottom of the subscript
<with|mode|math|j> of the second sum to <verbatim|0fn>. Alternatively, one <math|j> of the second sum to <verbatim|0fn>. Alternatively, one may resize
may resize the bottoms of both the <with|mode|math|i> and the bottoms of both the <math|i> and <math|j> subscripts to (say)
<with|mode|math|j> subscripts to (say) <verbatim|-0.3fn>. <verbatim|-0.3fn>. For easier adjustments you may use
<menu|Format|Adjust|Smash> and <menu|Format|Adjust|Swell> to automatically
adjust the size of the contents to the height of the character ``x'' and
the largest one in the font respectively.
Notice that one should adjust by preference in a structural and not visual Notice that one should adjust by preference in a structural and not visual
way. For instance, one should prefer <verbatim|-0.3fn> to <verbatim|-2mm> way. For instance, one should prefer <verbatim|-0.3fn> to <verbatim|-2mm>
in the above example, because the second option disallows you to switch to in the above example, because the second option disallows you to switch to
another font size for your document. Similarly, you should try not change another font size for your document. Similarly, you should try not change
the semantics of the formula. For instance, in the above example, you might the semantics of the formula. For instance, in the above example, you might
have added a ``dummy subscript'' to the <with|mode|math|i> subscript of the have added a ``dummy subscript'' to the <math|i> subscript of the sum.
sum. However, this would alter the meaning of the formula (whence make it However, this would alter the meaning of the formula (whence make it non
non suitable as input to a computer algebra system) In the future, we plan suitable as input to a computer algebra system) In the future, we plan to
to provide additional constructs in order to facilitate structural provide additional constructs in order to facilitate structural adjusting.
adjusting. For instance, in the case of a formula like For instance, in the case of a formula like
<\expand|equation*> <\equation*>
1+x<rsub|1>+x<rsub|1><rsup|2>+\<cdots\>+x<rsub|2>+x<rsub|1>x<rsub|2>+x<rs\ 1+x<rsub|1>+x<rsub|1><rsup|2>+\<cdots\>+x<rsub|2>+x<rsub|1>x<rsub|2>+x<rsub|1><rsup|2>x<rsub|2>+\<cdots\>x<rsub|2><rsup|2>+x<rsub|1>x<rsub|2><rsup|2>+x<rsub|1><rsup|2>x<rsub|2><rsup|2>+\<cdots\>,
ub|1><rsup|2>x<rsub|2>+\<cdots\>x<rsub|2><rsup|2>+x<rsub|1>x<rsub|2><rsup\ </equation*>
|2>+x<rsub|1><rsup|2>x<rsub|2><rsup|2>+\<cdots\>,
</expand>
one might think of a construct to enclose the entire formula into an area, one might think of a construct to enclose the entire formula into an area,
where all scripts are forced to be double (using dummy superscripts where all scripts are forced to be double (using dummy superscripts
whereever necessary). wherever necessary).
<section|The font parameters> <section|The font parameters>
@ -105,49 +101,46 @@
different components. The following are often needed: different components. The following are often needed:
<\description> <\description>
<expand|item*|<verbatim|quad>.>The main font reference space <item*|<verbatim|quad>>The main font reference space <verbatim|1fn>,
<verbatim|1fn>, which can be taken as the distance between successive which can be taken as the distance between successive lines of text.
lines of text.
<expand|item*|<verbatim|y1> and <verbatim|y2>.>The bottom and top level <item*|<verbatim|y1> and <verbatim|y2>>The bottom and top level for the
for the font (we have <verbatim|y2-y1=quad>). font (we have <verbatim|y2-y1=quad>).
<expand|item*|<verbatim|sep>.>The reference minimal space between <item*|<verbatim|sep>>The reference minimal space between distinct
distinct components, like the minimal distance between a subscript and a components, like the minimal distance between a subscript and a
superscript. In fact, <verbatim|sep=quad/10>. superscript. In fact, <verbatim|sep=quad/10>.
<expand|item*|<verbatim|wline>.>The width of several types of lines, like <item*|<verbatim|wline>>The width of several types of lines, like the
the fraction and square root bars, wide accents, etc. fraction and square root bars, wide accents, etc.
<expand|item*|<verbatim|yfrac>.>The height of the fraction bar, which is <item*|<verbatim|yfrac>>The height of the fraction bar, which is needed
needed for the positioning of fractions and big delimiters. Usually, for the positioning of fractions and big delimiters. Usually,
<verbatim|yfrac> is almost equal to <verbatim|yx/2> below. <verbatim|yfrac> is almost equal to <verbatim|yx/2> below.
</description> </description>
The following parameters are mainly needed in order to deal with scripts: The following parameters are mainly needed in order to deal with scripts:
<\description> <\description>
<expand|item*|<verbatim|yx>.>The height of the <with|mode|math|x> <item*|<verbatim|yx>>The height of the <math|x> character, which is
character, which is needed for the positioning of scripts. All the needed for the positioning of scripts. All the remaining parameters are
remaining parameters are actually computed as a function of actually computed as a function of <verbatim|yx>.
<verbatim|yx>.
<expand|item*|<verbatim|ysub lo base>.>Logical base line for subscripts. <item*|<verbatim|ysub lo base>>Logical base line for subscripts.
<expand|item*|<verbatim|ysub hi lim>.>Subscripts may never physically <item*|<verbatim|ysub hi lim>>Subscripts may never physically exceed this
exceed this top height. top height.
<expand|item*|<verbatim|ysup lo base>.>Logical base line for <item*|<verbatim|ysup lo base>>Logical base line for superscripts.
<item*|<verbatim|ysup lo lim>>Superscripts may never physically exceed
this bottom height.
<item*|<verbatim|ysup hi lim>>Suggestion for a physical top line for
superscripts. superscripts.
<expand|item*|<verbatim|ysup lo lim>.>Superscripts may never physically <item*|<verbatim|yshift>>Possible shift of the base lines when we are
exceed this bottom height. inside fractions or scripts.
<expand|item*|<verbatim|ysup hi lim>.>Suggestion for a physical top line
for superscripts.
<expand|item*|<verbatim|yshift>.>Possible shift of the base lines when we
are inside fractions or scripts.
</description> </description>
The individual strings in a font also have several important positioning The individual strings in a font also have several important positioning
@ -196,7 +189,7 @@
<item>The root itself is typesetted like a large delimiter. The <item>The root itself is typesetted like a large delimiter. The
positioning of a potential script works only is very dependent on the positioning of a potential script works only is very dependent on the
usage of <apply|TeX> fonts. usage of <TeX> fonts.
<item>The upper bar has a overhang of <verbatim|sep/2> at the right and <item>The upper bar has a overhang of <verbatim|sep/2> at the right and
the logical right limit of the root is situated another <verbatim|sep/2> the logical right limit of the root is situated another <verbatim|sep/2>
@ -224,12 +217,12 @@
The following heuristics are used: The following heuristics are used:
<\itemize> <\itemize>
<item>We use <apply|TeX> fonts for small accents and an <with|font <item>We use <TeX> fonts for small accents and an
shape|italic|ad hoc> algorithm for the wider ones. <with|font-shape|italic|ad hoc> algorithm for the wider ones.
<item>The distance between the main argument and the accent is at least <item>The distance between the main argument and the accent is at least
<verbatim|sep> (or a distance which depends on the <apply|TeX> font for <verbatim|sep> (or a distance which depends on the <TeX> font for small
small accents). accents).
<item>The accent is positioned horizintally according to the right slope <item>The accent is positioned horizintally according to the right slope
of the main argument. of the main argument.
@ -253,7 +246,7 @@
<\enumerate> <\enumerate>
<item>Always pretend that the subscript has height at least <item>Always pretend that the subscript has height at least
<verbatim|y2-yshift> in the script font (actually we should use the <verbatim|y2-yshift> in the script font (actually we should use the
height of an <with|mode|math|M> instead). height of an <math|M> instead).
<item>Try to position the script at the base line given by the main <item>Try to position the script at the base line given by the main
argument. argument.
@ -271,7 +264,7 @@
<item>Move the superscript up to the logical base line if necessary. This <item>Move the superscript up to the logical base line if necessary. This
will usually occur: most of the time, the logical base line is the just will usually occur: most of the time, the logical base line is the just
the height of an <with|mode|math|x>-script below the suggested top line. the height of an <math|x>-script below the suggested top line.
<item>If the superscript physically descends below the physical under <item>If the superscript physically descends below the physical under
limit given by the main box, then we move the superscript further limit given by the main box, then we move the superscript further
@ -303,92 +296,60 @@
again complicated because of potential conflicts between locally and again complicated because of potential conflicts between locally and
globally optimal esthetics. globally optimal esthetics.
First of all, <apply|TeX> fonts come only with a discrete set of possible First of all, <TeX> fonts come only with a discrete set of possible sizes
sizes for large delimiters. This is an advantage from the point of view for large delimiters. This is an advantage from the point of view that it
that it favorites delimiters around slightly different expressions to have favorites delimiters around slightly different expressions to have the same
the same baselines. However, it has the disadvantage that delimiters are baselines. However, it has the disadvantage that delimiters are easily made
easily made ``one size to large''. For this reason, we actually diminish ``one size to large''. For this reason, we actually diminish the height and
the height and the depth of the delimited expression by the small amount the depth of the delimited expression by the small amount <verbatim|sep>,
<verbatim|sep>, before computing the sizes of the delimiters. before computing the sizes of the delimiters.
Secondly, it is best when the vertical middles of big delimiters occur at Secondly, it is best when the vertical middles of big delimiters occur at
the height of fraction bars. However, in a formula like the height of fraction bars. However, in a formula like
<\expand|equation*> <\equation*>
f<left|(><frac|1|1+<frac|1|1+<frac|1|1+<frac|1|x>>>><right|)>, f<around*|(|<frac|1|1+<frac|1|1+<frac|1|1+<frac|1|x>>>>|)>,
</expand> </equation*>
it may be worth it to descend the delimiters a bit. On the other hand, it may be worth it to descend the delimiters a bit. On the other hand,
slight vertical shifts in the middles of the delimiters potentially have a slight vertical shifts in the middles of the delimiters potentially have a
bad effect on base lines, like in bad effect on base lines, like in
<\expand|equation*> <\equation*>
f<left|(><big|sum><rsub|i=1><rsup|b>X<rsub|i><right|)>+g<left|(><big|sum>\ f<around*|(|<big|sum><rsub|i=1><rsup|b>X<rsub|i>|)>+g<around*|(|<big|sum><rsub|j=1><rsup|a>Y<rsub|j>|)>.
<rsub|j=1><rsup|a>Y<rsub|j><right|)>. </equation*>
</expand>
In <apply|TeXmacs>, we use the following compromise: we start with the In <TeXmacs>, we use the following compromise: we start with the middle of
middle of the delimited expression as a first approximation to the middle the delimited expression as a first approximation to the middle of the
of the delimiters. The real middle is obtained by shifting this middle delimiters. The real middle is obtained by shifting this middle towards the
towards the height of fraction bars by an amount which cannot exceed height of fraction bars by an amount which cannot exceed <verbatim|sep>.
<verbatim|sep>.
From a horizontal point of view, we finally have to notice that we adapted From a horizontal point of view, we finally have to notice that we adapted
the metrics of the big delimiters in a way that potential scripts are the metrics of the big delimiters in a way that potential scripts are
positioned in a better way. For instance, according to the <apply|TeX> positioned in a better way. For instance, according to the <TeX>
<verbatim|tfm> file, in a formula like <verbatim|tfm> file, in a formula like
<\expand|equation*> <\equation*>
<left|(>A+<left|(><big|sum><rsub|i=1><rsup|10>B<rsub|i><right|)><rsup|2><\ <around*|(|A+<around*|(|<big|sum><rsub|i=1><rsup|10>B<rsub|i>|)><rsup|2>|)>,
right|)>, </equation*>
</expand>
the square rather seems to be a left superscript of the second closing the square rather seems to be a left superscript of the second closing
bracket than a right superscript of the first one. This is particularly bracket than a right superscript of the first one. This is particularly
annoying in the case of automatically generated formulas, where this annoying in the case of automatically generated formulas, where this
situation occurs quite often. situation occurs quite often.
<apply|tmdoc-copyright|1998--2002|Joris van der Hoeven> <tmdoc-copyright|1998--2002|Joris van der Hoeven>
<expand|tmdoc-license|Permission is granted to copy, distribute and/or <tmdoc-license|Permission is granted to copy, distribute and/or modify this
modify this document under the terms of the GNU Free Documentation License, document under the terms of the GNU Free Documentation License, Version 1.1
Version 1.1 or any later version published by the Free Software Foundation; or any later version published by the Free Software Foundation; with no
with no Invariant Sections, with no Front-Cover Texts, and with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover
Back-Cover Texts. A copy of the license is included in the section entitled Texts. A copy of the license is included in the section entitled "GNU Free
"GNU Free Documentation License".> Documentation License".>
</body> </body>
<\initial> <\initial>
<\collection> <\collection>
<associate|paragraph width|150mm> <associate|preamble|false>
<associate|odd page margin|30mm>
<associate|shrinking factor|4>
<associate|page right margin|30mm>
<associate|page top margin|30mm>
<associate|reduction page right margin|25mm>
<associate|page type|a4>
<associate|reduction page bottom margin|15mm>
<associate|even page margin|30mm>
<associate|reduction page left margin|25mm>
<associate|page bottom margin|30mm>
<associate|reduction page top margin|15mm>
<associate|language|english>
</collection> </collection>
</initial> </initial>
<\references>
<\collection>
<associate|toc-10|<tuple|3.|?>>
<associate|idx-1|<tuple|<uninit>|?>>
<associate|toc-1|<tuple|<uninit>|?>>
<associate|toc-2|<tuple|<uninit>|?>>
<associate|idx-2|<tuple|<uninit>|?>>
<associate|toc-3|<tuple|<uninit>|?>>
<associate|toc-4|<tuple|<uninit>|?>>
<associate|toc-5|<tuple|<uninit>|?>>
<associate|toc-6|<tuple|<uninit>|?>>
<associate|toc-7|<tuple|<uninit>|?>>
<associate|toc-8|<tuple|<uninit>|?>>
<associate|toc-9|<tuple|3.|?>>
</collection>
</references>

View File

@ -55,8 +55,8 @@
tag for the shortcuts to apply. tag for the shortcuts to apply.
<item*|Box modifiers>The tags <markup|move>, <markup|shift>, <item*|Box modifiers>The tags <markup|move>, <markup|shift>,
<markup|resize> and <markup|clipped><compound|markup|> from the <markup|resize>, <markup|extend>, <markup|clipped>, <markup|smashed>,
<menu|Format|Transform> menu. <markup|swell> from the <menu|Format|Adjust> menu.
<item*|Animations>The durations of animations can be modified using <item*|Animations>The durations of animations can be modified using
<shortcut|(geometry-left)> and <shortcut|(geometry-right)>. <shortcut|(geometry-left)> and <shortcut|(geometry-right)>.
@ -78,4 +78,4 @@
<\collection> <\collection>
<associate|language|english> <associate|language|english>
</collection> </collection>
</initial> </initial>

View File

@ -54,7 +54,7 @@
Sometimes you may want large delimiters of a particular size, instead of Sometimes you may want large delimiters of a particular size, instead of
self-adjusting ones. This can be achieved by resizing the expression in self-adjusting ones. This can be achieved by resizing the expression in
between the brackets using <menu|Format|Transform|Resize object>. between the brackets using the items in <menu|Format|Adjust>.
Notice that it is possible to insert a pair of invisible brackets using Notice that it is possible to insert a pair of invisible brackets using
<shortcut|(math-bracket-open "." "." #t)>. This is for instance useful in <shortcut|(math-bracket-open "." "." #t)>. This is for instance useful in
@ -77,4 +77,4 @@
<\collection> <\collection>
<associate|language|english> <associate|language|english>
</collection> </collection>
</initial> </initial>