[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Thu, 12 Aug 2021 10:49:15 -0400 (EDT) |
branch: master
commit 4c337e343ca63abdb24c5dcc45c232219956ddc6
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Aug 12 16:46:22 2021 +0200
Always expand @U to utf8, remove newline for @*,
handle @click, @inlineraw, accept empty commands.
---
tp/Texinfo/Convert/LaTeX.pm | 211 ++++++++++-----------
tp/t/converters_tests.t | 10 +-
tp/t/results/converters_tests/accentenc.pl | 114 +++++++++++
tp/t/results/converters_tests/inline.pl | 19 ++
tp/tests/coverage_macro.texi | 2 +
.../res_parser/formatting_latex/formatting.2 | 4 -
.../res_parser/formatting_latex/formatting.tex | 33 ++--
.../res_parser/formatting_xml/formatting.xml | 2 +
8 files changed, 266 insertions(+), 129 deletions(-)
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index c809bc1..f5f6620 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -14,6 +14,21 @@
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+# TODO
+# @shortcontent is not implemented. Tried shorttoc package but it
+# has two limitations that are not in Texinfo, need a main \tableofcontents
+# and need to be before @contents. A code snippet looked good for a
+# @shortcontents after @contents, but not before:
+#{
+#\renewcommand*{\contentsname}{Short contents}
+#\setcounter{tocdepth}{0}
+#\expandafter\def\csname
@starttoc\endcsname#1{\InputIfFileExists{\jobname.#1}{}{}}%
+#\tableofcontents
+#}
+#
+# in TeX, acronym is in a smaller font (1pt less). Can this be
+# easily done in LaTeX? Is it really useful to do that?
package Texinfo::Convert::LaTeX;
@@ -206,7 +221,6 @@ my %LaTeX_no_arg_brace_commands = (
'tie' => '\hbox{}',
}
);
-# TODO check 'click'
my %LaTeX_text_only_no_arg_brace_commands = (
'exclamdown' => 'textexclamdown',
@@ -406,18 +420,13 @@ foreach my $quoted_command (@quoted_commands) {
my %defaults = (
'ENABLE_ENCODING' => 0,
'FORMAT_MENU' => 'nomenu',
- #'EXTENSION' => 'info',
'EXTENSION' => 'tex',
- #'USE_SETFILENAME_EXTENSION' => 1,
- 'INFO_SPECIAL_CHARS_WARNING' => 1,
- #'OUTFILE' => undef,
- 'OUTFILE' => '-',
+ 'OUTFILE' => undef,
'SUBDIR' => undef,
'documentlanguage' => undef,
- 'output_format' => '',
- 'USE_NODES' => 1,
+ 'output_format' => 'latex',
);
@@ -461,19 +470,26 @@ sub converter_initialize($)
$self->{'convert_text_options'}
= {Texinfo::Common::_convert_text_options($self)};
- if ($self->get_conf('ENABLE_ENCODING')
- and $self->get_conf('OUTPUT_ENCODING_NAME')
+ # this condition means that there is no way to turn off
+ # @U expansion to utf-8 characters even though this
+ # could output characters that are not known in the
+ # fontenc and will lead to an error.
+ # FIXME add a customization variable? Or allow/explain
+ # how to add \DeclareUnicodeCharacter{XXXX}{aa}
+ # in preamble? Use a fontenc with more points?
+ if ($self->get_conf('OUTPUT_ENCODING_NAME')
and $self->get_conf('OUTPUT_ENCODING_NAME') eq 'utf-8') {
# cache this to avoid redoing calls to get_conf
$self->{'to_utf8'} = 1;
- if (!$self->{'extra'}->{'documentencoding'}) {
- # Do not use curly quotes or some other unnecessary non-ASCII characters
- # if '@documentencoding UTF-8' is not given.
- $self->{'convert_text_options'}->{'no_extra_unicode'} = 1;
- } else {
- foreach my $quoted_command (@quoted_commands) {
- # Directed single quotes
- $self->{'quotes_map'}->{$quoted_command} = ["\x{2018}", "\x{2019}"];
+
+ if ($self->get_conf('ENABLE_ENCODING')) {
+ # Do not use utf-8 encoded curly quotes if '@documentencoding UTF-8'
+ # is not given.
+ if ($self->{'extra'}->{'documentencoding'}) {
+ foreach my $quoted_command (@quoted_commands) {
+ # Directed single quotes
+ $self->{'quotes_map'}->{$quoted_command} = ["\x{2018}", "\x{2019}"];
+ }
}
}
}
@@ -489,16 +505,7 @@ sub converter_initialize($)
= $self->get_conf('CLOSE_QUOTE_SYMBOL');
}
}
- if ($self->get_conf('FILLCOLUMN')) {
- $self->{'fillcolumn'} = $self->get_conf('FILLCOLUMN');
- # else it's already set via the defaults
- }
# some caching to avoid calling get_conf
- if ($self->get_conf('OUTPUT_PERL_ENCODING')) {
- $self->{'output_perl_encoding'} = $self->get_conf('OUTPUT_PERL_ENCODING');
- } else {
- $self->{'output_perl_encoding'} = '';
- }
$self->{'enable_encoding'} = $self->get_conf('ENABLE_ENCODING');
$self->{'output_encoding_name'} = $self->get_conf('OUTPUT_ENCODING_NAME');
$self->{'debug'} = $self->get_conf('DEBUG');
@@ -532,8 +539,8 @@ sub _latex_header {
\usepackage[T1]{fontenc}
\usepackage{textcomp}
';
- if ($self->get_conf('OUTPUT_ENCODING_NAME')) {
- my $encoding = $self->get_conf('OUTPUT_ENCODING_NAME');
+ if ($self->{'output_encoding_name'}) {
+ my $encoding = $self->{'output_encoding_name'};
if (defined($LaTeX_encoding_names_map{$encoding})) {
$encoding = $LaTeX_encoding_names_map{$encoding};
}# else {
@@ -541,6 +548,10 @@ sub _latex_header {
#}
$header .= "\\usepackage[$encoding]{inputenc}\n";
}
+ #if ($self->{'extra'}->{'shortcontents'}) {
+ # # in texlive-latex-extra in debian
+ # $header .= "\\usepackage{shorttoc}\n";
+ #}
$header .=
'\begin{document}
';
@@ -655,18 +666,6 @@ sub _protect_text($$)
}
-sub _contents($$$)
-{
- my ($self, $section_root, $contents_or_shortcontents) = @_;
-
- my $contents = 1 if ($contents_or_shortcontents eq 'contents');
-
- if ($contents) {
- return "\\tableofcontents\\newpage\n";
- }
- return '';
-}
-
sub _printindex($$)
{
my ($self, $printindex) = @_;
@@ -679,7 +678,7 @@ sub _node_name {
my $node_content = shift;
my $label = Texinfo::Convert::NodeNameNormalization::normalize_node
- ({'type' => '_code', 'contents' => $node_content});
+ ({'contents' => $node_content});
return "anchor:$label";
}
@@ -694,9 +693,6 @@ sub _node($$)
}
-my $listoffloat_entry_length = 41;
-my $listoffloat_append = '...';
-
sub _image_text($$$)
{
my ($self, $root, $basefile) = @_;
@@ -857,7 +853,7 @@ sub _convert($$)
# FIXME \leavevmode{} is added to avoid
# ! LaTeX Error: There's no line here to end.
# but it is not clearly correct
- $result = "\\leavevmode{}\\\\\n";
+ $result = "\\leavevmode{}\\\\";
#$result = "\\linebreak[4]\n";
} elsif ($command eq '.' or $command eq '?' or $command eq '!') {
if ($command_context ne 'math') {
@@ -879,12 +875,15 @@ sub _convert($$)
my $today = $self->Texinfo::Common::expand_today();
unshift @{$self->{'current_contents'}->[-1]}, $today;
} elsif (exists($brace_no_arg_commands{$command})) {
- if (exists($LaTeX_no_arg_brace_commands{$command_context}->{$command})) {
- $result .= $LaTeX_no_arg_brace_commands{$command_context}->{$command};
+ my $converted_command = $command;
+ if ($command eq 'click' and $root->{'extra'}
+ and exists($root->{'extra'}->{'clickstyle'})) {
+ $converted_command = $root->{'extra'}->{'clickstyle'};
+ }
+ if
(exists($LaTeX_no_arg_brace_commands{$command_context}->{$converted_command})) {
+ $result .=
$LaTeX_no_arg_brace_commands{$command_context}->{$converted_command};
} else {
- my $text = Texinfo::Convert::Text::brace_no_arg_command($root,
- $self->{'convert_text_options'});
- $result .= _protect_text($self, $text);
+ die "BUG: unknown brace_no_arg_commands $command $converted_command\n";
}
return $result;
# commands with braces
@@ -916,9 +915,11 @@ sub _convert($$)
return "\\${accent_arg}{}";
}
} else {
+ # should be an error, but we do not care, it is better if it is
+ # handled during parsing
return _protect_text($self, $accent_arg);
}
- # accent without math command, use slanted text
+ # accent without math mode command, use slanted text
} elsif ($command_context eq 'math'
and $LaTeX_accent_commands{'text'}->{$command}) {
$result .= "\\textsl{\\$LaTeX_accent_commands{'text'}->{$command}\{";
@@ -935,26 +936,26 @@ sub _convert($$)
return $result;
} elsif (exists($LaTeX_style_brace_commands{'text'}->{$command})
or ($root->{'type'} and $root->{'type'} eq 'definfoenclose_command'))
{
+ if ($self->{'quotes_map'}->{$command}) {
+ $result .= $self->{'quotes_map'}->{$command}->[0];
+ }
+ if ($LaTeX_style_brace_commands{$command_context}->{$command}) {
+ $result .=
"$LaTeX_style_brace_commands{$command_context}->{$command}\{";
+ }
+ if ($code_style_commands{$command}) {
+ $self->{'style_context'}->[-1]->{'code'} += 1;
+ }
if ($root->{'args'}) {
- if ($self->{'quotes_map'}->{$command}) {
- $result .= $self->{'quotes_map'}->{$command}->[0];
- }
- if ($LaTeX_style_brace_commands{$command_context}->{$command}) {
- $result .=
"$LaTeX_style_brace_commands{$command_context}->{$command}\{";
- }
- if ($code_style_commands{$command}) {
- $self->{'style_context'}->[-1]->{'code'} += 1;
- }
$result .= _convert($self, $root->{'args'}->[0]);
- if ($LaTeX_style_brace_commands{$command_context}->{$command}) {
- $result .= '}';
- }
- if ($code_style_commands{$command}) {
- $self->{'style_context'}->[-1]->{'code'} -= 1;
- }
- if ($self->{'quotes_map'}->{$command}) {
- $result .= $self->{'quotes_map'}->{$command}->[1];
- }
+ }
+ if ($LaTeX_style_brace_commands{$command_context}->{$command}) {
+ $result .= '}';
+ }
+ if ($code_style_commands{$command}) {
+ $self->{'style_context'}->[-1]->{'code'} -= 1;
+ }
+ if ($self->{'quotes_map'}->{$command}) {
+ $result .= $self->{'quotes_map'}->{$command}->[1];
}
return $result;
} elsif ($command eq 'kbd') {
@@ -964,32 +965,32 @@ sub _convert($$)
# ‘example’ Use the distinguishing font for @kbd only in @example and
similar environments.
# ‘distinct’ (the default) Always use the distinguishing font for @kbd.
# {\ttfamily\textsl{kbd argument}}
- if ($root->{'args'}) {
- my $code_font = 0;
- if (defined($self->{'conf'}->{'kbdinputstyle'})
- and ($self->{'conf'}->{'kbdinputstyle'} eq 'code'
- or ($self->{'conf'}->{'kbdinputstyle'} eq 'example'
- and
$preformatted_commands{$self->{'style_context'}->[-1]->{'context'}->[-1]}))) {
- $code_font = 1;
- }
- if ($code_font) {
- if ($LaTeX_style_brace_commands{$command_context}->{'code'}) {
- $result .=
"$LaTeX_style_brace_commands{$command_context}->{'code'}\{";
- }
- } else {
- # use \ttfamily to have a cumulative effect with \textsl
- $result .= '{\ttfamily\textsl{';
+ my $code_font = 0;
+ if (defined($self->{'conf'}->{'kbdinputstyle'})
+ and ($self->{'conf'}->{'kbdinputstyle'} eq 'code'
+ or ($self->{'conf'}->{'kbdinputstyle'} eq 'example'
+ and
$preformatted_commands{$self->{'style_context'}->[-1]->{'context'}->[-1]}))) {
+ $code_font = 1;
+ }
+ if ($code_font) {
+ if ($LaTeX_style_brace_commands{$command_context}->{'code'}) {
+ $result .=
"$LaTeX_style_brace_commands{$command_context}->{'code'}\{";
}
+ } else {
+ # use \ttfamily to have a cumulative effect with \textsl
+ $result .= '{\ttfamily\textsl{';
+ }
+ if ($root->{'args'}) {
$self->{'style_context'}->[-1]->{'code'} += 1;
$result .= _convert($self, $root->{'args'}->[0]);
$self->{'style_context'}->[-1]->{'code'} -= 1;
- if ($code_font) {
- if ($LaTeX_style_brace_commands{$command_context}->{'code'}) {
- $result .= '}';
- }
- } else {
- $result .= '}}';
+ }
+ if ($code_font) {
+ if ($LaTeX_style_brace_commands{$command_context}->{'code'}) {
+ $result .= '}';
}
+ } else {
+ $result .= '}}';
}
return $result;
} elsif ($command eq 'verb') {
@@ -1001,6 +1002,7 @@ sub _convert($$)
my $old_context = pop @{$self->{'style_context'}->[-1]->{'context'}};
die if ($old_context ne 'raw');
$result .= $root->{'extra'}->{'delimiter'};
+ return $result;
} elsif ($command eq 'image') {
my $image = $self->_image($root);
$result .= $image;
@@ -1078,7 +1080,6 @@ sub _convert($$)
$result .= $self->_convert($root->{'args'}->[0]);
$result .= '}';
pop @{$self->{'style_context'}};
-
return $result;
} elsif ($command eq 'anchor') {
$result .= $self->_node($root);
@@ -1180,6 +1181,7 @@ sub _convert($$)
$argument = {'type' => '_dot_not_end_sentence',
'contents' => $root->{'args'}->[0]->{'contents'}};
} else {
+ # TODO in TeX, acronym is in a smaller font (1pt less).
$argument = { 'contents' => $root->{'args'}->[0]->{'contents'}};
}
if (scalar (@{$root->{'args'}}) == 2
@@ -1192,7 +1194,6 @@ sub _convert($$)
return '';
} else {
$result = _convert($self, $argument);
-
return $result;
}
}
@@ -1207,14 +1208,17 @@ sub _convert($$)
if (scalar(@{$root->{'args'}}) > $arg_index
and defined($root->{'args'}->[$arg_index])
and @{$root->{'args'}->[$arg_index]->{'contents'}}) {
- my $argument;
if ($command eq 'inlineraw') {
- $argument->{'type'} = '_code';
+ push @{$self->{'style_context'}->[-1]->{'context'}}, 'raw';
+ }
+ $result .= _convert($self, {'contents'
+ => $root->{'args'}->[$arg_index]->{'contents'}});
+ if ($command eq 'inlineraw') {
+ my $old_context = pop @{$self->{'style_context'}->[-1]->{'context'}};
+ die if ($old_context ne 'raw');
}
- $argument->{'contents'} = $root->{'args'}->[$arg_index]->{'contents'};
- unshift @{$self->{'current_contents'}->[-1]}, ($argument);
}
- return '';
+ return $result;
} elsif ($math_commands{$command}) {
push @{$self->{'style_context'}->[-1]->{'context'}}, 'math';
if (not exists($block_commands{$command})) {
@@ -1461,18 +1465,15 @@ sub _convert($$)
} elsif ($command eq 'contents') {
if ($self->{'structuring'}
and $self->{'structuring'}->{'sectioning_root'}) {
- $result
- = $self->_contents($self->{'structuring'}->{'sectioning_root'},
- 'contents');
+ $result = "\\tableofcontents\\newpage\n";
}
return $result;
} elsif ($command eq 'shortcontents'
or $command eq 'summarycontents') {
if ($self->{'structuring'}
and $self->{'structuring'}->{'sectioning_root'}) {
- $result
- = $self->_contents($self->{'structuring'}->{'sectioning_root'},
- 'shortcontents');
+ # TODO see notes at the beginning
+ $result = '';
}
return $result;
# all the @-commands that have an information for the formatting, like
@@ -1686,14 +1687,12 @@ sub _convert($$)
if ($root->{'contents'}) {
my @contents = @{$root->{'contents'}};
push @{$self->{'current_contents'}}, \@contents;
- push @{$self->{'current_roots'}}, $root;
while (@contents) {
my $content = shift @contents;
my $text = _convert($self, $content);
$result .= $text;
}
pop @{$self->{'current_contents'}};
- pop @{$self->{'current_roots'}};
}
# now closing. First, close types.
diff --git a/tp/t/converters_tests.t b/tp/t/converters_tests.t
index 43912b1..0cb79c4 100644
--- a/tp/t/converters_tests.t
+++ b/tp/t/converters_tests.t
@@ -1042,6 +1042,13 @@ my %xml_file_tests = (
'char_latin1_latin1_in_refs' => 1,
);
+# this is temporary, all the files in @test_cases should go
+# through the LaTeX converter
+my %latex_tests = (
+ 'accentenc' => 1,
+ 'inline' => 1,
+);
+
foreach my $test (@test_cases) {
push @{$test->[2]->{'test_formats'}}, 'plaintext';
if ($html_tests{$test->[0]}) {
@@ -1051,7 +1058,8 @@ foreach my $test (@test_cases) {
}
push @{$test->[2]->{'test_formats'}}, 'xml';
push @{$test->[2]->{'test_formats'}}, 'docbook';
- #push @{$test->[2]->{'test_formats'}}, 'latex';
+ push @{$test->[2]->{'test_formats'}}, 'latex'
+ if ($latex_tests{$test->[0]});
push @{$test->[2]->{'test_formats'}}, 'info'
if ($info_tests{$test->[0]});
}
diff --git a/tp/t/results/converters_tests/accentenc.pl
b/tp/t/results/converters_tests/accentenc.pl
index e8a75ee..38c8f27 100644
--- a/tp/t/results/converters_tests/accentenc.pl
+++ b/tp/t/results/converters_tests/accentenc.pl
@@ -3542,4 +3542,118 @@ $result_converted{'docbook'}->{'accentenc'} = '
</para></chapter>
';
+
+$result_converted{'latex'}->{'accentenc'} = '\\label{anchor:Top}should be e`:
\\`{e} \\`{e}
+
+
+should be e\': \\\'{e} \\\'{e}
+
+
+should be e\\^{}: \\^{e} \\^{e}
+
+
+should be u": \\"{u} \\"{u}
+
+
+should be i`: \\`{i} \\`{i}
+
+
+should be i\': \\\'{i} \\\'{i}
+
+
+should be i\\^{}: \\^{i} \\^{i}
+
+
+should be u": \\"{u} \\"{u}
+
+
+should be c,: \\c{c} \\c{c}
+
+
+should be n\\~{}: \\~{n} \\~{n}
+
+
+should be e=: \\={e} \\={e}
+
+
+should be e\\hbox{\'}\': \\H{e} \\H{e}
+
+
+should be e.: \\.{e} \\.{e}
+
+
+should be e*: \\r{e} \\r{e}
+
+
+should be ee[: \\t{ee}
+
+
+should be e(: \\u{e} \\u{e}
+
+
+should be e\\_: \\b{e} \\b{e}
+
+
+should be .e: \\d{e} \\d{e}
+
+
+should be e<: \\v{e} \\v{e}
+
+
+should be a; : \\k{a} \\k{a}
+
+
+should be e; : \\k{e} \\k{e}
+
+
+upside down: \\textquestiondown{} \\textexclamdown{}
+
+
+A-with-circle: \\aa{},\\AA{}
+
+
+AE, OE ligatures: \\ae{} \\AE{} \\oe{} \\OE{}
+
+
+dotless i, j: \\i{} \\j{}
+
+
+Polish suppressed-L: \\l{} \\L{}
+
+
+O-with-slash: \\o{} \\O{}
+
+
+es-zet or sharp S: \\ss{}
+
+
+pounds sterling: \\textsterling{}
+
+
+should be dotless i`: \\`{\\i{}}
+
+
+should be dotless i\': \\\'{\\i{}}
+
+
+should be dotless i\\^{}: \\^{\\i{}}
+
+
+should be dotless i": \\"{\\i{}}
+
+
+should be dotless j`: \\`{\\j{}}
+
+
+should be dotless j\': \\\'{\\j{}}
+
+
+should be dotless j\\^{}: \\^{\\j{}}
+
+
+should be dotless j": \\"{\\j{}}
+
+
+';
+
1;
diff --git a/tp/t/results/converters_tests/inline.pl
b/tp/t/results/converters_tests/inline.pl
index b39562c..fba527f 100644
--- a/tp/t/results/converters_tests/inline.pl
+++ b/tp/t/results/converters_tests/inline.pl
@@ -909,4 +909,23 @@ raw <emphasis>docbook</emphasis> ``,
</para>';
+
+$result_converted{'latex'}->{'inline'} = ',
+,
+,
+,
+
+$\\frac{a < b \\mathtt{tex \\hbox{ code }}}{b}$ ``
+
+
+,
+,
+,
+,
+
+raw $\\frac{a < b \\texttt{tex \\hbox{ code }}}{b}$ ``
+
+
+';
+
1;
diff --git a/tp/tests/coverage_macro.texi b/tp/tests/coverage_macro.texi
index c304264..a8c7b9d 100644
--- a/tp/tests/coverage_macro.texi
+++ b/tp/tests/coverage_macro.texi
@@ -745,7 +745,9 @@ Invalid use of @@':@*
@@U, without braces @U
@@U@{@}, with empty arg @U{}
@@U@{z@}, with non-hex arg @U{z}
+@ifnotlatex
@@U@{abc@}, with <4 hex digits @U{abc}
+@end ifnotlatex
@@U@{FFFFFFFFFFFFFF@}, value much too large @U{FFFFFFFFFFFFFF}
@@U@{110000@}, value just beyond Unicode @U{110000}
diff --git a/tp/tests/layout/res_parser/formatting_latex/formatting.2
b/tp/tests/layout/res_parser/formatting_latex/formatting.2
index 040d03e..bec312b 100644
--- a/tp/tests/layout/res_parser/formatting_latex/formatting.2
+++ b/tp/tests/layout/res_parser/formatting_latex/formatting.2
@@ -34,7 +34,6 @@ formatting.texi:25: @dotless expects `i' or `j' as argument,
not `a' (possibly i
formatting.texi:25: @U expected braces (possibly involving @mymacro)
formatting.texi:25: warning: no argument specified for @U (possibly involving
@mymacro)
formatting.texi:25: non-hex digits in argument for @U: z (possibly involving
@mymacro)
-formatting.texi:25: warning: fewer than four hex digits in argument for @U:
abc (possibly involving @mymacro)
formatting.texi:25: argument for @U exceeds Unicode maximum 0x10FFFF:
FFFFFFFFFFFFFF (possibly involving @mymacro)
formatting.texi:25: argument for @U exceeds Unicode maximum 0x10FFFF: 110000
(possibly involving @mymacro)
formatting.texi:25: @TeX expected braces (possibly involving @mymacro)
@@ -94,7 +93,6 @@ formatting.texi:35: @dotless expects `i' or `j' as argument,
not `a' (possibly i
formatting.texi:35: @U expected braces (possibly involving @mymacro)
formatting.texi:35: warning: no argument specified for @U (possibly involving
@mymacro)
formatting.texi:35: non-hex digits in argument for @U: z (possibly involving
@mymacro)
-formatting.texi:35: warning: fewer than four hex digits in argument for @U:
abc (possibly involving @mymacro)
formatting.texi:35: argument for @U exceeds Unicode maximum 0x10FFFF:
FFFFFFFFFFFFFF (possibly involving @mymacro)
formatting.texi:35: argument for @U exceeds Unicode maximum 0x10FFFF: 110000
(possibly involving @mymacro)
formatting.texi:35: @TeX expected braces (possibly involving @mymacro)
@@ -154,7 +152,6 @@ formatting.texi:45: @dotless expects `i' or `j' as
argument, not `a' (possibly i
formatting.texi:45: @U expected braces (possibly involving @mymacro)
formatting.texi:45: warning: no argument specified for @U (possibly involving
@mymacro)
formatting.texi:45: non-hex digits in argument for @U: z (possibly involving
@mymacro)
-formatting.texi:45: warning: fewer than four hex digits in argument for @U:
abc (possibly involving @mymacro)
formatting.texi:45: argument for @U exceeds Unicode maximum 0x10FFFF:
FFFFFFFFFFFFFF (possibly involving @mymacro)
formatting.texi:45: argument for @U exceeds Unicode maximum 0x10FFFF: 110000
(possibly involving @mymacro)
formatting.texi:45: @TeX expected braces (possibly involving @mymacro)
@@ -214,7 +211,6 @@ formatting.texi:49: @dotless expects `i' or `j' as
argument, not `a' (possibly i
formatting.texi:49: @U expected braces (possibly involving @mymacro)
formatting.texi:49: warning: no argument specified for @U (possibly involving
@mymacro)
formatting.texi:49: non-hex digits in argument for @U: z (possibly involving
@mymacro)
-formatting.texi:49: warning: fewer than four hex digits in argument for @U:
abc (possibly involving @mymacro)
formatting.texi:49: argument for @U exceeds Unicode maximum 0x10FFFF:
FFFFFFFFFFFFFF (possibly involving @mymacro)
formatting.texi:49: argument for @U exceeds Unicode maximum 0x10FFFF: 110000
(possibly involving @mymacro)
formatting.texi:49: @TeX expected braces (possibly involving @mymacro)
diff --git a/tp/tests/layout/res_parser/formatting_latex/formatting.tex
b/tp/tests/layout/res_parser/formatting_latex/formatting.tex
index 7890b98..c7a83e7 100644
--- a/tp/tests/layout/res_parser/formatting_latex/formatting.tex
+++ b/tp/tests/layout/res_parser/formatting_latex/formatting.tex
@@ -48,7 +48,7 @@ kbd:
{\ttfamily\textsl{``simple-double{-}{-}three{-}{-}{-}four{-}{-}{-}-''}} \le
@,c@"u \c{c}\"{u} \leavevmode{}\\
-@U\{0075\} U+0075
+@U\{0075\} u
@* \leavevmode{}\\
@@ -230,9 +230,9 @@ aaa
\texttt{@image\{@file\{f{-}{-}ile\}@@@.,aze,az,alt,@file\{.file ext\}
e{-}{-}xt@\}} [alt]
-\texttt{@clicksequence\{click @click\{\} A\}} click -> A
+\texttt{@clicksequence\{click @click\{\} A\}} click $\rightarrow{}$ A
After clickstyle $\Rightarrow{}$
-\texttt{@clicksequence\{click @click\{\} A\}} click => A
+\texttt{@clicksequence\{click @click\{\} A\}} click $\Rightarrow{}$ A
$$
@@ -247,8 +247,8 @@ $$
a sunny day
$$
$$
-->
-U+0075
+\rightarrow{}
+u
TeX LaTeX \bullet{} \copyright{} \dots{} \dots{} \equiv{}
\fbox{error} \mapsto{} - \star{} \dashv{} \Rightarrow{}
\mathord{\text{\aa{}}} \mathord{\text{\AA{}}} \mathord{\text{\ae{}}}
\mathord{\text{\oe{}}} \mathord{\text{\AE{}}} \mathord{\text{\OE{}}}
\mathord{\text{\o{}}} \mathord{\text{\O{}}} \mathord{\text{\ss{}}}
\mathord{\text{\l{}}} \mathord{\text{\L{}}} \mathord{\text{\DH{}}}
@@ -843,7 +843,6 @@ Invalid use of @':\leavevmode{}\\
@U, without braces @U\{\}, with empty arg
@U\{z\}, with non-hex arg U+z
-@U\{abc\}, with <4 hex digits U+abc
@U\{FFFFFFFFFFFFFF\}, value much too large U+FFFFFFFFFFFFFF
@U\{110000\}, value just beyond Unicode U+110000
@@ -977,7 +976,7 @@ kbd:
{\ttfamily\textsl{``simple-double{-}{-}three{-}{-}{-}four{-}{-}{-}-''}} \le
@,c@"u \c{c}\"{u} \leavevmode{}\\
-@U\{0075\} U+0075
+@U\{0075\} u
@* \leavevmode{}\\
@@ -1159,9 +1158,9 @@ aaa
\texttt{@image\{@file\{f{-}{-}ile\}@@@.,aze,az,alt,@file\{.file ext\}
e{-}{-}xt@\}} [alt]
-\texttt{@clicksequence\{click @click\{\} A\}} click -> A
+\texttt{@clicksequence\{click @click\{\} A\}} click $\rightarrow{}$ A
After clickstyle $\Rightarrow{}$
-\texttt{@clicksequence\{click @click\{\} A\}} click => A
+\texttt{@clicksequence\{click @click\{\} A\}} click $\Rightarrow{}$ A
$$
@@ -1176,8 +1175,8 @@ $$
a sunny day
$$
$$
-->
-U+0075
+\rightarrow{}
+u
TeX LaTeX \bullet{} \copyright{} \dots{} \dots{} \equiv{}
\fbox{error} \mapsto{} - \star{} \dashv{} \Rightarrow{}
\mathord{\text{\aa{}}} \mathord{\text{\AA{}}} \mathord{\text{\ae{}}}
\mathord{\text{\oe{}}} \mathord{\text{\AE{}}} \mathord{\text{\OE{}}}
\mathord{\text{\o{}}} \mathord{\text{\O{}}} \mathord{\text{\ss{}}}
\mathord{\text{\l{}}} \mathord{\text{\L{}}} \mathord{\text{\DH{}}}
@@ -1772,7 +1771,6 @@ Invalid use of @':\leavevmode{}\\
@U, without braces @U\{\}, with empty arg
@U\{z\}, with non-hex arg U+z
-@U\{abc\}, with <4 hex digits U+abc
@U\{FFFFFFFFFFFFFF\}, value much too large U+FFFFFFFFFFFFFF
@U\{110000\}, value just beyond Unicode U+110000
@@ -1898,7 +1896,7 @@ kbd:
{\ttfamily\textsl{``simple-double{-}{-}three{-}{-}{-}four{-}{-}{-}-''}} \le
@,\{@'C\} \c{\'{C}}
@,c \c{c}
@,c@"u \c{c}\"{u} \leavevmode{}\\
-@U\{0075\} U+0075
+@U\{0075\} u
@* \leavevmode{}\\
@ followed by a space
\ {}
@@ -2064,9 +2062,9 @@ aaa
aaa
\texttt{@image\{f-ile,aze,,a{-}{-}lt\}} [a-lt]
\texttt{@image\{@file\{f{-}{-}ile\}@@@.,aze,az,alt,@file\{.file ext\}
e{-}{-}xt@\}} [alt]
-\texttt{@clicksequence\{click @click\{\} A\}} click -> A
+\texttt{@clicksequence\{click @click\{\} A\}} click $\rightarrow{}$ A
After clickstyle $\Rightarrow{}$
-\texttt{@clicksequence\{click @click\{\} A\}} click => A
+\texttt{@clicksequence\{click @click\{\} A\}} click $\Rightarrow{}$ A
$$
@@ -2085,8 +2083,8 @@ $$
$$
-->
-U+0075
+\rightarrow{}
+u
TeX LaTeX \bullet{} \copyright{} \dots{} \dots{} \equiv{}
\fbox{error} \mapsto{} - \star{} \dashv{} \Rightarrow{}
\mathord{\text{\aa{}}} \mathord{\text{\AA{}}} \mathord{\text{\ae{}}}
\mathord{\text{\oe{}}} \mathord{\text{\AE{}}} \mathord{\text{\OE{}}}
\mathord{\text{\o{}}} \mathord{\text{\O{}}} \mathord{\text{\ss{}}}
\mathord{\text{\l{}}} \mathord{\text{\L{}}} \mathord{\text{\DH{}}}
@@ -2843,7 +2841,6 @@ Invalid use of @':\leavevmode{}\\
\texttt{@dotless\{a\}} a
@U, without braces @U\{\}, with empty arg
@U\{z\}, with non-hex arg U+z
-@U\{abc\}, with <4 hex digits U+abc
@U\{FFFFFFFFFFFFFF\}, value much too large U+FFFFFFFFFFFFFF
@U\{110000\}, value just beyond Unicode U+110000
@TeX, but without brace \TeX{}\texttt{@\#} \#
diff --git a/tp/tests/layout/res_parser/formatting_xml/formatting.xml
b/tp/tests/layout/res_parser/formatting_xml/formatting.xml
index 3959074..c9572e9 100644
--- a/tp/tests/layout/res_parser/formatting_xml/formatting.xml
+++ b/tp/tests/layout/res_parser/formatting_xml/formatting.xml
@@ -768,7 +768,9 @@ Invalid use of @@':@*
@@U, without braces @U
@@U@{@}, with empty arg @U{}
@@U@{z@}, with non-hex arg @U{z}
+@ifnotlatex
@@U@{abc@}, with <4 hex digits @U{abc}
+@end ifnotlatex
@@U@{FFFFFFFFFFFFFF@}, value much too large @U{FFFFFFFFFFFFFF}
@@U@{110000@}, value just beyond Unicode @U{110000}