On Tue, Jul 14, 2026 at 09:35:56AM +0000, Dimitris Papavasiliou wrote:
> Hello,
> 
> When a definition produced with a `@deffn` or similar command is
> preceded by text, Texinfo doesn't add sufficient vertical spacing to
> separate the definition from the text in LaTex output.  The
> typesetting is fine in Tex or HTML output.
> 
> The attached files - the `latex.pdf` output file in particular -
> illustrate the issue.  They have been produced with the commands:
> 
> texi2any --pdf test.texi
> texi2any --latex test.texi && texi2pdf test.tex
> texi2any --html test.texi
> 
> Best regards,
> Dimitris

The space before the @deffn output appears to be the usual vertical space
between paragraphs, as you can check by splitting the paragraph in the test
file you sent.  (In fact, it looks like there is no extra space between
paragraphs.)

The texi2any --pdf output (with texinfo.tex) does appear to increase
the space before the definition.  It uses \medbreak or \medskip.

If I insert \medbreak in the output test.tex right before the @deffn output
(the 'tabularx' environment), it does look more like the texinfo.tex output.

texinfo.tex has complications to decide whether to allow a page break or
not at the space depending on what came before.

In my testing, I found \smallbreak would look better, so here's a possible
change:

diff --git a/tta/perl/Texinfo/Convert/LaTeX.pm 
b/tta/perl/Texinfo/Convert/LaTeX.pm
index d016783673..5209bcb791 100644
--- a/tta/perl/Texinfo/Convert/LaTeX.pm
+++ b/tta/perl/Texinfo/Convert/LaTeX.pm
@@ -2781,6 +2781,8 @@ sub _convert_def_line($$) {
 
     $self->{'packages'}->{'tabularx'} = 1;
     my $def_line_result = '';
+    $def_line_result .= "\\smallbreak\n";
+
     # First column (X) is as wide as possible, second column (r) is for
     # category.  @{} removes space at left side of table.
     # Without \noindent, a def* after a section beginning is indented

(This applies to git master but will probably apply without modification
to Texinfo 7.3 as well.)

Patrice, do you have an opinion on this?

I am not an expert on LaTeX so it is possible I've missed something.

There are likely other ways in which the PDF output via LaTeX is suboptimal.
Alas, having a LaTeX output converter does not solve all the issues we
had with texinfo.tex.  It's an extra level of indirection between the input
file (Texinfo) and the output file (PDF) and so we can sometimes have
less control over the exact appearance of the output.

Reply via email to