# Contents of /csv2latex.1

Revision 61 - (show annotations)
Mon Jul 2 21:34:22 2018 UTC (2 years, 2 months ago) by ben
File size: 8060 byte(s)
```fix manpage
```
 1 .TH "CSV2LATEX" "1" 2 .SH "NAME" 3 csv2latex \(em convert a csv file into a LaTeX document 4 .SH "SYNOPSIS" 5 .PP 6 \fBcsv2latex\fR [\fB\-\-nohead\fP] [\fB\-\-longtable\fP] [\fB\-\-noescape\fP] [\fB\-\-guess\fP] [\fB\-\-separator \fIc\fR|\fIs\fR|\fIt\fR|\fIp\fR|\fIl\fR\fP] [\fB\-\-block \fIq\fR|\fId\fR|\fIn\fR\fP] [\fB\-\-lines \fI#\fR\fP] [\fB\-\-position \fIl\fR|\fIc\fR|\fIr\fR\fP] [\fB\-\-colorrows \fI0-1\fR\fP] [\fB\-\-reduce \fI1\fR|\fI2\fR|\fI3\fR|\fI4\fR\fP] [\fB\-\-repeatheader\fP] [\fB\-\-nohlines\fP] [\fB\-\-novlines\fP] [\fB\-\-landscape\fP] [\fB\-\-font \fI#\fR\fP] [file] 7 .SH "DESCRIPTION" 8 .PP 9 This manual page documents the \fBcsv2latex\fR program. 10 .PP 11 \fBcsv2latex\fR is a program that reads a "comma separated values" (csv) file 12 and outputs a LaTeX file with one or more tabular environments to display 13 the printable values of the csv file. The LaTeX code is flushed on the standard output. 14 15 .PP 16 So-called "comma separated values" files are common formats for exchanging two-dimensinal 17 tables between programs such as spreadsheets editors, to represent almost any kind of data. 18 By default, a csv file is made of printable data separated by commas (`,'), each comma 19 representing a `cell' separator, and each line representing a row. By extension, cell 20 separators can be represented by tabs if the comma is considered as printable data. 21 Moreover, some non true csv files can be assumed as two-dimensional tables as well. 22 In some circumstances, if the printable data includes the cell separator of the 23 exchange format, the latter can use a second extra character to embrace the printable 24 data into a block (e.g: quoted text). Thus, it is still possible to parse the file by 25 using the block delimiter (used twice to embrace the cell) instead of the separator. 26 27 .PP 28 \fBcsv2latex\fR aims to parse various csv formats plus formats that fits 29 into the above definiton, assuming the data is text, and to produce a yet simple LaTeX file 30 using the "tabular" environment for a table-style layout. 31 Some options of output will also use macros provided by extra 32 LaTeX packages that are commonly included in the main LaTeX distributions. 33 34 .SH "OPTIONS" 35 .PP 36 This program follows the usual GNU command line syntax, 37 with long options starting with two dashes (`\-'). A summary of 38 options is included below. 39 .IP "\fB-h\fP \fB\-\-help\fP " 10 40 Show summary of options. 41 .IP "\fB-v\fP \fB\-\-version\fP " 10 42 Show version of program. 43 .IP "\fB-n\fP \fB\-\-nohead\fP " 10 44 Do not output the LaTeX document header. 45 This is useful when the output is to be included as a separate file into the master document. 46 47 .IP "\fB-t\fP \fB\-\-longtable\fP " 10 48 uses the 'longtable' package instead of the 'tabular' one. 49 This is useful when the input is long, with \fB\-\-lines 0\fP option. 50 This option uses the extra `longtable' LaTeX package. 51 If you also use \fB\-\-nohead\fP option, do not forget to add 52 the following line into the header of your master document: "\\usepackage{longtable}". 53 54 .IP "\fB-x\fP \fB\-\-noescape\fP " 10 55 Do not escape TeX control characters from the input. 56 This is useful when the input contains already TeX code. 57 58 .IP "\fB-g\fP \fB\-\-guess\fP " 10 59 Try to guess the csv format. 60 This is useful when the input is not strictly a comma separated set of printable data. 61 For example, a line like %Foo, Bar%:%Wizz: Hey% may be parsed as "Foo, Bar" then "Wizz: Hey". 62 63 .IP "\fB-s \fIc\fR|\fIs\fR|\fIt\fR|\fIp\fR|\fIl\fR\fP \fB\-\-separator \fIc\fR|\fIs\fR|\fIt\fR|\fIp\fR|\fIl\fR\fP " 10 64 Set the given separator as cell separator of the csv format. 65 `c' means a comma (default). 66 `s' means a semicolon. 67 `t' means a tab. 68 `p' means a space. 69 `l' means a colon. 70 71 .IP "\fB-b \fIq\fR|\fId\fR|\fIn\fR\fP \fB\-\-block \fIq\fR|\fId\fR|\fIn\fR\fP " 10 72 Set the given block delimiter that embraces the printable data of the csv format. 73 `q' means a simple quote. 74 `d' means a double quote. 75 `n' means no quoting at all (default). 76 77 .IP "\fB-l \fI#\fR\fP \fB\-\-lines \fI#\fR\fP " 10 78 Force to output multiple tabulars, each having a limited number of lines. 79 The given argument must be a POSITIVE INTEGER VALUE. This is useful when 80 the number of input rows is too big to fit into a single papersheet. 81 A good average for a4 paper is about 40 lines (default). 0 means infinity 82 (actualy about 2 Giga lines). 83 84 .IP "\fB-p \fIl\fR|\fIc\fR|\fIr\fR\fP \fB\-\-position \fIl\fR|\fIc\fR|\fIr\fR\fP " 10 85 Set the text position in all cells at once. 86 This simply uses one of the three basic cell formatting options of the LaTeX tabular environment. 87 `l' means left-aligned (default). 88 `c' means centered. 89 `r' means right-aligned. 90 91 .IP "\fB-c \fI0-1\fR\fP \fB\-\-colorrows \fI0-1\fR\fP " 10 92 Alternate white/gray rows on the LaTeX output, having the given graylevel. 93 The given argument must be a REAL NUMBER BETWEEN 0 AND 1. 94 0 means black while 1 means white. 95 A nice looking value is 0.75 when printed on white paper. 96 This option uses the extra `colortbl' LaTeX package. 97 If you also use \fB\-\-nohead\fP option, do not forget to add 98 the following line into the header of your master document: "\\usepackage{colortbl}". 99 100 .IP "\fB-r \fI1\fR|\fI2\fR|\fI3\fR|\fI4\fR\fP \fB\-\-reduce \fI1\fR|\fI2\fR|\fI3\fR|\fI4\fR\fP " 10 101 Reduce the size of the tabular and the font in the LaTeX output, given a reduction level. 102 The given argument must be one of 1, 2, 3 or 4. 103 The more the level is high, the more the tabular will appear small. 104 This is useful to shrink the table width when the printable data is made of very long text. 105 This option uses the extra `relsize' LaTeX package. 106 If you also use \fB\-\-nohead\fP option, do not forget to add 107 the following line into the header of your master document: "\\usepackage{relsize}". 108 109 .IP "\fB-z\fP \fB\-\-nohlines\fP " 10 110 Do not output horizontal lines in the table(s). 111 112 .IP "\fB-y\fP \fB\-\-novlines\fP " 10 113 Do not output vertical lines in the table(s). 114 115 .IP "\fB-e\fP \fB\-\-repeatheader\fP " 10 116 Repeat the first row of the first table in every table. 117 This is useful when the output is very long and separated in 118 multiple tables. 119 120 .IP "\fB-f \fI#\fR\fP \fB\-\-font \fI#\fR\fP " 10 121 Set the font size to be inserted on the header and use it to compute lines per table. 122 The given argument must be an integer in points unit. 123 If used in conjunction with \fB\-\-lines\fP set to 0, then the lines per tabular 124 is computed based on LaTeX \\textheight defaulting to 592 pt. 125 If the \fB\-\-longtable\fP is used, then the computation is not done. 126 If you also use \fB\-\-nohead\fP option, you should use the same font size 127 according to your own LaTeX document for best result. 128 129 .IP "\fB-a\fP \fB\-\-landscape\fP " 10 130 Set landscape mode in the LaTeX document header. If used in conjunction with 131 \fB\-\-lines\fP set to 0 and \fB\-\-font\fP size, then the \\textheight used 132 to compute lines per tabular defaults to (592 / 1.414) pt. If you also use \fB\-\-nohead\fP option, you should set your own LaTeX document to landscape mode for best result. 133 134 .SH "EXAMPLES" 135 .PP 136 Create a PDF document with small text, alternate gray rows, 80 lines per table, 137 from a guessed csv format of the january stats that my boss created with his 138 super point-and-click spreadsheet program (which could not generate a PDF output!). 139 140 .PP 141 \fBcsv2latex \-\-guess \-\-lines 80 \-\-colorrows 0.75 \-\-reduce 2 january_stats.csv > january_stats.tex && pdflatex january_stats.tex\fR 142 .PP 143 Quickly preview a phonebook from a file formatted as "Surname" "Name" "Phone" "Cellular": 144 145 .PP 146 \fBcsv2latex \-s p \-b d \-l 42 phonebook-sorted.txt | latex\fR 147 .SH "SEE ALSO" 148 .PP 149 tex (1), latex (1). 150 .\" created by instant / docbook-to-man

 ViewVC Help Powered by ViewVC 1.1.26