Program Name : '=SCRIPT=' ('=Bin=')
Usage Example :
'=SCRIPT=' -_ -c 12 -3 4..8 # Assuming 12 columns and treat some column in numbers and emphasize spaces.
Give the tab separated table from STDIN, then it yields a LaTeX table code from "\begin{table})..".
Labor-saving to create LaTeX tables from the copy/paste from Excel and SQL outputs, etc.
Main functions :
NOT ONLY performing the tedious work in typing LaTeX codes such as
(1) transforming tab characters into ampersands (&) characters for table environments,
(2) adding the "\hline" on the beginning and the ending inside the tabular environments,
BUT ALSO
(3) grouping every 3 digits by comma on numbers >= 1000 and aligning toward right in a column,
(4) properly modifying various signs \~!<>_%#&$ fitting into LaTeX (with -j, Japanese half-width as well),
(5) emphasizing the space chacters both usual half-size space and full-width space,
(6) by with -_, emphasizing the fullsize hyphen to indicate that it differs from prolonged sound sign.
Options :
-/ REGEX : Specifying the input delimter. Default is tab character. You can specify as -/ , for pseudo-CSV.
-= : To indicate that the first line in STDIN is the header, to yield "\hline" btw. 1st and 2nd lines.
-w N : To explicitly indicate that the table has N columns. (Else, automatically determined by 1st line)
-j : For Japanese half-width character. The LaTeX output utilize \scalebox{0.5}[1]{...}
-s N : N is the displaying magnifying factor. Often used for large-size table to reduce the physical size.
-_ : To emphasize the space character. Both for half-width \x{20} and full-width \x{3000}.
-0 regex ; テーブル中のセルで 0 など消去したい値を、正規表現で指定する。-0 '^0$' のように^と$は必要であろう。
-1 ; 最も左の列を行名の並びとして扱う。縦線が入る。1列目が -0 の処理の対象外になる。
-3 n[..n][,n[..n]][,n[..n]].. ; Specify number columns. The leftest columns is numbered 1.
-9 : Rotate the entire table 90 degree unclockwise, using "\rotatebox{90}".
-x 60mm ; 大きめのテーブルをセンタリングするためにLaTeXのコンパイラに、表の領域を狭く認識させるためのもの。
-H 15 : 16進の多数桁の数を先頭から15桁のみに短かくし、それより長い部分は..に置換。
-\' : Rotate each cell of the 1st line unclockwise. Often used that column names are long string.
-p ; LaTeXの冗長なコメント文を出さないようにする。(Primitive)
--help : Print this online help manual of this command "'=SCRIPT='". Similar to "perldoc `which [-t] '=SCRIPT='` ".
--help opt ..or.. --help options : Only shows the option helps. It is easy to read when you are in very necessary.
--help ja : Shows Japanese online help manual. ; "'=script=' --help ja" で日本語のオンラインマニュアルを表示します。
--help nopod : Print this online manual using the code insdide this program without using the function of Perl POD.
Remarks :
- \usepackage{graphicx} is needed between \documentclass and \begin{document}, for rotating and magnifying.
- The output LaTeX snippet does not work well if the column number of each line increase in a table.
- Please fill in \caption{} and \label{} as neccessary in the output LaTeX code.
Notes for developing :
* I want to add -r switching options to specify only right alignment.
* I have not yet fully investigate good LaTeX books yet. I only developed this program merely mainly by experience.
# This program has been made since 2018-02-09(Fri) by Toshiyuki Shimono, as a part of TSV hacking toolset for table data.