[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/LaTeX.pm (%roman_style_comma
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Convert/LaTeX.pm (%roman_style_commands, _convert): use %roman_style_commands for @-commands that stop code context. |
Date: |
Wed, 10 Aug 2022 17:56:32 -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 70f8e6b37f * tp/Texinfo/Convert/LaTeX.pm (%roman_style_commands,
_convert): use %roman_style_commands for @-commands that stop code context.
70f8e6b37f is described below
commit 70f8e6b37f2f5f93b0850edc4b69d67aa0ad7237
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Wed Aug 10 23:56:20 2022 +0200
* tp/Texinfo/Convert/LaTeX.pm (%roman_style_commands, _convert):
use %roman_style_commands for @-commands that stop code context.
---
ChangeLog | 5 +++++
tp/Texinfo/Convert/LaTeX.pm | 11 ++++++++---
tp/tests/layout/res_parser/formatting_latex/formatting.tex | 2 +-
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index e79ffb7d7a..68f4f6468b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-08-10 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/LaTeX.pm (%roman_style_commands, _convert):
+ use %roman_style_commands for @-commands that stop code context.
+
2022-08-10 Gavin Smith <gavinsmith0123@gmail.com>
@def documentation
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 0c148e29f5..fc9062a550 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -603,6 +603,11 @@ sub register_style_format_command($$$$$)
= "$specific_style_command\[1]{{$formatting\{#1}}}";
}
+# @-commands that stop code context
+my %roman_style_commands = (
+ 'r' => 1,
+);
+
# All those commands run with the text.
# math, verb and kbd are special and implemented separately
my %LaTeX_style_brace_commands = (
@@ -643,6 +648,7 @@ foreach my $always_slanted_roman_commands ('cite', 'var') {
'\\normalfont{}\\textsl', \%LaTeX_style_brace_commands,
\%style_brace_format_command_new_commands);
$LaTeX_style_brace_commands{'math'}->{$always_slanted_roman_commands} = '';
+ $roman_style_commands{$always_slanted_roman_commands} = 1;
}
# FIXME headitemfont
@@ -2447,8 +2453,7 @@ sub _convert($$)
my $remove_code_context;
if ($code_style_commands{$cmdname}) {
push @{$self->{'formatting_context'}->[-1]->{'code'}}, 1;
- } elsif ($cmdname eq 'r' or $cmdname eq 'var') {
- $remove_code_context = 1;
+ } elsif ($roman_style_commands{$cmdname}) {
push @{$self->{'formatting_context'}->[-1]->{'code'}}, 0;
}
my $formatting_context = $command_context;
@@ -2482,7 +2487,7 @@ sub _convert($$)
}
if ($code_style_commands{$cmdname}) {
pop @{$self->{'formatting_context'}->[-1]->{'code'}};
- } elsif ($remove_code_context) {
+ } elsif ($roman_style_commands{$cmdname}) {
pop @{$self->{'formatting_context'}->[-1]->{'code'}};
}
if ($self->{'quotes_map'}->{$cmdname}) {
diff --git a/tp/tests/layout/res_parser/formatting_latex/formatting.tex
b/tp/tests/layout/res_parser/formatting_latex/formatting.tex
index 6d24999c69..90f8e01273 100644
--- a/tp/tests/layout/res_parser/formatting_latex/formatting.tex
+++ b/tp/tests/layout/res_parser/formatting_latex/formatting.tex
@@ -6201,7 +6201,7 @@ but ,\ ,\@
\texttt{@abbr\{@'E{-}{-}.\ @comma\{\}A.\}} \'{E}{-}{-}.\@\ ,A.\@
\texttt{@asis\{{-}{-}a\}} {-}{-}a
\texttt{@b\{{-}{-}a\}} \textbf{{-}{-}a}
-\texttt{@cite\{{-}{-}a\}} \GNUTexinfocommandstyletextcite{{-}{-}a}
+\texttt{@cite\{{-}{-}a\}} \GNUTexinfocommandstyletextcite{--a}
\texttt{@code\{{-}{-}a\}} \texttt{{-}{-}a}
\texttt{@command\{{-}{-}a\}} \texttt{{-}{-}a}
\texttt{@dfn\{{-}{-}a\}} \textsl{{-}{-}a}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Convert/LaTeX.pm (%roman_style_commands, _convert): use %roman_style_commands for @-commands that stop code context.,
Patrice Dumas <=