[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
branch master updated: * tp/Texinfo/Convert/LaTeX.pm (_push_new_context,
From: |
Patrice Dumas |
Subject: |
branch master updated: * tp/Texinfo/Convert/LaTeX.pm (_push_new_context, _convert): carry formatted context over to float. |
Date: |
Thu, 22 Dec 2022 15:37:50 -0500 |
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 637e6d7468 * tp/Texinfo/Convert/LaTeX.pm (_push_new_context,
_convert): carry formatted context over to float.
637e6d7468 is described below
commit 637e6d746872b2208803f5d75813af40d0d70d55
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Dec 22 21:37:39 2022 +0100
* tp/Texinfo/Convert/LaTeX.pm (_push_new_context, _convert): carry
formatted context over to float.
* tp/Makefile.tres, tp/t/27float.t: add float_in_block_commands
test.
---
ChangeLog | 8 +
tp/Makefile.tres | 1 +
tp/TODO | 5 +
tp/Texinfo/Convert/LaTeX.pm | 14 +-
tp/t/27float.t | 27 +
tp/t/results/float/float_in_block_commands.pl | 807 ++++++++++++++++++++++++++
6 files changed, 859 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 08257a31c8..104c7016d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-12-22 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/Convert/LaTeX.pm (_push_new_context, _convert): carry
+ formatted context over to float.
+
+ * tp/Makefile.tres, tp/t/27float.t: add float_in_block_commands
+ test.
+
2022-12-21 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/Convert/Plaintext.pm: reindent, cut at 80 columns,
diff --git a/tp/Makefile.tres b/tp/Makefile.tres
index d14bdd69f1..a9989fd3eb 100644
--- a/tp/Makefile.tres
+++ b/tp/Makefile.tres
@@ -411,6 +411,7 @@ test_files_generated_list =
$(test_tap_files_generated_list) \
t/results/float/empty_listoffloats.pl \
t/results/float/empty_listoffloats_with_floats.pl \
t/results/float/float_copying.pl \
+ t/results/float/float_in_block_commands.pl \
t/results/float/float_with_at_commands.pl \
t/results/float/footnote_in_caption.pl \
t/results/float/footnote_in_caption_and_error.pl \
diff --git a/tp/TODO b/tp/TODO
index 25d9618566..2323ddcfa4 100644
--- a/tp/TODO
+++ b/tp/TODO
@@ -21,6 +21,11 @@ for example
* " <1>: chapter. (line 701)
is 5 or 6 lines before the index @-command.
+Empty environment for float in @cartouche
+\newenvironment{Texinfononfloatingfloat}
+ {\ignorespaces}
+ {\ignorespacesafterend}
+
HTML API
========
diff --git a/tp/Texinfo/Convert/LaTeX.pm b/tp/Texinfo/Convert/LaTeX.pm
index 0fbe9c9dc2..194c39505c 100644
--- a/tp/Texinfo/Convert/LaTeX.pm
+++ b/tp/Texinfo/Convert/LaTeX.pm
@@ -1634,10 +1634,13 @@ sub _latex_footer {
}
# all the new contexts should be created with that function
-sub _push_new_context($$)
+# PREFORMATTED_CONTEXT can be specified, for instance if the preformatted
+# context is common with the surrounding context, as is the case for floats.
+sub _push_new_context($$;$)
{
my $self = shift;
my $context_name = shift;
+ my $preformatted_context = shift;
push @{$self->{'formatting_context'}},
{
@@ -1656,6 +1659,9 @@ sub _push_new_context($$)
'text_context' => ['ctx_text'],
'table_command_format' => [],
};
+ $self->{'formatting_context'}->[-1]->{'preformatted_context'}
+ = $preformatted_context
+ if (defined($preformatted_context));
}
# for debug
@@ -3312,8 +3318,10 @@ sub _convert($$)
cluck("\@float $normalized_float_type: not found\n");
return '';
}
- my $latex_float_name =
$self->{'normalized_float_latex'}->{$normalized_float_type};
- _push_new_context($self, 'float'.$latex_float_name);
+ my $latex_float_name
+ = $self->{'normalized_float_latex'}->{$normalized_float_type};
+ _push_new_context($self, 'float'.$latex_float_name,
+ $self->{'formatting_context'}->[-1]->{'preformatted_context'});
$result .= "\\begin{$latex_float_name}\n";
}
}
diff --git a/tp/t/27float.t b/tp/t/27float.t
index 668606fb2d..eae195a714 100644
--- a/tp/t/27float.t
+++ b/tp/t/27float.t
@@ -260,6 +260,26 @@ A footnote 2.
@xref{text with a lot of features}.
+'],
+['float_in_block_commands',
+'@example
+@float Text, in example
+@caption{float in example}
+@end float
+@end example
+
+@quotation
+@float Text, in quotation
+@caption{float in quotation}
+@end float
+@end quotation
+
+@cartouche
+@float Text, in cartouche
+@caption{float in cartouche}
+@end float
+@end cartouche
+
'],
['numbering_captions_listoffloats',
'@node Top
@@ -550,6 +570,10 @@ my %info_tests = (
'comment_space_comand_in_float' => 1,
);
+my %latex_tests = (
+ 'float_in_block_commands' => 1,
+);
+
foreach my $test (@test_cases) {
$test->[2]->{'test_formats'} = ['plaintext'];
if ($info_tests{$test->[0]}) {
@@ -557,6 +581,9 @@ foreach my $test (@test_cases) {
}
push @{$test->[2]->{'test_formats'}}, 'html';
push @{$test->[2]->{'test_formats'}}, 'xml';
+ if ($latex_tests{$test->[0]}) {
+ push @{$test->[2]->{'test_formats'}}, 'latex';
+ }
$test->[2]->{'full_document'} = 1 unless
(exists($test->[2]->{'full_document'}));
}
diff --git a/tp/t/results/float/float_in_block_commands.pl
b/tp/t/results/float/float_in_block_commands.pl
new file mode 100644
index 0000000000..48b1690abe
--- /dev/null
+++ b/tp/t/results/float/float_in_block_commands.pl
@@ -0,0 +1,807 @@
+use vars qw(%result_texis %result_texts %result_trees %result_errors
+ %result_indices %result_sectioning %result_nodes %result_menus
+ %result_floats %result_converted %result_converted_errors
+ %result_elements %result_directions_text %result_indices_sort_strings);
+
+use utf8;
+
+$result_trees{'float_in_block_commands'} = {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [],
+ 'type' => 'preamble_before_content'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'example',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Text'
+ }
+ ],
+ 'type' => 'block_line_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'in example'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+',
+ 'spaces_before_argument' => ' '
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'float',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'float in example'
+ }
+ ],
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'brace_command_context'
+ }
+ ],
+ 'cmdname' => 'caption',
+ 'extra' => {
+ 'float' => {}
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 3,
+ 'macro' => ''
+ }
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => '
+'
+ }
+ ],
+ 'type' => 'preformatted'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'float'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'float'
+ },
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 4,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'extra' => {
+ 'caption' => {},
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'in-example',
+ 'type' => {
+ 'content' => [
+ {}
+ ],
+ 'normalized' => 'Text'
+ }
+ },
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 2,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'example'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'example'
+ },
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 5,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 1,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'quotation',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Text'
+ }
+ ],
+ 'type' => 'block_line_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'in quotation'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+',
+ 'spaces_before_argument' => ' '
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'float',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'float in quotation'
+ }
+ ],
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'brace_command_context'
+ }
+ ],
+ 'cmdname' => 'caption',
+ 'extra' => {
+ 'float' => {}
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 9,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'float'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'float'
+ },
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 10,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'extra' => {
+ 'caption' => {},
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'in-quotation',
+ 'type' => {
+ 'content' => [
+ {}
+ ],
+ 'normalized' => 'Text'
+ }
+ },
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 8,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'quotation'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'quotation'
+ },
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 11,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 7,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ },
+ {
+ 'args' => [
+ {
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'cartouche',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'Text'
+ }
+ ],
+ 'type' => 'block_line_arg'
+ },
+ {
+ 'contents' => [
+ {
+ 'text' => 'in cartouche'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+',
+ 'spaces_before_argument' => ' '
+ },
+ 'type' => 'block_line_arg'
+ }
+ ],
+ 'cmdname' => 'float',
+ 'contents' => [
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'float in cartouche'
+ }
+ ],
+ 'type' => 'paragraph'
+ }
+ ],
+ 'type' => 'brace_command_context'
+ }
+ ],
+ 'cmdname' => 'caption',
+ 'extra' => {
+ 'float' => {}
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 15,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+'
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'float'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'float'
+ },
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 16,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'extra' => {
+ 'caption' => {},
+ 'node_content' => [
+ {}
+ ],
+ 'normalized' => 'in-cartouche',
+ 'type' => {
+ 'content' => [
+ {}
+ ],
+ 'normalized' => 'Text'
+ }
+ },
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 14,
+ 'macro' => ''
+ }
+ },
+ {
+ 'args' => [
+ {
+ 'contents' => [
+ {
+ 'text' => 'cartouche'
+ }
+ ],
+ 'info' => {
+ 'spaces_after_argument' => '
+'
+ },
+ 'type' => 'line_arg'
+ }
+ ],
+ 'cmdname' => 'end',
+ 'extra' => {
+ 'text_arg' => 'cartouche'
+ },
+ 'info' => {
+ 'spaces_before_argument' => ' '
+ },
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 17,
+ 'macro' => ''
+ }
+ }
+ ],
+ 'source_info' => {
+ 'file_name' => '',
+ 'line_nr' => 13,
+ 'macro' => ''
+ }
+ },
+ {
+ 'text' => '
+',
+ 'type' => 'empty_line'
+ }
+ ],
+ 'type' => 'before_node_section'
+ }
+ ],
+ 'type' => 'document_root'
+};
+$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[1]{'contents'}[0]{'contents'}[0]{'extra'}{'float'}
=
$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[1]{'contents'}[0];
+$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[1]{'contents'}[0]{'extra'}{'caption'}
=
$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[1]{'contents'}[0]{'contents'}[0];
+$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[1]{'contents'}[0]{'extra'}{'node_content'}[0]
=
$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[1]{'contents'}[0]{'args'}[1]{'contents'}[0];
+$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[1]{'contents'}[0]{'extra'}{'type'}{'content'}[0]
=
$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[1]{'contents'}[0]{'args'}[0]{'contents'}[0];
+$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[3]{'contents'}[0]{'contents'}[0]{'extra'}{'float'}
=
$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[3]{'contents'}[0];
+$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[3]{'contents'}[0]{'extra'}{'caption'}
=
$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[3]{'contents'}[0]{'contents'}[0];
+$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[3]{'contents'}[0]{'extra'}{'node_content'}[0]
=
$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[3]{'contents'}[0]{'args'}[1]{'contents'}[0];
+$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[3]{'contents'}[0]{'extra'}{'type'}{'content'}[0]
=
$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[3]{'contents'}[0]{'args'}[0]{'contents'}[0];
+$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[5]{'contents'}[0]{'contents'}[0]{'extra'}{'float'}
=
$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[5]{'contents'}[0];
+$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[5]{'contents'}[0]{'extra'}{'caption'}
=
$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[5]{'contents'}[0]{'contents'}[0];
+$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[5]{'contents'}[0]{'extra'}{'node_content'}[0]
=
$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[5]{'contents'}[0]{'args'}[1]{'contents'}[0];
+$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[5]{'contents'}[0]{'extra'}{'type'}{'content'}[0]
=
$result_trees{'float_in_block_commands'}{'contents'}[0]{'contents'}[5]{'contents'}[0]{'args'}[0]{'contents'}[0];
+
+$result_texis{'float_in_block_commands'} = '@example
+@float Text, in example
+@caption{float in example}
+@end float
+@end example
+
+@quotation
+@float Text, in quotation
+@caption{float in quotation}
+@end float
+@end quotation
+
+@cartouche
+@float Text, in cartouche
+@caption{float in cartouche}
+@end float
+@end cartouche
+
+';
+
+
+$result_texts{'float_in_block_commands'} = 'Text, in example
+
+
+Text, in quotation
+
+
+Text, in cartouche
+
+
+';
+
+$result_errors{'float_in_block_commands'} = [];
+
+
+$result_floats{'float_in_block_commands'} = {
+ 'Text' => [
+ {
+ 'cmdname' => 'float',
+ 'extra' => {
+ 'caption' => {
+ 'cmdname' => 'caption',
+ 'extra' => {
+ 'float' => {}
+ }
+ },
+ 'normalized' => 'in-example',
+ 'type' => {
+ 'content' => [
+ {
+ 'text' => 'Text'
+ }
+ ],
+ 'normalized' => 'Text'
+ }
+ },
+ 'info' => {},
+ 'structure' => {
+ 'float_number' => 1
+ }
+ },
+ {
+ 'cmdname' => 'float',
+ 'extra' => {
+ 'caption' => {
+ 'cmdname' => 'caption',
+ 'extra' => {
+ 'float' => {}
+ }
+ },
+ 'normalized' => 'in-quotation',
+ 'type' => {
+ 'content' => [
+ {
+ 'text' => 'Text'
+ }
+ ],
+ 'normalized' => 'Text'
+ }
+ },
+ 'info' => {},
+ 'structure' => {
+ 'float_number' => 2
+ }
+ },
+ {
+ 'cmdname' => 'float',
+ 'extra' => {
+ 'caption' => {
+ 'cmdname' => 'caption',
+ 'extra' => {
+ 'float' => {}
+ }
+ },
+ 'normalized' => 'in-cartouche',
+ 'type' => {
+ 'content' => [
+ {
+ 'text' => 'Text'
+ }
+ ],
+ 'normalized' => 'Text'
+ }
+ },
+ 'info' => {},
+ 'structure' => {
+ 'float_number' => 3
+ }
+ }
+ ]
+};
+$result_floats{'float_in_block_commands'}{'Text'}[0]{'extra'}{'caption'}{'extra'}{'float'}
= $result_floats{'float_in_block_commands'}{'Text'}[0];
+$result_floats{'float_in_block_commands'}{'Text'}[1]{'extra'}{'caption'}{'extra'}{'float'}
= $result_floats{'float_in_block_commands'}{'Text'}[1];
+$result_floats{'float_in_block_commands'}{'Text'}[2]{'extra'}{'caption'}{'extra'}{'float'}
= $result_floats{'float_in_block_commands'}{'Text'}[2];
+
+
+
+$result_converted{'plaintext'}->{'float_in_block_commands'} = '
+ Text 1: float in example
+
+
+ Text 2: float in quotation
+
+
+Text 3: float in cartouche
+
+';
+
+
+$result_converted{'html'}->{'float_in_block_commands'} = '<!DOCTYPE html>
+<html>
+<!-- Created by texinfo, http://www.gnu.org/software/texinfo/ -->
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+<title>Untitled Document</title>
+
+<meta name="description" content="Untitled Document">
+<meta name="keywords" content="Untitled Document">
+<meta name="resource-type" content="document">
+<meta name="distribution" content="global">
+<meta name="viewport" content="width=device-width,initial-scale=1">
+
+<style type="text/css">
+<!--
+div.example {margin-left: 3.2em}
+-->
+</style>
+
+
+</head>
+
+<body lang="en">
+<div class="example">
+<div class="float" id="in-example">
+<pre class="example-preformatted">
+
+</pre><div class="caption"><p><strong class="strong">Text 1: </strong>float in
example</p></div></div></div>
+
+<blockquote class="quotation">
+<div class="float" id="in-quotation">
+
+<div class="caption"><p><strong class="strong">Text 2: </strong>float in
quotation</p></div></div></blockquote>
+
+<table class="cartouche" border="1"><tr><td>
+<div class="float" id="in-cartouche">
+
+<div class="caption"><p><strong class="strong">Text 3: </strong>float in
cartouche</p></div></div></td></tr></table>
+
+
+
+
+</body>
+</html>
+';
+
+$result_converted_errors{'html'}->{'float_in_block_commands'} = [
+ {
+ 'error_line' => 'warning: must specify a title with a title command or @top
+',
+ 'text' => 'must specify a title with a title command or @top',
+ 'type' => 'warning'
+ }
+];
+
+
+
+$result_converted{'xml'}->{'float_in_block_commands'} = '<example endspaces="
">
+<float name="in-example" type="Text" number="1" spaces=" " endspaces="
"><floattype>Text</floattype><floatname spaces=" ">in example</floatname>
+<caption><para>float in example</para></caption><pre xml:space="preserve">
+</pre></float>
+</example>
+
+<quotation endspaces=" ">
+<float name="in-quotation" type="Text" number="2" spaces=" " endspaces="
"><floattype>Text</floattype><floatname spaces=" ">in quotation</floatname>
+<caption><para>float in quotation</para></caption>
+</float>
+</quotation>
+
+<cartouche endspaces=" ">
+<float name="in-cartouche" type="Text" number="3" spaces=" " endspaces="
"><floattype>Text</floattype><floatname spaces=" ">in cartouche</floatname>
+<caption><para>float in cartouche</para></caption>
+</float>
+</cartouche>
+
+';
+
+
+$result_converted{'latex'}->{'float_in_block_commands'} =
'\\documentclass{book}
+\\usepackage{amsfonts}
+\\usepackage{amsmath}
+\\usepackage[gen]{eurosym}
+\\usepackage{textcomp}
+\\usepackage{graphicx}
+\\usepackage{etoolbox}
+\\usepackage{titleps}
+\\usepackage[utf8]{inputenc}
+\\usepackage[T1]{fontenc}
+\\usepackage[framemethod=tikz]{mdframed}
+\\usepackage{float}
+% use hidelinks to remove boxes around links to be similar to Texinfo TeX
+\\usepackage[hidelinks]{hyperref}
+
+\\makeatletter
+\\newcommand{\\Texinfosettitle}{No Title}%
+
+% new float for type `Text\'
+\\newfloat{TexinfoFloatText}{htb}{tfl}[chapter]
+\\floatname{TexinfoFloatText}{}
+% redefine the \\mainmatter command such that it does not clear page
+% as if in double page
+\\renewcommand\\mainmatter{\\clearpage\\@mainmattertrue\\pagenumbering{arabic}}
+\\newenvironment{Texinfopreformatted}{%
+
\\par\\GNUTobeylines\\obeyspaces\\frenchspacing\\parskip=\\z@\\parindent=\\z@}{}
+{\\catcode`\\^^M=13 \\gdef\\GNUTobeylines{\\catcode`\\^^M=13
\\def^^M{\\null\\par}}}
+\\newenvironment{Texinfoindented}{\\begin{list}{}{}\\item\\relax}{\\end{list}}
+
+
+% used for substitutions in commands
+\\newcommand{\\Texinfoplaceholder}[1]{}
+
+\\newpagestyle{single}{\\sethead[\\chaptername{} \\thechapter{}
\\chaptertitle{}][][\\thepage]
+ {\\chaptername{} \\thechapter{}
\\chaptertitle{}}{}{\\thepage}}
+
+% the mdframed style for @cartouche
+\\mdfdefinestyle{Texinfocartouche}{
+innertopmargin=10pt, innerbottommargin=10pt,%
+roundcorner=10pt}
+
+% allow line breaking at underscore
+\\let\\Texinfounderscore\\_
+\\renewcommand{\\_}{\\Texinfounderscore\\discretionary{}{}{}}
+\\renewcommand{\\includegraphics}[1]{\\fbox{FIG \\detokenize{#1}}}
+
+\\makeatother
+% set default for @setchapternewpage
+\\makeatletter
+\\patchcmd{\\chapter}{\\if@openright\\cleardoublepage\\else\\clearpage\\fi}{\\Texinfoplaceholder{setchapternewpage
placeholder}\\clearpage}{}{}
+\\makeatother
+\\pagestyle{single}%
+
+\\begin{document}
+\\begin{Texinfoindented}
+\\begin{TexinfoFloatText}
+\\caption{float in example}
+\\begin{Texinfopreformatted}%
+\\ttfamily
+\\end{Texinfopreformatted}
+\\label{anchor:in-example}%
+\\end{TexinfoFloatText}
+\\end{Texinfoindented}
+
+\\begin{quote}
+\\begin{TexinfoFloatText}
+\\caption{float in quotation}
+
+\\label{anchor:in-quotation}%
+\\end{TexinfoFloatText}
+\\end{quote}
+
+\\begin{mdframed}[style=Texinfocartouche]
+\\begin{TexinfoFloatText}
+\\caption{float in cartouche}
+
+\\label{anchor:in-cartouche}%
+\\end{TexinfoFloatText}
+\\end{mdframed}
+
+\\end{document}
+';
+
+1;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- branch master updated: * tp/Texinfo/Convert/LaTeX.pm (_push_new_context, _convert): carry formatted context over to float.,
Patrice Dumas <=