Search Postgresql Archives

Re: psql latex and newlines

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




> -----Original Message-----
> From: pgsql-general-owner@xxxxxxxxxxxxxx
> [mailto:pgsql-general-owner@xxxxxxxxxxxxxx] On Behalf Of Wim Bertels
> Sent: Friday, 24 February 2012 2:46 AM
> To: Bruce Momjian
> Cc: pgsql-general@xxxxxxxxxxxxxx
> Subject: Re:  psql latex and newlines
>
> > > > > the problem arises when u have a field value that
> contains a newline
> > > > > character, when this field is not the first column,
> then all the data
> > > > > after this newline comes in the first column..
> > > > >
> > > > > u can try this out, writing a function or table,
> > > > > and then add 'enters' or newline in the COMMENT on
> this function or
> > > > > table.
> > > > >
>
> > >
> > > There is also a problem with long lines as u can test by
> uncommenting
> > > the t4bruce3 function.
> >
> > Well, I was hoping you could tell me exactly how you wanted
> the behavior
> > changed and I could try to implement it in psql.  I am
> afraid I don't
> > know enough about TeX to understand the isssue involved.
> >
>
> Hi Bruce,
>
> the option i came across is the usage of \pbox,
> so the suggestion would be to put every field/cell inside a pbox.
>
> Instead of
> \begin{tabular}{l | l | l}
> \textit{Schema} & \textit{Name} & \textit{Description} \\
> \hline
> latex\_test & t4bruce1 & This function and so on enter\\
> another enter,\
> \ just one more.\\ \\
> latex\_test & t4bruce2 & This function and so on enter\\
> another enter,\
> \ just one more,\\ so now have even one more.\\ \\
> \end{tabular}
>
> the generated code could like:
> \begin{tabular}{l | l | l}
> \textit{Schema} & \textit{Name} & \textit{Description} \\
> \hline
> \pbox{\textwidth}{latex\_test} & \pbox{\textwidth}{t4bruce1} &
> \pbox{\textwidth}{This function and so on enter\\ another
> enter,\\ just
> one more.\\} \\
> \pbox{\textwidth}{latex\_test} & \pbox{\textwidth}{t4bruce2} &
> \pbox{\textwidth}{This function and so on enter\\ another
> enter,\\ just
> one more,\\ so now have even one more.\\} \\
> \end{tabular}
>
> Comments:
> - the improvement is that now newlines inside boxes stay inside these
> boxes (or cells/fields), it is not a complete solution as very long
> lines are not automatically formatted into several lines inside a box,
> but if necessary the db-user can do a a search and replace in the
> generated tex code s\textwidth\20cm for example, makes every
> box 20cm at
> maximum. (maybe to be put in the docu somewhere as a comment on
> textwidth). This all depends on the page format,
> unfortunately (for now?
> in latex) the nice (p)aragraph formatting doesn't fully
> extend inside a
> table (cf tabular)
> - i'm not a tex specialist, but also the people i know didn't find a
> better solution
>
> mvg,
> Wim
>

My 2 cents worth is I would like to see the booktabs and longtable environments used to handle pages covering multiple pages. I have attached a zip containg a pdf of the different versions, the LaTex source.
The example is recast and extracted here:

Allan

\begin{longtable}{p{0.3\textwidth}p{0.3\textwidth}p{0.3\textwidth}}
\toprule
\centering{\small\textbf{\textit{Schema}}} & \small\textbf{\textit{Name}} & \small\textbf{\textit{Description}} \\
\midrule \\
\endfirsthead
\toprule
\centering{\small\textbf{\textit{Schema}}} & \small\textbf{\textit{Name}} & \small\textbf{\textit{Description}} \\
\midrule \\
\endhead

\bottomrule \\
\caption[List of Tables Entry. (Continued)]{Bottom Caption.}
\endfoot

\bottomrule \\
\caption[List of Tables Entry.]{Bottom Caption.}
\endlastfoot

% Table Entries
\raggedright{latex\_test}
&
\raggedright{t4bruce1}
&
\raggedright{This function and so on enter \\ another enter,\\ just one more.} \tabularnewline \\

\raggedright{latex\_test}
&
\raggedright{t4bruce1}
&
\raggedright{This function and so on enter \\ another enter,\\ just one more,\\ so now have even one more.} \tabularnewline \\

\end{longtable}


The material contained in this email may be confidential, privileged or copyrighted. If you are not the intended recipient, use, disclosure or copying of this information is prohibited. If you have received this document in error, please advise the sender and delete the document. Neither OneSteel nor the sender accept responsibility for any viruses contained in this email or any attachments.

<<attachment: psqlTeXtables.zip>>

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux