texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: Use explicit \mathit for slates @-commands in mat


From: Patrice Dumas
Subject: branch master updated: Use explicit \mathit for slates @-commands in math
Date: Fri, 14 Oct 2022 18:14:50 -0400

This is an automated email from the git hooks/post-receive script.

pertusus pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new bfd21a355f Use explicit \mathit for slates @-commands in math
bfd21a355f is described below

commit bfd21a355f49523eaa1cd50f363ccd617a18820d
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Oct 15 00:14:40 2022 +0200

    Use explicit \mathit for slates @-commands in math
    
    * tp/Texinfo/Convert/LaTeX.pm: for slanted indicatric commands,
    such as @var in math use \mathit instead of no command, as
    the space between the letters in argument can be important for some
    letters (such as ff), corresponding to letters being multiplied
    rather than to words, which is a better interpretation for
    @-command arguments.  Report from Vincent Lefèvre.
---
 ChangeLog                                                  | 11 +++++++++++
 tp/Texinfo/Convert/LaTeX.pm                                | 14 +++++++++++---
 tp/tests/layout/res_parser/formatting_latex/formatting.tex | 10 +++++-----
 .../layout/res_parser/formatting_mathjax/formatting.html   | 10 +++++-----
 4 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8bfdff9fbb..2cd37bac18 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2022-10-14  Patrice Dumas  <pertusus@free.fr>
+
+       Use explicit \mathit for slates @-commands in math
+
+       * tp/Texinfo/Convert/LaTeX.pm: for slanted indicatric commands,
+       such as @var in math use \mathit instead of no command, as
+       the space between the letters in argument can be important for some
+       letters (such as ff), corresponding to letters being multiplied
+       rather than to words, which is a better interpretation for
+       @-command arguments.  Report from Vincent Lefèvre.
+
 2022-10-14  Patrice Dumas  <pertusus@free.fr>
 
        Add simple customization of accent commands formatting in HTML
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 31a3756cc4..5e119aebe4 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -643,7 +643,15 @@ foreach my $always_slanted_roman_commands ('cite', 'var') {
   register_style_format_command('cmd_text', $always_slanted_roman_commands,
                         '\\normalfont{}\\textsl', \%LaTeX_style_brace_commands,
                         \%style_brace_format_command_new_commands);
-  $LaTeX_style_brace_commands{'cmd_math'}->{$always_slanted_roman_commands} = 
'';
+  # it seems better to use explicitly mathit, otherwise the space between
+  # the letters in argument can be important for some letters (such as ff),
+  # corresponding to letters being multiplied rather than to words, which
+  # is a better interpretation for @-command arguments.
+  # 
https://tex.stackexchange.com/questions/448069/fix-ugly-kerning-in-equation-subscript
+  # In tests, \mathnormal didn't avoid the issue, and numbers
+  # were small, so use \mathit, which also slants the numbers.
+  $LaTeX_style_brace_commands{'cmd_math'}->{$always_slanted_roman_commands}
+       = '\\mathit';
   $roman_style_commands{$always_slanted_roman_commands} = 1;
 }
 
@@ -665,13 +673,13 @@ foreach my $asis_command (@asis_commands) {
 my @slanted_commands = ('dfn', 'slanted');
 foreach my $slanted_command (@slanted_commands) {
   $LaTeX_style_brace_commands{'cmd_text'}->{$slanted_command} = '\\textsl';
-  $LaTeX_style_brace_commands{'cmd_math'}->{$slanted_command} = '';
+  $LaTeX_style_brace_commands{'cmd_math'}->{$slanted_command} = '\\mathit';
 }
 
 my @emphasized_commands = ('emph');
 foreach my $emphasized_command (@emphasized_commands) {
   $LaTeX_style_brace_commands{'cmd_text'}->{$emphasized_command} = '\\emph';
-  $LaTeX_style_brace_commands{'cmd_math'}->{$emphasized_command} = '';
+  $LaTeX_style_brace_commands{'cmd_math'}->{$emphasized_command} = '\\mathit';
 }
 
 my @bold_commands = ('strong', 'b');
diff --git a/tp/tests/layout/res_parser/formatting_latex/formatting.tex 
b/tp/tests/layout/res_parser/formatting_latex/formatting.tex
index 1f644454cb..f17f13f7e1 100644
--- a/tp/tests/layout/res_parser/formatting_latex/formatting.tex
+++ b/tp/tests/layout/res_parser/formatting_latex/formatting.tex
@@ -352,7 +352,7 @@ $$
 $$
 
 $$
-\mathbf{b} \mathit{i} \mathrm{r} sc \mathsf{sansserif} slanted
+\mathbf{b} \mathit{i} \mathrm{r} sc \mathsf{sansserif} \mathit{slanted}
 $$
 
 \Texinfocommandstyletextkbd{default kbdinputstyle}
@@ -2001,7 +2001,7 @@ $$
 $$
 
 $$
-\mathbf{b} \mathit{i} \mathrm{r} sc \mathsf{sansserif} slanted
+\mathbf{b} \mathit{i} \mathrm{r} sc \mathsf{sansserif} \mathit{slanted}
 $$
 
 \Texinfocommandstyletextkbd{default kbdinputstyle}
@@ -3671,7 +3671,7 @@ $$
 $$
 
 $$
-\mathbf{b} \mathit{i} \mathrm{r} sc \mathsf{sansserif} slanted
+\mathbf{b} \mathit{i} \mathrm{r} sc \mathsf{sansserif} \mathit{slanted}
 $$
 
 \Texinfocommandstyletextkbd{default kbdinputstyle}
@@ -5319,7 +5319,7 @@ $$
 $$
 
 $$
-\mathbf{b} \mathit{i} \mathrm{r} sc \mathsf{sansserif} slanted
+\mathbf{b} \mathit{i} \mathrm{r} sc \mathsf{sansserif} \mathit{slanted}
 $$
 
 \Texinfocommandstyletextkbd{default kbdinputstyle}
@@ -6986,7 +6986,7 @@ $$
 \ttfamily 
 \end{Texinfopreformatted}
 $$
-\mathbf{b} \mathit{i} \mathrm{r} sc \mathsf{sansserif} slanted
+\mathbf{b} \mathit{i} \mathrm{r} sc \mathsf{sansserif} \mathit{slanted}
 $$
 \begin{Texinfopreformatted}%
 \ttfamily 
diff --git a/tp/tests/layout/res_parser/formatting_mathjax/formatting.html 
b/tp/tests/layout/res_parser/formatting_mathjax/formatting.html
index 4a06a66494..7df1f66798 100644
--- a/tp/tests/layout/res_parser/formatting_mathjax/formatting.html
+++ b/tp/tests/layout/res_parser/formatting_mathjax/formatting.html
@@ -1129,7 +1129,7 @@ u
 \mathord{\text{\guillemotright{}}} \mathord{\text{\guillemotleft{}}} 
\mathord{\text{\guillemotright{}}} \mathord{\text{\guilsinglleft{}}}
 \mathord{\text{\guilsinglright{}}} \euro{} \rightarrow{} \leq{} \geq{}
 \]</em></div>
