[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: no @image at start of paragraph
From: |
Gavin Smith |
Subject: |
Re: no @image at start of paragraph |
Date: |
Thu, 17 Dec 2015 20:45:05 +0000 |
On 17 December 2015 at 19:08, Per Bothner <address@hidden> wrote:
> The texinfo manual states that an @image can be in "anywhere, including
> the middle of a paragraph". However, makeinfo 6.0 doesn't allow @image to
> begin
> a paragraph.
>
> For example:
>
> @image{screenshot-1}
> This image shows xyz.
>
> or even:
>
> @image{screenshot-1}This image shows xyz.
>
> Is treated the same as:
>
> @image{screenshot-1}
>
> This image shows xyz.
>
> I.e. the same as if the @image were followed by a blank line.
>
> Hence in the generated html the resulting <img> is *before* the <p>,
> not inside it. The same problem happens with --docbook.
>
> I worked around it with empty dummy text:
>
> @emph{}
> @image{screenshot-1}
> This image shows xyz.
>
> Is there a better work-around? Is this a texinfo bug?
I couldn't find a better workaround. I think that @indent or @noindent
should do it:
@noindent @image{screenshot-1}
This image shows xyz.
But this doesn't actually work at the present. I think that this would
be nice because @noindent switches from vertical mode into horizontal
mode in TeX, which is like starting a paragraph in HTML.
Here's a patch that I'll probably apply to make @indent and @noindent
start a paragraph if needed:
Index: tp/Texinfo/Parser.pm
===================================================================
--- tp/Texinfo/Parser.pm (revision 6666)
+++ tp/Texinfo/Parser.pm (working copy)
@@ -340,6 +340,8 @@ foreach my $no_paragraph_command (keys(%misc_comma
$default_no_paragraph_commands{$no_paragraph_command} = 1;
$begin_line_commands{$no_paragraph_command} = 1;
}
+delete $default_no_paragraph_commands{'indent'};
+delete $default_no_paragraph_commands{'noindent'};
# verbatiminclude is not said to begin at the beginning of the line
# in the manual
>
> Having the image at the start of the paragraph enables floating images
> with with css rules like:
>
> img { float: right }
> p { overflow: auto}
>
I think it's best not to start a paragraph for @image to give the
document author the option of having the image outside of a paragraph.