#!/usr/bin/perl -T use v5.14 ; use strict ; use warnings ; # cpantersã®ãƒ¬ãƒãƒ¼ãƒˆã«ã‚ˆã‚‹ã¨ã€5.14よりå‰ã¯NAã ã£ãŸã€‚ use Getopt::Std ; getopts q['$/:=_#:0:13:9C:fjm:psw:x:H:] , \my%o ; # 5. use utf8 ; # v5.6 ~ use Encode qw[ encode_utf8 decode_utf8 ] ; # v5.7 ~ use Term::ANSIColor qw [:constants ] ; $Term::ANSIColor::AUTORESET = 1 ; # v5.6 ~ $o{m} //= "1." ; # 表示拡大率 LaTeX displaying magnification efficient. $o{x} //= "0mm" ; # 大ãã‚ã®ãƒ†ãƒ¼ãƒ–ルã®ã‚»ãƒ³ã‚¿ãƒªãƒ³ã‚°ã®ãŸã‚ã«ã€å·¦å³ã‚’削りå–ã‚‹é•·ã•を指定ã™ã‚‹ã€‚ my $isep = $o{'/'} // "\t" ; # 入力ã®åŒºåˆ‡ã‚Šæ–‡å— my $colspec = '' ; # LaTeXã®table環境ã®åˆ—指定 LaTeX table environment "column specifier" my $rm = $o{0} if defined $o{0} ; # テーブルã®å€¤ã§é™¤åŽ»å¯¾è±¡ã¨ãªã‚‹å€¤ã®æ£è¦è¡¨ç¾ my %del ; # LaTeXã§ä½¿ã‚ãªã„ã‚³ãƒžãƒ³ãƒ‰ã®æŒ‡å®šã€‚ my @r3 = () ; # 3æ¡ã‚³ãƒ³ãƒžåŒºåˆ‡ã‚Šã«ã—ã¦å³å¯„ã›ã«ã—ãŸã„åˆ—ã®æŒ‡å®šã€‚ Which columns are to be decimal being separated every 3 digits. # è¿½åŠ ã®æ°´å¹³ç·šã¨åž‚ç›´ç·š my $hdash = qq[\\hdashline[1pt/1pt] % "\\hdashline[..]" requires "\\usepackcage{arydshln}"] ; my $HL = ! exists $o{'#'} ? '' : $o{'#'} =~ /1/ ? "\\hline" : $o{'#'} =~ m/\./ ? $hdash : '' ; my $VL = ! exists $o{'#'} ? '' : $o{'#'} =~ /1/ ? '|' : $o{'#'} =~ /\./ ? ';{1pt/1pt}' : ' ' ; my $angle = $o{9} ? 90 : 0 ; # 全体を回転ã™ã‚‹å ´åˆã®æŒ‡å®š When -9 is specified, the entire table rotates in 90 degree. my @out ; # $0ã®å‡ºåŠ›æ–‡å—列 The output of this command is accumulated in this variable. my $otfFlag = 0 ; # usepackage{otf} ãŒå¿…è¦ã‹ã©ã†ã‹ã®ãƒ•ラグ & main ( ) ; exit 0 ; sub plain2latex ( $ ) { local $_ = $_[0] ; $otfFlag = 1 if m/\P{ascii}/ ; # <-- 全角ãƒã‚¤ãƒ•ãƒ³ã®æ™‚ã ã‘ã«è¡¨ç¤ºã™ã‚‹æ§˜ã«ã™ã‚‹ã®ãŒã€è‰¯ã„ã®ã‹ã‚‚知れãªã„。 my $hlen = $o{H} if defined $o{H} ; # ãƒãƒƒã‚·ãƒ¥å€¤ã®ã‚ˆã†ãª16é€²æ•°ã®æ–‡å—列を長ã„å ´åˆã« $hlenæ¡ã«ç¸®ã‚㦠.. ã‚’ç¶šã‘る。 s/(?<=[0-9a-f]{$hlen})[0-9a-f]+/../gi if defined $o{H} ; # <-- - (?<= ) ã§æ£è¦è¡¨ç¾ã®å¾Œèªã¿ # ドル$æ–‡å—関連 The pre-processing of the character "$ dollar". The completion process will appear much later. s|\G(.*?)\$|$1=\$\$=|g ; # ドル文å—ã®å‰å‡¦ç†ã€‚\Gã¯æ–‡å—列ã®å…ˆé ã€ã‚‚ã—ãã¯ä¿®é£¾å g ãŒã¤ã„ãŸãƒ‘ターンマッãƒãƒ³ã‚°ãŒçµ‚了ã—ãŸå ´æ‰€ã‚’記憶ã—ã¦ãŠãã€ãã“ã«ãƒžãƒƒãƒ # LaTeXä¸ã§ æ•°å¼ç’°å¢ƒã‚’利用ã™ã‚‹ã‚‚ã® Utilization of math formula env. of LaTeX for some specific characters such as \~!<>. s/([\\\Q!~<>|"\E\x{FF0D}]+)/\$$1\$/g ; # 1. æ•°å¼ç’°å¢ƒã«ç§»è¡Œã—ã¦ã€ ; \Qã¨\Eã®é–“ã¯ãƒ‘ターンメタ文å—ã®ç„¡åŠ¹åŒ–ã€‚ s/\\/\\backslash/g ; # 2. ãã—ã¦ã€ã¾ãšå…ˆã«ãƒãƒƒã‚¯ã‚¹ãƒ©ãƒƒã‚·ãƒ¥ã«å‡¦ç†ã‚’ã—ã¦ã€å¾Œã®å‡¦ç†ãŒç¶šã。 s/~/\\sim/g; # ãƒãƒ«ãƒ€ s/\x{FF0D}/\Q\!\!\frac{}{{{}\atop{H}}}\!\!\E/g if $o{'_'} ; # 全角ãƒã‚¤ãƒ•ンã¯ãã®ä¸‹ã«ã€H ã‚’å°ã•ãæ›¸ã ; \N{FULLWIDTH HYPHEN-MINUS} s/\ /\\scalebox{0.5}[0.5]{\$\\sqcup\$}/g if $o{'_'} ; # åŠè§’スペースã®å¼·èª¿ ; s/\x{3000}/\\scalebox{1}[0.5]{\$\\sqcup\$}/g if $o{'_'} ; # 全角スペース ã¯ã€ -z 指定ã®å ´åˆã€çš¿ã®å½¢ã®ç·šãŒç½®ã‹ã‚Œã‚‹ã€‚\N{IDEOGRAPHIC SPACE} # LaTeXä¸ã§ãƒãƒƒã‚¯ã‚¹ãƒ©ãƒƒã‚·ãƒ¥ã‚’ä¼´ã†ã¹ãæ–‡å—ã®å‡¦ç† : Treatments on characters requiring backslash in LaTeX. s/(?=[\Q_%#&{}\E])/\\/g ; # (?= ) ã§æ£è¦è¡¨ç¾ã®å…ˆèªã¿ _%#&{} s/\^/\\^{}/g ; # ドル文å—ã®å‡¦ç† The completion of dollar character. s/=\$\$=/\\\$/g ; # ドル文å—ã®å‡¦ç†ã¯ã“ã“ã§çµ‚ã‚り。 # åŠè§’カナã®å‡¦ç† Japanese Hankaku (half-width) Katakana letters. (I tried to found them in the A1 - DF from JISX0201.) if ( $o{j} ) { s/([。「」、・ヲァ-ッーア-ï¾ï¾žï¾Ÿ]+)/\\scalebox{0.5}[1]{$1}/g ; # 次ã®2行ã¯ç¯„囲指定ã ã¨ãšã‚Œã‚‹ã®ã§ã€ä¸€æ–‡å—ãšã¤å‡¦ç†ã—ãŸã€‚ y/。「」、・ヲァィゥェォャï½ï½®ï½¯ï½°ï½±ï½²ï½³ï½´ï½µï½¶ï½·ï½¸ï½¹ï½ºï½»ï½¼ï½½ï½¾ï½¿/。「ã€ã€ãƒ»ãƒ²ã‚¡ã‚£ã‚¥ã‚§ã‚©ãƒ£ãƒ¥ãƒ§ãƒƒãƒ¼ã‚¢ã‚¤ã‚¦ã‚¨ã‚ªã‚«ã‚クケコサシスセソ/ ; y/ï¾€ï¾ï¾‚テトナニヌネノハヒフï¾ï¾Žï¾ï¾ï¾‘メモヤユヨラリルレロワï¾ï¾žï¾Ÿ/ã‚¿ãƒãƒ„テトナニヌãƒãƒŽãƒãƒ’フヘホマミムメモヤユヨラリルレãƒãƒ¯ãƒ³ã‚›ã‚œ/ ; } # åŠè§’ãƒã‚¤ãƒ•ンã§é€£ç¶šã—ã¦ã„ã‚‹ã‚‚ã®ã®å‡¦ç† s/-(?=-)/-{}/g ; return $_ ; } sub main ( ) { my $zflag = 0 ; # 全角空白ã®å˜åœ¨ãƒ•ラグ ; $ex{' '} ã®ã‚ˆã†ã«ã‚‚ã£ã¨æŸ”軟ã«ã—ãŸã„ã‹ã‚‚ my $maxF = 1 ; # ãƒ•ã‚£ãƒ¼ãƒ«ãƒ‰æ•°ã®æœ€å¤§å€¤ ; 0 ã§ã¯ç„¡ãã¦1ã¨ã—ãŸè¨³ã¯å…¨ã¦ç©ºè¡Œã§ã‚‚ \begin{tabular}[l] ã¨lãŒæœ€ä½Ž1個ã¯å¿…è¦ãªãŸã‚ my $tailF = $o{'$'} ? $o{w} : -1 ; my $HS = ' ' x 12 ; # 出力行ã®å…ˆé ã®ã‚¹ãƒšãƒ¼ã‚¹ã€‚レイアウトをãれã„ã«ã™ã‚‹ãŸã‚ @r3 = split /,/, $o{3} , -1 if $o{3} ; # オプション -3 ã«ã¤ã„ã¦ã®å‡¦ç† do { splice @r3, $_ , 1 , $1 .. $2 if $r3[$_] =~ m/(\d+)\.\.(\d+)/ } for reverse 0 .. $#r3 ; grep { $_ -- } @r3 ; binmode STDOUT, ":utf8" ; $SIG{ALRM} = sub { print STDERR CYAN "Please enter a tabular text in TSV format..\n" if -t } ; alarm 3 ; my $alF = 1 ; # alarm ã‚’ç«‹ã¦ãŸã‚Šä¸‹ã‚ã—ãŸã‚Šã—ãŸã“ã¨ã‚’表ã™ãƒ•ラグ while ( <> ) { alarm 0 if $alF && $alF -- ; # <- if を使ã†ã“ã¨ã§ sleep 0ã®3マイクãƒç§’ãã‚‰ã„æ¶ˆè²»ã‚’ 0.03マイクãƒç§’ã«ç¸®ã¾ã‚‹ chomp ; do { s/\s*$// ; if (/^$/) { $. -- ; next } } if $o{s} ; # -s 指定ã«ã‚ˆã‚Šæœ«å°¾ã®ç©ºç™½æ–‡å—ã‚’å–り除ã。 $_ = decode_utf8 ( $_ ) ; # <- 括弧ãŒå¤–ã›ã‚‹ã‹ç¢ºèª $zflag = 1 if m/ / ; #全角空白 \x{3000} ã®ãƒã‚§ãƒƒã‚¯ my @F = split /$isep/ , plain2latex ( $_ ) , $tailF ; # <--- ã“ã“ã§ã‚³ã‚¢ã¨ãªã‚‹å‡¦ç† #$tailF //= @F ; # 1行目ã§è¨å®šã™ã‚‹ã“ã¨ã§ã€LaTeXコンパイル時ã«åˆ—数変動ã§ã‚¨ãƒ©ãƒ¼ã«ãªã‚‰ãªã„よã†ã«ã™ã‚‹ã€‚ splice @F , $o{w} if defined $o{w} ; # åˆ—æ•°ã®æœ€å¤§å€¤ãŒæŒ‡å®šã•れãŸå ´åˆã®ã€åˆ‡ã‚Šå–りã®å‡¦ç†ã€‚ $maxF = @F if @F > $maxF ; grep { s/$rm//} @F[ $o{1} // 0 .. $#F ] if defined $o{0} and $. > 1 || ! $o{'='} ; # -0ã®å‡¦ç† grep { s/(?<=\d)(?=(\d\d\d)+($|\D))/,/g } @F[ (grep{$_< scalar @F} @r3) ] if $. > 1 || ! $o{'='} ; # 数値3æ¡åŒºåˆ‡ã‚Šã®å‡¦ç† grep { $_ = "\\rotatebox{90}{$_}"} @F if $o{q[']} and $. == 1 ; # å…ˆé 行を回転ã—ãŸã„å ´åˆã€‚ push @out, $HS . (join ' & ' , @F ) . "\\\\" , "\n" ; push @out, $HS , "\\hline\n" if $o{'='} && $.== 1 ; # 1行目ã¨2è¡Œç›®ã«æ¨ªã®ç½«ç·šã‚’入れる。 push @out , $HS.$HL."\n" if $HL ne '' and ! ( $o{1} && $. == 1 ) ; } # while (<>)ã®çµ‚ã‚り pop @out if $HS ne '' ; # -\# ãŒæŒ‡å®šã•れã¦ã„ã‚‹ã¨ãã«ã€æœ€å¾Œã® 横罫線ã¯å–り消ã™ã€‚ unshift @out, tableStart ( $maxF ) if ! exists $o{C} ; push @out, tableEnding( int rand() * 1e6 ) if ! exists $o{C} ; # 1e5ã ã‘ãªã‚‰ã°ãƒ†ãƒ¼ãƒ–ル300個ãらã„ã§è¡çªãŒåŠåˆ†ã®ç¢ºçއã§ç™ºç”Ÿ print STDERR GREEN "$. lines are read and accepted.\n" ; grep { s/^\s*\%.*$//gm ; s/\n+/\n/g } @out if $o{p} ; # -p 指定ã«ã‚ˆã‚ŠLaTeXã§ã‚³ãƒ¡ãƒ³ãƒˆã‚¢ã‚¦ãƒˆã•れãŸè¡Œã¯å‡ºåŠ›æŠ‘åˆ¶ if ( exists $o{C} ) { for ( @out ) { next if ! m/./ ; s|^$HS|| ; $_ = "\\hspace*{$o{x}}$_" if $o{C} =~ /h/i ; # -C h : å·¦å³ã«ãšã‚‰ã™ã€‚マイナスã®é•·ã•ã§å·¦ã«ãšã‚Œã‚‹ã€‚ $_ = "\\mbox{$_}" if $o{C} =~ /m/i ; # -C m : å„行を mbox{ .. } ã¨å›²ã‚€ã€‚ do { s|\Q\\\E||g ; $_ .= "\\newline" } if $o{C} =~ /n/i ; # -C n : 改行を \newlineã«å¤‰æ› s|\Q\\\E||g if $o{C} =~ /0/i ; # -C 0 : 改行を除去ã™ã‚‹ } } $| = 1 ; print @out ; #sleep 1 ; print STDERR BRIGHT_BLUE qq[\\usepackage{otf}" may be required because of non-ascii characater(s).\n] if $otfFlag ; print STDERR CYAN "Full-width space included. Using the option '-_' is advisable.\n" if $zflag && ! $o{'_'} ; } sub tableStart ( $ ) { my @tmp = ('l') x ( $_[0] ) ; # 列指定 $tmp [$_] = 'r' for @r3 ; grep { $_ .= $VL } @tmp [ ($o{1}//0) .. $#tmp -1 ] ; # -\# ã§åž‚ç›´ç·šãŒå…¥ã‚‹å‡¦ç† splice @tmp , $_ * 5 , 0 , ' ' for reverse 1 .. @tmp/5 ; # 列指定ã«5列ã”ã¨ã«ç©ºç™½æ–‡å—を入れる。 splice @tmp , 1 , 0 , " | " if $o{1} ; # 縦線を入れる指定 $colspec = " | " . ( join '' , @tmp ) . " | " ; my $csCmt = ($colspec =~ m/;\{/ ) ? qq[ % ";\{length/length\}" requires "\\usepackcage{arydshln}"] : '' ; my $out = << "END" ; \\begin{table} \\center \\hspace*{-$o{x}} \\rotatebox{$angle}{ % "\\rotatebox{..}" requires "\\usepackage{graphicx}". \\scalebox{$o{m}}{ % "\\scalebox{..}" requires "\\usepackage{graphicx}". \\begin{tabular}{$colspec}$csCmt \\hline END $out =~ s/(\Q\hspace*{-0mm}\E)/%$1/ and $del{hspc} = 1 ; $out =~ s/(\Q\rotatebox{0}\E)/%$1/ and $del{rttbx} = 1 ; $out =~ s/(\Q\scalebox{1.}\E)/%$1/ and $del{scb} = 1 ; return $out ; } sub tableEnding ( $ ) { my $out = << "END" ; \\hline \\end{tabular} }% closing scalebox }% closing rotatebox \\hspace*{-$o{x}} \\caption{} \\label{tbl:$_[0]} \\end{table} END $out =~ s/(\Q}% closing scalebox\E)/%$1/ if $del{scb} ; $out =~ s/(\Q}% closing rotatebox\E)/%$1/ if $del{rttbx} ; $out =~ s/(\Q\hspace*{\E)/%$1/ if $del{hspc} ; return $out ; } ## ãƒ˜ãƒ«ãƒ—ã®æ‰±ã„ sub VERSION_MESSAGE {} sub HELP_MESSAGE { use FindBin qw[ $Script $Bin ] ; sub EnvJ ( ) { $ENV{LANG} =~ m/^ja_JP/ ? 1 : 0 } ; # # ja_JP.UTF-8 sub en( ) { grep ( /^en(g(l(i(sh?)?)?)?)?/i , @ARGV ) ? 1 : 0 } # English ã¨ã„ã†æ–‡å—列を先é ã‹ã‚‰2æ–‡å—以上をå«ã‚€ã‹ sub ja( ) { grep ( /^jp$|^ja(p(a(n?)?)?)?/i , @ARGV ) ? 1 : 0 } # jp ã¾ãŸã¯ japan ã¨ã„ã†æ–‡å—列を先é ã‹ã‚‰2æ–‡å—以上をå«ã‚€ã‹ sub opt( ) { grep (/^opt(i(o(ns?)?)?)?$/i, @ARGV ) ? 1 : 0 } # options ã¨ã„ã†æ–‡å—列を先é ã‹ã‚‰3æ–‡å—以上å«ã‚€ã‹ã‚‰ sub noPOD ( ) { grep (/^no-?p(od?)?\b/i, @ARGV) ? 1 : 0 } # POD を使ã‚ãªã„ã¨è¨€ã†æŒ‡å®šãŒã•れã¦ã„ã‚‹ã‹ã©ã†ã‹ my $jd = "JapaneseManual" ; my $flagE = ! ja && ( en || ! EnvJ ) ; # 英語ã«ã™ã‚‹ã‹ã©ã†ã‹ã®ãƒ•ラグ exec "perldoc $0" if $flagE && ! opt && ! noPOD ; $ARGV[1] //= '' ; open my $FH , '<' , $0 ; while(<$FH>){ s/\Q'=script='\E/$Script/gi ; s/\Q'=bin='\E/$Bin/gi ; if ( s/^=head1\b\s*// .. s/^=cut\b\s*// ) { if ( s/^=begin\s+$jd\b\s*// .. s/^=end\s+$jd\b\s*// xor $flagE ) { print $_ if ! opt || m/^\s+\-/ ; } } #print $_ if /^=head1/ .. /^=cut\b/ and opt ? m/^\s+\-/ : 1 and ( EnvJ && ! en xor s/^=begin $jd\b// .. s/^=end $jd\b// ) ; } close $FH ; exit 0 ; } =encoding utf8 =pod =head1 latextable -- produces LaTeX snippets. E.g. From table data/code into LaTeX tables/captions. Program Name : latextable ('=Bin=') Usage Example : latextable -_ -w 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 : Specification of the max number of columns. The columns over this limit will be neglected. -$ : -\$ ã®æŒ‡å®šã«ã‚ˆã‚Šã‚ãµã‚ŒãŸåˆ—ã¯ã€åˆ—を増やã•ãšã«æ®‹ã™ã“ã¨æŒ‡å®šã€‚ -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 ; The regex will be removed in the output. E.g, if you want the exact 0, specify : -0 '^0$' -1 ; The leftmost column will be : (1) separated by horizontal line, and (2) -0 will not be applied there. -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 ; logical narrowing of a table for the purpose of cenering a wide table. -\' : Rotate each cell of the 1st line unclockwise. Often used that column names are long string. -p ; Suppresses the redundant comments on LaTeX output. (Primitive) -s ; remoring the spaces of : (1) consecutive space characters in the end of line and (2) blank lines. -\# str : テーブル内ã®å„行ã¨å„列ã«ç½«ç·šã‚’挿入ã™ã‚‹ã€‚ -\# 1 ã§å®Ÿç·šã€ -\# . ã«ã‚ˆã‚Šç‚¹ç·š(\usepackage{arydshln} ãŒå¿…è¦)。 -C [mnh]+ : Useful to table caption and main text. One or more characters from {m,n,h} is requried after -C -C m : encloses mbox{} for every input line ; -C n : add "\newline" in the end of every input line, to be used in Latex table caption ; -C h : add "hspace*{-6mm}" on the head of every line where the length (here -6mm) is specified by "-x -6mm". -H N : Shrinkens hexadecimal digits with more than N digits by taking the head N digits with ".." in the tail. --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. =begin JapaneseManual プãƒã‚°ãƒ©ãƒ å : '=SCRIPT=' ('=Bin=') 標準入力ã‹ã‚‰ã‚¿ãƒ–区切りã®ãƒ‡ãƒ¼ã‚¿ã‚’èªå–りã€ãれを LaTeX ã®è¡¨ã§ä½¿ãˆã‚‹ã‚ˆã†ã«å¤‰æ›ã™ã‚‹ã€‚ 下記ã®ä½œæ¥ãªã©ã‚’çœåŠ›åŒ–ã™ã‚‹ã“ã¨ãŒç›®çš„ã§ã‚る。 (1) タブ区切りをアンパサンド区切りã«å¤‰æ›ã™ã‚‹ã“㨠(2) \hline コマンドを書ã入れるã“㨠(3) 数値ã¯ã‚³ãƒ³ãƒž3æ¡åŒºåˆ‡ã‚Šã§å³è©°ã‚ã«ã™ã‚‹ã“㨠(4) å„種記å·ã‚„åŠè§’カナをLaTeXã§å‡ºåŠ›ã§ãるよã†ã«ã™ã‚‹ã“㨠(5) åŠè§’空白ã¨å…¨è§’空白を目立ãŸã›ã‚‹ã“㨠(6) 全角ãƒã‚¤ãƒ•ンもã€å…¨è§’長音ã¨åŒºåˆ¥ã•ã›ã‚‹ã“㨠オプション : -/ REGEX : 区切り文å—ã‚’ æ£è¦è¡¨ç¾ã§æŒ‡å®šã™ã‚‹ã€‚å˜ç´”ãªã‚³ãƒ³ãƒžåŒºåˆ‡ã‚Šã§ã‚れã°ã€-/ , ã¨æŒ‡å®šã€‚未指定ãªã‚‰ã‚¿ãƒ–æ–‡å—。 -= : æ¨™æº–å…¥åŠ›ã®æœ€åˆã®è¡Œã¯ã€ä½œã‚ŠãŸã„テーブルã®ãƒ˜ãƒƒãƒ€ã§ã‚ã‚‹ã¨ä»®å®šã™ã‚‹ã€‚(\hlineã®å‡¦ç†ã¨-0ã®å‡¦ç†ã«é–¢ã‚ã‚‹) -w N : è¡¨ã®æœ€å¤§ã®åˆ—数を指定。ãれを超ãˆãŸåˆ—ã¯å‡ºåŠ›ã«åæ˜ ã•れãªã„。 -$ : -\$ ã®æŒ‡å®šã«ã‚ˆã‚Šã‚ãµã‚ŒãŸåˆ—ã¯ã€åˆ—を増やã•ãšã«æ®‹ã™ã“ã¨æŒ‡å®šã€‚ -j : 日本語ã®åŠè§’カナã«å¯¾å¿œã™ã‚‹ã€‚ -m N : å‡ºåŠ›ã®æ‹¡å¤§çŽ‡ã‚’æŒ‡å®šã™ã‚‹ã€‚未指定ãªã‚‰ 1.0。 -_ : 全角スペース(UTF8)ã¨åŠè§’スペースåŠã³å…¨è§’ãƒã‚¤ãƒ•ンã«ã¤ã„ã¦ã€LaTeXã®å‡ºåŠ›çµæžœã«ãŠã„ã¦ã€åˆ†ã‹ã‚‹æ§˜ã«ã™ã‚‹ã€‚ -0 regex : テーブルä¸ã®ã‚»ãƒ«ã§ 0 ãªã©æ¶ˆåŽ»ã—ãŸã„å€¤ã‚’ã€æ£è¦è¡¨ç¾ã§æŒ‡å®šã™ã‚‹ã€‚-0 '^0$' ã®ã‚ˆã†ã«^ã¨$ã¯å¿…è¦ã§ã‚ã‚ã†ã€‚ -1 : 最も左ã®åˆ—を行åã®ä¸¦ã³ã¨ã—ã¦æ‰±ã†ã€‚縦線ãŒå…¥ã‚‹ã€‚1列目㌠-0 ã®å‡¦ç†ã®å¯¾è±¡å¤–ã«ãªã‚‹ã€‚ -3 n[,n][,n].. : 3æ¡åŒºåˆ‡ã‚Šã«ã—ã¦å³å¯„ã›ã«ã—ãŸã„列を1å§‹ã¾ã‚Šã§æŒ‡å®šã™ã‚‹ã€‚ ..ã§ç¯„囲指定。 -9 : LaTeXã§è¡¨ç¤ºã•ã›ã‚‹è¡¨ã®å…¨ä½“ã‚’90度左回りã«å›žè»¢ã•ã›ã‚‹ã€‚ -x 60mm : 幅広ã®ãƒ†ãƒ¼ãƒ–ルを横方å‘ä¸å¤®ã«é…ç½®ã™ã‚‹ãŸã‚ã«ã€è¡¨ã®é ˜åŸŸã‚’è«–ç†ä¸Šç‹ãèªè˜ã•ã›ã‚‹ã€‚-Chã®æŒ‡å®šæ™‚ã¯å³æ–¹å‘移動ã®é•·ã•ã®æŒ‡å®šã¨ãªã‚‹ã€‚ -\' : 1行目を左回りã«å›žè»¢ã™ã‚‹ã€‚ -p : LaTeXã®å†—é•·ãªã‚³ãƒ¡ãƒ³ãƒˆæ–‡ã‚’出ã•ãªã„よã†ã«ã™ã‚‹ã€‚(Primitive) -s : è¡Œã®æœ«å°¾ã®ç©ºç™½æ–‡å—ã‚’å–り除ã。ãã—ã¦ãã®çµæžœç©ºè¡Œã«ãªã£ãŸå ´åˆã‚‚å–り除ã。入力ã«ä½™è¨ˆãªç©ºç™½æ–‡å—ãŒæœ«å°¾ã«ã¤ãå ´åˆã«ä¾¿åˆ©ã€‚ -\# str : テーブル内ã®å„行ã¨å„列ã«ç½«ç·šã‚’挿入ã™ã‚‹ã€‚ -\# 1 ã§å®Ÿç·šã€ -\# . ã«ã‚ˆã‚Šç‚¹ç·š(\usepackage{arydshln} ãŒå¿…è¦)。 -C [mnh]+ : 表組ã¿ã§ã¯ãªãã¦ã€LaTeXã®table環境ã®caption{}ã«ä½¿ãˆã‚‹ã‚ˆã†ã«ã™ã‚‹ã€‚m,n,h ã‚’1ã¤ä»¥ä¸Šçµ„ã¿ã‚ã‚ã›ã¦æŒ‡å®šã€‚例: -C mh -C m : å„行を mbox{}ã§å›²ã‚€ã€‚ ; -C n : å„行ã®è¡Œæœ«ã«\newlineã‚’ä»˜åŠ ã™ã‚‹ã€‚ ; -C h : å„行ã®å…ˆé ã« hspace*{-6mm}ã§å·¦ã«6mmãšã‚‰ã™ã‚ˆã†ãªæŒ‡å®š -H 15 : 16進ã®å¤šæ•°æ¡ã®æ•°ã‚’å…ˆé ã‹ã‚‰15æ¡ã®ã¿ã«çŸã‹ãã—ã€ãれより長ã„部分ã¯..ã«ç½®æ›ã€‚ --help : ã“ã®ã‚³ãƒžãƒ³ãƒ‰ '=SCRIPT=' ã®ã‚ªãƒ³ãƒ©ã‚¤ãƒ³ãƒ˜ãƒ«ãƒ—マニュアルを表示ã™ã‚‹ã€‚ --help opt ãªã„ã— --help options : 分ã‹ã‚Šå®‰ãオプションã®ãƒ˜ãƒ«ãƒ—ã®ã¿ã‚’表示ã™ã‚‹ã€‚ --help en : 英語版ã®ã‚ªãƒ³ãƒ©ã‚¤ãƒ³ãƒ˜ãƒ«ãƒ—マニュアルを出力。Online help in English version. 注æ„点 : - 途ä¸ã§åˆ—æ•°ãŒå¤‰ã‚ã‚‹ã¨ã€LaTeXã®å‹•作ãŒã†ã¾ãã„ã‹ãªããªã‚‹ã®ã§æ³¨æ„。 ã“ã®ãƒ—ãƒã‚°ãƒ©ãƒ ã®é–‹ç™ºä¸Šã®ãƒ¡ãƒ¢ : * 3æ¡åŒºåˆ‡ã‚Šã«ã—ãŸã„æ•°ã§ã¯ãªãã¦ã€å˜ã«å³å¯„ã›ã—ãŸã„åˆ—ã®æŒ‡å®šã‚’ã™ã‚‹ -r を実装ã—ãŸã„。 * ドルマークã¨ãƒãƒƒã‚¯ã‚¹ãƒ©ãƒƒã‚·ãƒ¥ã®å‡¦ç†ã¯å†…部処ç†ä¸Šã§ãƒˆãƒªãƒƒã‚ーã ã£ãŸã€‚æ£è¦è¡¨ç¾ã® \Gã§è§£æ±ºã—ãŸã€‚<-- テストを書ãã¹ã—。 * 列数ãŒå¤‰ã‚ã‚‹å ´åˆã«è¦å‘Šã‚’出ã—ã¦ã€å¯èƒ½ãªã‚‰ã€ç©ºæ–‡å—列ã§åŸ‹ã‚るよã†ã«ã™ã‚‹ã€‚ * 逆ã«LaTeXã®ãƒ†ãƒ¼ãƒ–ルã‹ã‚‰TSVファイルã«å¤‰æ›ã™ã‚‹æ©Ÿèƒ½ã‚’ -~ã®ã‚ªãƒ—ションスイッãƒã§å®Ÿè£…ã—ãŸã„。 * -~ã¯å¤§å¤‰ãªã®ã§ã€ãã®å‰ã«ï¼Œ-Rã§å…¥åŠ›ã‚’ãã®ã¾ã¾ \if0 (\iffalse)ã¨\fi 囲んã ã‚‚ã®ã‚‚出ã—ãŸã„。ã™ã‚‹ã¨è¡¨ã®ä¿®æ£ãŒæ¥½ã«ãªã‚‹ã€‚ # ã“ã®ãƒ–ãƒã‚°ãƒ©ãƒ 㯠2018å¹´2月9æ—¥(金)ã‹ã‚‰è¡¨å½¢å¼ãƒ‡ãƒ¼ã‚¿ã«å¯¾ã™ã‚‹é“具作りã®ä¸€ç’°ã¨ã—ã¦ã€ä¸‹é‡Žå¯¿ä¹‹ãŒä½œæˆã—ãŸã‚‚ã®ã§ã‚る。 # ã“ã®ãƒ—ãƒã‚°ãƒ©ãƒ ãƒ•ã‚¡ã‚¤ãƒ«ã«æœ€è¿‘æ‰‹ã‚’åŠ ãˆãŸã®ã¯ã€2018å¹´6月3æ—¥(æ—¥), 6月9æ—¥(土)ã§ã‚る。 =end JapaneseManual =cut