Jason Lewis
2004-01-14 06:33:46 UTC
Hi,
I am using Template Toolkit an LaTeX to write a product catalogue for my
business. The LaTeX for my document is all generated from a database using
Template Toolkit.
For an idea of how I want to lay out my catalogue, see the text at the end of
this message.
The problem I am having is getting all the text to line up exactly how I want
it. I have tried many different ways of laying out including minipages,
floatflt, wrapfigure and probably a few others. None of them was able to give
me perfect results but wrapfigure seems to come closest.
The problem i get is when I have a short section, wrapfigure puts my image
about 1-2 sections later, rather than in the short section, making the short
section longer. Thats probably what it was designed to do, but its not the
behaviour I am after.
Is there a way to force wrapfigure to put the image between 2 points of a
document? ie, "this image must be placed between point A and point B" or
something?
Or, is there a better way of flowing text around the image that I should be
aware of? I am willing to compromise and, say, assign a column on the left
hand side of my document that would only have floating images in it, and put
captions on them, but I couldnt work out how to do that either.
Here is a sample of my code currently:
\subsection{Norfolk Punch - Sauces and Relishes}
\begin{wrapfigure}{r}{0pt}
\includegraphics[width=3cm,height=3cm,keepaspectratio=true]{/tmp/LaTeXCatalogueSymlinks/_mnt_ot_images_Norfolk_Punch_Norfolk_Punch_Relishes_and_Sauces_20030514_no_background.jpg}
\end{wrapfigure}
Cu?ious Relish
Has a gentle heat and bite of mild chilli and the smoothness of liquorice
root. Add to rice, soups and stir frys.
St Georges Dragon's Breath Sauce
A warm and spicy sauce containing chilli, ginger, tomato, garlic, cloves, and
dragons blood (spice imported from China which gives the red tinge to this sauce)
\begin{longtable}[l]{p{7cm}|l|r|l|r@{.}l|l|l|l|l|l|l|l|l|l|l|l|l|l} \hline
St Geo Dragon Breath Sauce 150ml & & 24 & 9011302 & 3 & 60 & & & & & & &
& & & & & \\ \hline
Cur?ous Relish 250ml & & 24 & 9011303 & 3 & 50 & & & & & & &
& & & & & \\ \hline
\end{longtable}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% this section includes images by the minipage method
% this one tries to put all of the section in the minipage
\subsection{Condiments}
.
.
.
etc....
And here is the layout I am trying to acheive.....
1.3.4 Product Listing
ducts and aThis is a list of oducts and a descrip -------------------------
a descriptilist of my product a description of th | |
ption of thmy products and a iption of them. This | |
m. This is and a description em. This is a lis to | |
s is a listdescription of theis is a list of my p | an included image |
of my produof them. This is a of my products and | |
ducts and aThis is a list of oducts and a descrip | |
a descriptilist of my product a description of th | |
on of them.products and a desion of them. This is ------------------------
his is a lia description of tThis is a list of my products and a description
of my produof them. This is a of my products and a description of them. This
and a descis a list of my prs and a description of them.
this is a longtable
Product1 3.50 | | | | | | | | | | | |
Product2 3.50 | | | | | | | | | | | |
Product3 3.50 | | | | | | | | | | | |
Product4 3.50 | | | | | | | | | | | |
Product5 3.50 | | | | | | | | | | | |
Product6 3.50 | | | | | | | | | | | |
Product7 3.50 | | | | | | | | | | | |
Product8 3.50 | | | | | | | | | | | |
Product9 3.50 | | | | | | | | | | | |
and when its a short bit of text.....
1.3.4 Product Listing
ducts and aThis is a list of mydts and a descrip -------------------------
a descriptilist of my products aescription of th | |
ption of thmy products and a depon of them. This | |
m. This is and a description ofmThis is a lis to | |
| an included image |
this is a longtable | |
Product1 3.50 | | | | | | | | | | | | | |
Product2 3.50 | | | | | | | | | | | | | |
Product3 3.50 | | | | | | | | | | | | ------------------------
Product4 3.50 | | | | | | | | | | | |
Product5 3.50 | | | | | | | | | | | |
Product6 3.50 | | | | | | | | | | | |
Product7 3.50 | | | | | | | | | | | |
Product8 3.50 | | | | | | | | | | | |
Product9 3.50 | | | | | | | | | | | |
But sometimes, i only have 1 or 2 lines in my longtable, so i would like the
following behaviour in that situation
1.3.4 Product Listing
ducts and aThis is a list of my cts and a descrip -------------------------
a descriptilist of my products adescription of th | |
ption of thmy products and a desion of them. This | |
m. This is and a description of This is a lis to | |
| an included image |
this is a longtable | |
Product1 3.50 | | | | | | | | | | | | | |
| |
| |
| |
| |
| |
------------------------
1.3.5 Next Section starts below Image
This is the next section. This is the next section.
This is the next section. This is the next section.
This is the next section. This is the next section.
This is the next section.
Any suggestions would be greatly appreciated.
Thanks,
Jason
PS. I am looking for a workable solution - I'm happy to do things differently
if it will make it easier. Im just really stuck on this.
Jason
I am using Template Toolkit an LaTeX to write a product catalogue for my
business. The LaTeX for my document is all generated from a database using
Template Toolkit.
For an idea of how I want to lay out my catalogue, see the text at the end of
this message.
The problem I am having is getting all the text to line up exactly how I want
it. I have tried many different ways of laying out including minipages,
floatflt, wrapfigure and probably a few others. None of them was able to give
me perfect results but wrapfigure seems to come closest.
The problem i get is when I have a short section, wrapfigure puts my image
about 1-2 sections later, rather than in the short section, making the short
section longer. Thats probably what it was designed to do, but its not the
behaviour I am after.
Is there a way to force wrapfigure to put the image between 2 points of a
document? ie, "this image must be placed between point A and point B" or
something?
Or, is there a better way of flowing text around the image that I should be
aware of? I am willing to compromise and, say, assign a column on the left
hand side of my document that would only have floating images in it, and put
captions on them, but I couldnt work out how to do that either.
Here is a sample of my code currently:
\subsection{Norfolk Punch - Sauces and Relishes}
\begin{wrapfigure}{r}{0pt}
\includegraphics[width=3cm,height=3cm,keepaspectratio=true]{/tmp/LaTeXCatalogueSymlinks/_mnt_ot_images_Norfolk_Punch_Norfolk_Punch_Relishes_and_Sauces_20030514_no_background.jpg}
\end{wrapfigure}
Cu?ious Relish
Has a gentle heat and bite of mild chilli and the smoothness of liquorice
root. Add to rice, soups and stir frys.
St Georges Dragon's Breath Sauce
A warm and spicy sauce containing chilli, ginger, tomato, garlic, cloves, and
dragons blood (spice imported from China which gives the red tinge to this sauce)
\begin{longtable}[l]{p{7cm}|l|r|l|r@{.}l|l|l|l|l|l|l|l|l|l|l|l|l|l} \hline
St Geo Dragon Breath Sauce 150ml & & 24 & 9011302 & 3 & 60 & & & & & & &
& & & & & \\ \hline
Cur?ous Relish 250ml & & 24 & 9011303 & 3 & 50 & & & & & & &
& & & & & \\ \hline
\end{longtable}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% this section includes images by the minipage method
% this one tries to put all of the section in the minipage
\subsection{Condiments}
.
.
.
etc....
And here is the layout I am trying to acheive.....
1.3.4 Product Listing
ducts and aThis is a list of oducts and a descrip -------------------------
a descriptilist of my product a description of th | |
ption of thmy products and a iption of them. This | |
m. This is and a description em. This is a lis to | |
s is a listdescription of theis is a list of my p | an included image |
of my produof them. This is a of my products and | |
ducts and aThis is a list of oducts and a descrip | |
a descriptilist of my product a description of th | |
on of them.products and a desion of them. This is ------------------------
his is a lia description of tThis is a list of my products and a description
of my produof them. This is a of my products and a description of them. This
and a descis a list of my prs and a description of them.
this is a longtable
Product1 3.50 | | | | | | | | | | | |
Product2 3.50 | | | | | | | | | | | |
Product3 3.50 | | | | | | | | | | | |
Product4 3.50 | | | | | | | | | | | |
Product5 3.50 | | | | | | | | | | | |
Product6 3.50 | | | | | | | | | | | |
Product7 3.50 | | | | | | | | | | | |
Product8 3.50 | | | | | | | | | | | |
Product9 3.50 | | | | | | | | | | | |
and when its a short bit of text.....
1.3.4 Product Listing
ducts and aThis is a list of mydts and a descrip -------------------------
a descriptilist of my products aescription of th | |
ption of thmy products and a depon of them. This | |
m. This is and a description ofmThis is a lis to | |
| an included image |
this is a longtable | |
Product1 3.50 | | | | | | | | | | | | | |
Product2 3.50 | | | | | | | | | | | | | |
Product3 3.50 | | | | | | | | | | | | ------------------------
Product4 3.50 | | | | | | | | | | | |
Product5 3.50 | | | | | | | | | | | |
Product6 3.50 | | | | | | | | | | | |
Product7 3.50 | | | | | | | | | | | |
Product8 3.50 | | | | | | | | | | | |
Product9 3.50 | | | | | | | | | | | |
But sometimes, i only have 1 or 2 lines in my longtable, so i would like the
following behaviour in that situation
1.3.4 Product Listing
ducts and aThis is a list of my cts and a descrip -------------------------
a descriptilist of my products adescription of th | |
ption of thmy products and a desion of them. This | |
m. This is and a description of This is a lis to | |
| an included image |
this is a longtable | |
Product1 3.50 | | | | | | | | | | | | | |
| |
| |
| |
| |
| |
------------------------
1.3.5 Next Section starts below Image
This is the next section. This is the next section.
This is the next section. This is the next section.
This is the next section. This is the next section.
This is the next section.
Any suggestions would be greatly appreciated.
Thanks,
Jason
PS. I am looking for a workable solution - I'm happy to do things differently
if it will make it easier. Im just really stuck on this.
Jason