1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-01-06 03:53:59 +02:00

Use latex sloppypar to fix monospace wrapping in PDF rendering.

Monospaced identifiers could end up running over if latex was not able to find a place to break the line. Using sloppypar forces breaks so monospaced identifiers don't run over or get broken up.

Also add vspace to admonitions so they have some separation from the prior text.
This commit is contained in:
David Steele 2021-02-10 09:10:51 -05:00
parent c7d7280fa8
commit 26cbebbda7
2 changed files with 8 additions and 7 deletions

View File

@ -110,7 +110,8 @@ my $oRenderTag =
'backrest' => [undef, ''],
'proper' => ['\textnormal{\texttt{', '}}'],
'postgres' => ['PostgreSQL', ''],
'admonition' => ["\n\\begin{leftbar}\n\\textit{\\textbf{", "}\n\\end{leftbar}\n"],
'admonition' =>
["\n\\vspace{.5em}\\begin{leftbar}\n\\begin{sloppypar}\\textit{\\textbf{", "}\\end{sloppypar}\n\\end{leftbar}\n"],
},
'html' =>

View File

@ -348,7 +348,7 @@ sub sectionProcess
# Add descriptive text
elsif ($oChild->nameGet() eq 'p')
{
$strLatex .= "\n" . $self->processText($oChild->textGet()) . "\n";
$strLatex .= "\n\\begin{sloppypar}" . $self->processText($oChild->textGet()) . "\\end{sloppypar}\n";
}
# Add option descriptive text
elsif ($oChild->nameGet() eq 'option-description')
@ -361,7 +361,7 @@ sub sectionProcess
confess &log(ERROR, "unable to find ${strOption} option in sections - try adding option?");
}
$strLatex .= "\n" . $self->processText($oDescription) . "\n";
$strLatex .= "\n\\begin{sloppypar}" . $self->processText($oDescription) . "\\end{sloppypar}\n";
}
# Add cmd descriptive text
elsif ($oChild->nameGet() eq 'cmd-description')
@ -374,7 +374,7 @@ sub sectionProcess
confess &log(ERROR, "unable to find ${strCommand} command in sections - try adding command?");
}
$strLatex .= "\n" . $self->processText($oDescription) . "\n";
$strLatex .= "\n\\begin{sloppypar}" . $self->processText($oDescription) . "\\end{sloppypar}\n";
}
# Add a list
elsif ($oChild->nameGet() eq 'list')
@ -401,9 +401,9 @@ sub sectionProcess
# Add an admonition (e.g. NOTE, WARNING, etc)
elsif ($oChild->nameGet() eq 'admonition')
{
$strLatex .= "\n\\begin{leftbar}";
$strLatex .= "\n\\textit{\\textbf{" . uc($oChild->paramGet('type')) . ": }";
$strLatex .= $self->processText($oChild->textGet()) . "}";
$strLatex .= "\n\\vspace{.5em}\\begin{leftbar}";
$strLatex .= "\n\\begin{sloppypar}\\textit{\\textbf{" . uc($oChild->paramGet('type')) . ": }";
$strLatex .= $self->processText($oChild->textGet()) . "}\\end{sloppypar}";
$strLatex .= "\n\\end{leftbar}\n";
}
# Check if the child can be processed by a parent