-<div class="displaymath"><em class="tex2jax_process">\[\mathbf{b} \mathit{i} 
\mathrm{r} sc \mathsf{sansserif} slanted
+<div class="displaymath"><em class="tex2jax_process">\[\mathbf{b} \mathit{i} 
\mathrm{r} sc \mathsf{sansserif} \mathit{slanted}
 \]</em></div>
 <p><kbd class="kbd">default kbdinputstyle</kbd>
 </p><dl class="vtable">
@@ -2204,7 +2204,7 @@ u
 \mathord{\text{\guillemotright{}}} \mathord{\text{\guillemotleft{}}} 
\mathord{\text{\guillemotright{}}} \mathord{\text{\guilsinglleft{}}}
 \mathord{\text{\guilsinglright{}}} \euro{} \rightarrow{} \leq{} \geq{}
 \]</em></div>
-<div class="displaymath"><em class="tex2jax_process">\[\mathbf{b} \mathit{i} 
\mathrm{r} sc \mathsf{sansserif} slanted
+<div class="displaymath"><em class="tex2jax_process">\[\mathbf{b} \mathit{i} 
\mathrm{r} sc \mathsf{sansserif} \mathit{slanted}
 \]</em></div>
 <p><kbd class="kbd">default kbdinputstyle</kbd>
 </p><dl class="vtable">
@@ -3335,7 +3335,7 @@ u
 \mathord{\text{\guillemotright{}}} \mathord{\text{\guillemotleft{}}} 
\mathord{\text{\guillemotright{}}} \mathord{\text{\guilsinglleft{}}}
 \mathord{\text{\guilsinglright{}}} \euro{} \rightarrow{} \leq{} \geq{}
 \]</em></div>
-<div class="displaymath"><em class="tex2jax_process">\[\mathbf{b} \mathit{i} 
\mathrm{r} sc \mathsf{sansserif} slanted
+<div class="displaymath"><em class="tex2jax_process">\[\mathbf{b} \mathit{i} 
\mathrm{r} sc \mathsf{sansserif} \mathit{slanted}
 \]</em></div>
 <p><kbd class="kbd">default kbdinputstyle</kbd>
 </p><dl class="vtable">
@@ -4408,7 +4408,7 @@ u
 \mathord{\text{\guillemotright{}}} \mathord{\text{\guillemotleft{}}} 
\mathord{\text{\guillemotright{}}} \mathord{\text{\guilsinglleft{}}}
 \mathord{\text{\guilsinglright{}}} \euro{} \rightarrow{} \leq{} \geq{}
 \]</em></div>
-<div class="displaymath"><em class="tex2jax_process">\[\mathbf{b} \mathit{i} 
\mathrm{r} sc \mathsf{sansserif} slanted
+<div class="displaymath"><em class="tex2jax_process">\[\mathbf{b} \mathit{i} 
\mathrm{r} sc \mathsf{sansserif} \mathit{slanted}
 \]</em></div>
 <p><kbd class="kbd">default kbdinputstyle</kbd>
 </p><dl class="vtable">
@@ -5497,7 +5497,7 @@ u
 \mathord{\text{\guilsinglright{}}} \euro{} \rightarrow{} \leq{} \geq{}
 \]</em></div><pre class="example-preformatted">
 
-</pre><div class="displaymath"><em class="tex2jax_process">\[\mathbf{b} 
\mathit{i} \mathrm{r} sc \mathsf{sansserif} slanted
+</pre><div class="displaymath"><em class="tex2jax_process">\[\mathbf{b} 
\mathit{i} \mathrm{r} sc \mathsf{sansserif} \mathit{slanted}
 \]</em></div><pre class="example-preformatted">
 
 <kbd class="kbd">default kbdinputstyle</kbd>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]