General ⇒ \DTLpar height
\DTLpar height
Using the datatool package, the template for a booklet I produce weekly for my wife is now able to look up the data file and pick the correct collect for any given date. That is all working well.
Such collects are usually are formatted with line-breaks to make them easy to read in short phrases. After trying several different suggestions as to how to create such line-breaks within the field, the only one that I could get to work for me was the command \DTLpar from datatool. This breaks the line without truncating the rest of the field. All that remains for me is to go through each collect, breaking it up into short phrases, each phrase ending with "\DTLpar". Though a little clumsy, it works fine.
When read into the booklet, they looks like normal line-breaks. However, \DTLpar is not governed by the line spacing that regulates the rest of the LaTeX document. The \DTLpar spacing appears to be fixed as 1.5 or double spacing. I would prefer to have single spacing, or less of a gap between the lines of the collect. I see nothing about that in the datatool manual, and I could not find any reference to it outside the manual.
Is there a way that I could reduce the default line-spacing produced by \DTLpar?
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- Ijon Tichy
- Posts: 640
- Joined: Mon Dec 24, 2018 10:12 am
\DTLpar height

\DTLpar
is defined as Code: Select all
\DeclareRobustCommand{\DTLpar}{\par}
\parindent
, \parskip
and \parfillskip
. You can either change these lengths or redefine \DTLpar
(again using \DeclareRobustCommand
) to add positive or negative vertical space.
\DTLpar height
\DTLpar height
In the preamble, I added:
\DeclareRobustCommand{\DTLpar}{\par}
In the page, I have put:
{
\setlength{\parskip}{0\baselineskip plus 2pt}
\newcommand{\pubcoll}{\bliadhna-\mios-\latha}
\DTLfetch{goirid}{soy}{\pubcoll}{collect}
}
That did exactly what I wanted. Thank you.
However, I am curious about what the syntax might be to use \DeclareRobustCommand instead of \setlength{\parskip}.
Thanks, again for solving this for me.
Calum
- Ijon Tichy
- Posts: 640
- Joined: Mon Dec 24, 2018 10:12 am
\DTLpar height
\DeclareRobustCommand{\DTLpar}{\par}
, because it is the default.
\DTLpar height
\DeclareRobustCommand{\DTLpar}{\par}
, as I note that it is not required.