Re: [HACKERS] Latex longtable format

2013-01-17 Thread Bruce Momjian
On Sat, Jan 12, 2013 at 07:09:31PM -0500, Bruce Momjian wrote:
 I have received several earnest requests over the years for LaTeX
 'longtable' output, and I have just implemented it based on a sample
 LaTeX longtable output file.
 
 I have called it 'latex-longtable' and implemented all the behaviors of
 ordinary latex mode.   One feature is that in latex-longtable mode,
 'tableattr' allows control over the column widths --- that seemed to be
 very important to the users.  One requested change I made to the
 ordinary latex output was to suppress the line under the table title if
 border = 0 (default is border = 1).
 
 Patch and sample output attached.  I would like to apply this for PG
 9.3.

Modified patch applied.  I didn't need to modify our existing 'latex'
output format, except to add border=3 support.  It was tempting to
suggest renaming our 'latex' output format to 'latex-tabular', because
that is what it uses, but 'tabular' is a package included by default in
Latex, while 'longtable' requires two additional packages to be
specified, so I resisted suggesting it.  I did document that 'latex'
uses 'tabular'.

-- 
  Bruce Momjian  br...@momjian.ushttp://momjian.us
  EnterpriseDB http://enterprisedb.com

  + It's impossible for everything to be true. +


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


[HACKERS] Latex longtable format

2013-01-12 Thread Bruce Momjian
I have received several earnest requests over the years for LaTeX
'longtable' output, and I have just implemented it based on a sample
LaTeX longtable output file.

I have called it 'latex-longtable' and implemented all the behaviors of
ordinary latex mode.   One feature is that in latex-longtable mode,
'tableattr' allows control over the column widths --- that seemed to be
very important to the users.  One requested change I made to the
ordinary latex output was to suppress the line under the table title if
border = 0 (default is border = 1).

Patch and sample output attached.  I would like to apply this for PG
9.3.

-- 
  Bruce Momjian  br...@momjian.ushttp://momjian.us
  EnterpriseDB http://enterprisedb.com

  + It's impossible for everything to be true. +
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
new file mode 100644
index c41593c..932c7ca
*** a/doc/src/sgml/ref/psql-ref.sgml
--- b/doc/src/sgml/ref/psql-ref.sgml
*** lo_import 152801
*** 1979,1985 
Sets the output format to one of literalunaligned/literal,
literalaligned/literal, literalwrapped/literal,
literalhtml/literal,
!   literallatex/literal, or literaltroff-ms/literal.
Unique abbreviations are allowed.  (That would mean one letter
is enough.)
/para
--- 1979,1986 
Sets the output format to one of literalunaligned/literal,
literalaligned/literal, literalwrapped/literal,
literalhtml/literal,
!   literallatex/literal, literallatex-longtable/literal,
!   or literaltroff-ms/literal.
Unique abbreviations are allowed.  (That would mean one letter
is enough.)
/para
*** lo_import 152801
*** 2005,2016 
/para
  
para
!   The literalhtml/, literallatex/, and literaltroff-ms/
formats put out tables that are intended to
be included in documents using the respective mark-up
language. They are not complete documents! (This might not be
!   so dramatic in acronymHTML/acronym, but in applicationLaTeX/application you must
!   have a complete document wrapper.)
/para
/listitem
/varlistentry
--- 2006,2019 
/para
  
para
!   The literalhtml/, literallatex/,
!   literallatex-longtable/literal, and literaltroff-ms/
formats put out tables that are intended to
be included in documents using the respective mark-up
language. They are not complete documents! (This might not be
!   so dramatic in acronymHTML/acronym, but in
!   applicationLaTeX/application you must have a complete
!   document wrapper.)
/para
/listitem
/varlistentry
*** lo_import 152801
*** 2141,2149 
termliteraltableattr/literal (or literalT/literal)/term
listitem
para
!   Specifies attributes to be placed inside the
!   acronymHTML/acronym sgmltagtable/sgmltag tag in
!   literalhtml/ output format. This
could for example be literalcellpadding/literal or
literalbgcolor/literal. Note that you probably don't want
to specify literalborder/literal here, as that is already
--- 2144,2151 
termliteraltableattr/literal (or literalT/literal)/term
listitem
para
!   In acronymHTML/acronym format, this specifies attributes
!   to be placed inside the sgmltagtable/sgmltag tag.  This
could for example be literalcellpadding/literal or
literalbgcolor/literal. Note that you probably don't want
to specify literalborder/literal here, as that is already
*** lo_import 152801
*** 2152,2157 
--- 2154,2165 
replaceable class=parametervalue/replaceable is given,
the table attributes are unset.
/para
+   para
+   In acronymlatex-longtable/acronym format, this controls
+   the proportional width of each column.  It is specified as a
+   space-separated list of values, e.g. literal'0.2 0.2 0.6'/.
+   Unspecified output columns will use the last specified value.
+   /para
/listitem
/varlistentry
  
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
new file mode 100644
index 59f8b03..740884f
*** a/src/bin/psql/command.c
--- b/src/bin/psql/command.c
*** _align2string(enum printFormat in)
*** 2164,2169 
--- 2164,2172 
  		case PRINT_LATEX:
  			return latex;
  			break;
+ 		case PRINT_LATEX_LONGTABLE:
+ 			return latex-longtable;
+ 			break;
  		case PRINT_TROFF_MS:
  			return troff-ms;
  			break;
*** do_pset(const char *param, const char *v