Formatting Catalogue Entries
- From: "Peter Williams" <p8mode@xxxxxxx>
- Date: 27 Feb 2006 09:12:33 -0800
Hello,
I want to create a printable catalogue of items formatted in a certain
way, which I cant seem to get LaTeX to do as I want:
I have a set of "Items" each of which is composed of a one or more
"Lines", which in turn are composed of one or more "Fields". The
document should have 2 columns, and each Item should be allocated a
paragraph. A Line is just a set of fields which should have a linebreak
on the end, to set them apart from other Lines. A Field is an atom of
information about an Item. As many Fields as will fit should be put on
a text line together, but there's no harm on using a full text line for
a single field if its too big to fit with another.
So I came up with the macros and document below. The example
illustrates several problems Im having:
(1) The field "A long field" should have started on a line of its own
since it isnt big enough to fit with the previous field ("id=453662")
on single line. Why isnt LaTeX doing this?
(2) The various fields that get put on a single line should be shoved
snuggly together (no rubber space), and what ever space is left should
be padded at the -end- of the line. This is particularly so in the 3rd
line of the output. How can I tell LaTeX to do this here (\raggedright
obviously isnt enough)?
(3) Items shouldnt get split across 2 columns (ie if there isnt enough
space to fit a complete item entry in the current column it should
start on the next coulmn). I achieved this via the \minipage. However
using \nopagebreak should have been sufficient here too according to
the author of \multicol in a differet post. Using the alternate
definitions of my macros below with \nopagebreak's instead of \minipage
didnt work however (though it did seem to solve (1) above). An Item
gets split across the bottom of the first column and top of the second
(of course youll have to copy and paste the \Item in the eg a few times
to fill up the first column).
\documentclass[oneside, 10pt, draft]{article}
\usepackage{multicol}
\usepackage[latin1]{inputenc}
\usepackage[top= 1.5cm, bottom = 1.5cm,
left = 1.5cm, right =1.5cm ]{geometry}
\pagestyle{empty}
\raggedright
%%--------------------------------------------------
\newcommand{\Item}[1] {%%
\begin{minipage}{\columnwidth}%
#1%
\end{minipage}%
\newline{}}%
%---------------
\newcommand{\Line}[1]{#1 \newline{}}
%---------------
\newcommand{\Field}[1]{\mbox{#1}}
%%--------------------------------------------------
\begin{document}
\begin{multicols*}{2}
\Item{
\Line{
\Field{id=453662,}
\Field{A long field \LaTeX{} should put on a line of its own,}
\Field{resource=AGTF,}
}
\Line{
\Field{pr1=453662,}
\Field{defn=AGTF,}
\Field{ctr=62,}
\Field{amg=A567,}
\Field{img=453izt72,}
\Field{mirror=AppTF,}
\Field{tefrt=456662,}
\Field{defn=AG45}
}
}
\end{multicols*}
\end{document}
%----------alternate definitions of Macros-----
\newcommand{\Item}[1] {%%
%\begin{minipage}{\columnwidth}%
#1 \newline{}%
%\end{minipage}%
\newline{}}%
%---------------
\newcommand{\Line}[1]{#1 \nopagebreak{}}
%---------------
\newcommand{\Field}[1]{\mbox{#1} \nopagebreak{}}
.
- Follow-Ups:
- Re: Formatting Catalogue Entries
- From: Dan Luecking
- Re: Formatting Catalogue Entries
- From: Ulrike Fischer
- Re: Formatting Catalogue Entries
- Prev by Date: Re: Bplain commands?
- Next by Date: A0 and larger paper format
- Previous by thread: .jpg's off center
- Next by thread: Re: Formatting Catalogue Entries
- Index(es):
Relevant Pages
|
|