Graphics, Figures & TablesAutomatic Generation of a Table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
Uchman
Posts: 6
Joined: Thu Feb 16, 2012 11:18 am

Automatic Generation of a Table

Post by Uchman »

Hi!

I am trying to typeset a small document to help me with the creation of archives. I want to create a number of title cards to put on the fronts of the folders, and then, using the same data, make a list of all the folders.

So far, I used the mailmerge package and two separate files --- one for the cards, the other for the list, but since there are sometimes a lot of corrections to be made to the titles, it becomes quite cumbersome. Moreover, some people from other departments, who are not LaTeX-literary, asked me to show them how to use it, so I want to keep it as simple as possible.

I have been trying with the formlett package, because it has an organised structure of the input, but I cannot seem to make it print the table. All I get is the first page of
Minimal.pdf
(41.8 KiB) Downloaded 162 times
, when it should look like
Spis teczek 2002 .pdf
(40.39 KiB) Downloaded 183 times
.

Here is the actual code (sorry for the bulkiness):

Code: Select all

Code, edit and compile here:
\documentclass[a4paper,12pt,draft]{article}
\usepackage[polish]{babel}
\usepackage[OT1,OT4]{fontenc}
\usepackage{xltxtra}
\usepackage{paralist}
\usepackage{tabularx}
%\usepackage{supertabular}
\usepackage{formlett}
\usepackage{longtable}
\usepackage[left=1.5cm,right=1.5cm,top=2cm,bottom=2cm]{geometry}
\setmainfont[Mapping=tex-text]{%
%Times New Roman}
%Gill Sans MT}
Arial}
\sloppy
\pagestyle{plain}
\makeatletter
\renewcommand{\@evenfoot}{\hfill\thepage/\pageref{LastPage}\hfill}
\renewcommand{\@oddfoot}{\@evenfoot}
\makeatother
\newcounter{Numer}
\newcounter{Teczki}
\def\urzad{Urząd Gminy i~Miasta Dobczyce}
\def\referat{Referat Inwestycji, Rolnictwa i~Gospodarki Komunalnej}
\def\tworca{Joanna Mus}
\begin{document}
\beginletter%---------------------------------- This part is responsible for title cards, and it works
\NOPAGENUMBERS\parindent=0pt
{\centering\bf\urzad\\\vspace{3mm}
\centering\referat\\\normalfont}
\vspace{2cm}
{\bf Znak:} \paras[1]\hfill {\bf Kat. akt:} \paras[2]
\vspace{2cm}
%\setlength{\floatsep}{0pt}
{\centering\large\bf \paras[3]\\}
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
I will be grateful for any suggestions...
Attachments
Minimal.tex
MWE
(3.46 KiB) Downloaded 147 times
Uchman

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Automatic Generation of a Table

Post by Stefan Kottwitz »

Hi Witold,

I guess the letter environment is a problem here, and putting ampersand symbols for separating the table columns into an environment. Removing \beginletter and \endletter would make the table row visible, if you also add an \item for the compactitem environment.

Stefan
LaTeX.org admin
Uchman
Posts: 6
Joined: Thu Feb 16, 2012 11:18 am

Automatic Generation of a Table

Post by Uchman »

Hi, Stefan,

Yes, there is something in formlett.sty that says

Code: Select all

\def\readarray#1#2{\read@array[&]{#1}{#2}}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
--- maybe that is the problem?

But, you know, funnily enough, if you try

Code: Select all

Code, edit and compile here:
\beginletter%---------------------------------- The problem lies somewhere from here...
\newcolumntype{C}{>{\centering}p{1cm}}%
\begin{longtable}{|r|c|m{5cm}|C|C|C|m{1.5cm}|m{1.5cm}|}\hline
\centering\textbf{LP} &\textbf{Znak teczki} &\centering\textbf{Tytuł teczki/tomu} &\textbf{Daty skrajne} &\textbf{Kate\-goria akt} &\textbf{Liczba teczek} &\centering\textbf{Miejsce przechowywania akt w~składnicy} &\centering\textbf{Data zniszczenia lub przekazania do~arch. państwowego}\\\tabularnewline\hline%\endhead
\stepcounter{Numer}\arabic{Numer} &\paras[1] &\textbf{\paras[3]}\par\begin{compactitem}\paras[4]\end{compactitem} &\paras[1][3] \checkparas[2][3]{LET}\iftrue \ifemptyparas \paras[1][3] \else \paras[2][3] \fi &\paras[2] &\checkparas[2][2]{LET}\iftrue \ifemptyparas 1\stepcounter{Teczki} \else \cachedata\addtocounter{Teczki}{\cachedata} \fi &&\tabularnewline\hline
\end{longtable}\endletter%---------------------------------- ... to here.
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
, that is wrap the table inside the letter environment, it works (well, sort of):
1.pdf
(41.04 KiB) Downloaded 231 times
. Maybe if I tried to put the table row by row...
Uchman
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Automatic Generation of a Table

Post by Stefan Kottwitz »

Yes, if you use the table within the letter environment, it can directly see the ampersands. However, within the letter environment there's no need for a longtable I guess, a normal tabular environment would work.

Stefan
LaTeX.org admin
Uchman
Posts: 6
Joined: Thu Feb 16, 2012 11:18 am

Automatic Generation of a Table

Post by Uchman »

Yes, if you use the table within the letter environment, it can directly see the ampersands.
The problem is, however, that it produces a new table for each instance in the database, and that is not acceptable by the archiving standards. It has to be a single table, just like I included previously (Spis teczek.pdf).
I guess, a normal tabular environment would work.
Well, for a single year, we can reach anything up to 20--25 folders, I had better be on the safe side...

Anyway, I am still trying, and if something works, I will post the solution.
Uchman
Post Reply