<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Correcting Poor Formatting</title><link rel="stylesheet" type="text/css" href="manual.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><link rel="home" href="index.html" title="DocBook to LaTeX Publishing" /><link rel="up" href="ch03.html" title="Chapter 3. Using dblatex" /><link rel="prev" href="sec-table.html" title="Creating Tables" /><link rel="next" href="ch03s10.html" title="Writing Mathematics" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Correcting Poor Formatting</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="sec-table.html">Prev</a> </td><th width="60%" align="center">Chapter 3. Using dblatex</th><td width="20%" align="right"> <a accesskey="n" href="ch03s10.html">Next</a></td></tr></table><hr /></div><div class="section" title="Correcting Poor Formatting"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="idp4801464"></a>Correcting Poor Formatting</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="ch03s09.html#idp315120">Floats</a></span></dt><dt><span class="section"><a href="ch03s09.html#idp841104">Tables</a></span></dt><dt><span class="section"><a href="ch03s09.html#idp3438080">Examples</a></span></dt><dt><span class="section"><a href="ch03s09.html#idp9349808">Hyphenation and over-long lines</a></span></dt><dt><span class="section"><a href="ch03s09.html#idp6653856">Characters and Manual Spacing</a></span></dt></dl></div><p>LaTeX does not invariably produce good looking output. To
remedy this it can sometimes be useful to guide LaTeX in the
formatting of individual characters, words, sentences, and pages.
It is best to adjust with caution, making adjustments only to fix
specific problems and limiting adjustments to the affected
area.</p><div class="tip" title="Tip" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Tip</h3><p>Adjustments to formatting are best done late in the
production process so that subsequent changes to content do not
produce new problems.</p></div><p>This section provides an overview of common problems and
summarizes methods which may be used to resolve issues related to
formatting. Much more detail can be found in the <a class="xref" href="sec-custom.html" title="Chapter 4. Customization">Chapter 4, <em>Customization</em></a> chapter and the <a class="xref" href="sec-params.html" title="Appendix A. Dblatex XSL Parameter Reference">Appendix A, <em>Dblatex XSL Parameter Reference</em></a>
and <a class="xref" href="sec-pis.html" title="Appendix B. Dblatex Processing Instruction Reference">Appendix B, <em>Dblatex Processing Instruction Reference</em></a> appendixes. Be sure to look through
these, especially the appendixes, to see whether there is an
adjustment which will solve your particular problem. Of course the
DocBook documentation should also be consulted to see if a DocBook
attribute can be used to adjust document presentation.</p><div class="section" title="Floats"><div class="titlepage"><div><div><h3 class="title"><a id="idp315120"></a>Floats</h3></div></div></div><p>Floats are figures, tables, examples, images, and so forth
which do not necessarily appear in the output document in the
location in which they appear in the DocBook source. The
placement of floats can result in visually poor or otherwise
undesirable output.</p><p>One direct approach is to use the <span class="quote">“<span class="quote">informal</span>”</span>
versions of the affected DocBook elements. E.g. use
<code class="sgmltag-element">informaltable</code> instead of
<code class="sgmltag-element">table</code>. The <span class="quote">“<span class="quote">informal</span>”</span> elements do
not float. Bear in mind though that <span class="quote">“<span class="quote">informal</span>”</span>
elements do not appear in the table of contents.</p><p>The alternative to eliminating the float entirely is
to make an adjustment by parameter, attributes, or processing
instruction. For figure, example, and equation, you can play
with these methods:</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>In a specific element, use the
<code class="sgmltag-element">floatstyle</code> attribute to
specify the latex float placement policy. For example
<code class="literal">'[H]'</code> tries to place the element where it is
declared.</p></li><li class="listitem"><p>Use the parameter
<code class="literal"><em class="replaceable"><code>element</code></em>.defaut.position</code>
to specify globaly the placement policy for this element.</p></li></ul></div><p>Look at page <a class="xref" href="table.default.position.html#float-placement-choices"></a> for more details
about the meaning of the placement choice letters.</p></div><div class="section" title="Tables"><div class="titlepage"><div><div><h3 class="title"><a id="idp841104"></a>Tables</h3></div></div></div><p>Placement problems with tables relate to their
classification as a float. For resolution regarding these issues
see the section on floats above.</p><p>Tables exceeding the length of a page, or tables that
otherwise need to cross page boundaries, have special
requirements. They must not be floats and must be rendered using
the LaTeX <span class="package">longtable</span> environment. Among the
available controls are: use of a <code class="sgmltag-element">informaltable</code>
element in place of a <code class="sgmltag-element">table</code> element, the
<code class="sgmltag-element">table</code> element's <code class="sgmltag-element">tabstyle</code>
attribute, the <em class="parameter"><code>table.default.tabstyle</code></em> parameter,
the <em class="parameter"><code>table.in.float</code></em> parameter.</p><p>It is worth mentioning that good typesetting design practice
for tables generally calls for eliminating all vertical rules (the
lines between columns) and most horizontal rules.</p><p>Better vertical placement of
table horizontal rules can be obtained by providing values for
the <em class="parameter"><code>newtbl.format.thead</code></em> and
<em class="parameter"><code>newtbl.format.tbody</code></em> parameters. Depending on the
font in use, a value like
<code class="literal">\rule{0pt}{2.6ex}\rule[-0.9ex]{0pt}{0pt}</code> can be
used for both parameters. This inserts a
<em class="wordasword">strut</em>, a 0 width character, in each row
of the table which <span class="quote">“<span class="quote">pushes</span>”</span> the horizontal rules
upwards and downwards to provide adequate vertical spacing.</p></div><div class="section" title="Examples"><div class="titlepage"><div><div><h3 class="title"><a id="idp3438080"></a>Examples</h3></div></div></div><p>Placement of examples has the same issue than tables, that is, it
is an element that can contain many materials and need to split over
several pages. In this case it cannot be considered as a float.</p><p>To avoid an example floating and to allow it cover several
pages, set the parameter <em class="parameter"><code>example.float.type</code></em>
to <code class="literal">none</code>.</p></div><div class="section" title="Hyphenation and over-long lines"><div class="titlepage"><div><div><h3 class="title"><a id="idp9349808"></a>Hyphenation and over-long lines</h3></div></div></div><p>LaTeX is generally very good at hyphenation, but this
applies only to actual words. Technical writing may include long
character sequences that are not actual words. Hyphenation
failure will typically result in lines of text that flow past the
expected right-hand edge of a line. In LaTeX terminology this is
known as a <span class="quote">“<span class="quote">overfull hbox</span>”</span>.</p><p>The <em class="parameter"><code>hyphenation.format</code></em> parameter can
be helpful to flag some formats for more agressive
hyphenation.</p><p>Various adjustments can be made with the
<code class="sgmltag-xmlpi"><?latex?></code> processing instruction to
add raw latex directives and eliminate
overfull hboxes but it often makes sense to address hyphenation
problems directly. This can be done either on an ad-hoc basis,
telling LaTeX how to hyphenate specific occurrences of words where
a problem exists, or by telling LaTeX how to hyphenate words it
does not know. The first method is accomplished by inserting
<span class="quote">“<span class="quote">soft hyphens</span>”</span> into words in your DocBook source
using the <a class="xref" href="pi-latex.html" title="latex"><span class="refentrytitle">latex</span></a> processing instruction. This is
described in the <a class="xref" href="pi-latex.html#sec-safe-latex" title="Safe LaTeX Insertions">the section called “Safe LaTeX Insertions”</a> section.</p><p>To educate LaTeX as to how to hyphenate your special
vocabulary a custom LaTeX style is required. Setting this up is
described in the <a class="xref" href="sec-custom-latex.html" title="Customized LaTeX style">the section called “Customized LaTeX style”</a> section. The
LaTeX command to use is <code class="code">\hyphenation</code>. For example
<code class="code">\hyphenation{PostgreSQL trans-mog-re-fi-ca-tion}</code>
tells LaTeX that <em class="wordasword">PostgreSQL</em> should not be
hyphenated and where to hyphenate
<em class="wordasword">transmogrification</em>.</p><p>Finally, long URLs can cause over-long lines. Especially in
footnotes. Using the LaTeX <span class="package">breakurl</span> package is
one way to solve this. This can be done with a custom latex
stylesheet. See <a class="xref" href="sec-custom-latex.html" title="Customized LaTeX style">the section called “Customized LaTeX style”</a>.</p></div><div class="section" title="Characters and Manual Spacing"><div class="titlepage"><div><div><h3 class="title"><a id="idp6653856"></a>Characters and Manual Spacing</h3></div></div></div><p>The <code class="sgmltag-xmlpi"><?latex?></code> processing instruction
may be used to limit character kerning, the joining of pairs of
characters.</p><p>The following DocBook entity declarations can be useful to
control spacing. These may be declared in your DocBook
<code class="code">DTD</code> within the trailing pair of square braces
(<code class="literal">[]</code>) or elsewhere. Once declared the entities
may be used in your document text. E.g.
<code class="literal">Von&nbsp;Trapp</code> puts a non-breaking space
between <code class="literal">Von</code> and <code class="literal">Trapp</code>,
ensuring that these two words will not appear on separate
lines.</p><pre class="programlisting">
<!ENTITY nbsp "&#x000A0;" >
<!ENTITY ensp "&#x02002;" >
<!ENTITY emsp "&#x02003;" >
</pre></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="sec-table.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch03.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch03s10.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Creating Tables </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Writing Mathematics</td></tr></table></div></body></html>