Home >[TeX] >[その他] >[表]
表組

[表組み] [例 --1] [例 -- 2] [例 -- 3]

セル内の配置記述
  • \begin{tabular}{l}: 
       項目を左揃え。
  • \begin{tabular}{c}: 
       項目を中央揃え。
  • \begin{tabular}{r}: 
       項目を右寄せ。
  • \begin{tabular}{p{width}}: 
       項目をwidthの幅+”左右の余白”で表示。
  • \begin{tabular}{@{width}}: 
       隣の列との間にwidthの幅の空白を作る。&が不要。
gif
[上のソースファイル]
array.styを利用すると項目の設定が増えます。
tabularx.styを利用すると表の幅の設定が行えます。

表の位置記述
  • \begin{tabular}[t]: 
       表のtopを文章のbaselineに合わせる。
  • \begin{tabular}[c]: 
       表のcenterを文章のbaselineに合わせる。
  • \begin{tabular}[b]: 
       表のbottomを文章のbaselineに合わせる。
gif
[上のソースファイル]

  • \arrayrulewidth: 
       罫線の太さを指定。
gif
[上のソースファイル]
gif
[上のソースファイル]
hhline.sty参照。

  • \arraystretch: 
       隣り合うセルの間隔の拡大率。
gif
[上のソースファイル]

gif
[上のソースファイル]

gif
[上のソースファイル]
tabls.sty参照。

  • \tabcolsep: 
       列の間隔の1/2を指定。縦罫があるときは、罫線の太さ/2を引いたものが縦罫との余白量。
gif
[上のソースファイル]

  • *{繰り返し回数}{配置記述}: 
       繰り返し。
gif
[上のソースファイル]

  • @{const}: 
       隣り合う項目をconstを用いて表示する。
gif
[上のソースファイル]
gif
[上のソースファイル]

gif
[上のソースファイル]


   図・表組 Tips
  • 表番号に節番号を付けるには、
      \makeatletter
       \renewcommand{\thetable}{%
       \thesection.\arabic{table}}
       \@addtoreset{table}{section}
      \makeatother
    
    をプレアンブルに入れる。図の場合は、
      \makeatletter
        \renewcommand{\thefigure}{%
        \thesection.\arabic{figure}}
        \@addtoreset{figure}{section}
      \makeatother
    
    [][golfer.eps]
  • 表番号、図番号の変更はそれぞれ、\setcounter{table}{10}\setcounter{table}{10}を番号を変更したい箇所の前に入れる。この場合は、番号は11となる。
  • 表のセルの中では改行が出来ない(\\が利用できない)ので、\parboxを用いて、段落を挿入する。
    @
    [上のソースファイル]
  • 改頁を伴う長い表には、longtable.styまたは、supertabular.styを用いる。
  • キャプションの”:”を変更するには、ccaption.styを組み込み、\captiondelim{**}とする。”: ”が”**”に変更される。
  • 表の項目への脚注。
    1.
    minipage環境
    tablefoot.gif
    [上のソースファイル]
    上のminipage環境による罫線を消すのは
    \renewcommand{\footnoterule}{}を入れます。
    2.
    threeparttable.sty
    tablefoot.gif
    [上のソースファイル]
    3.
    \multicolumn{}{}{}
    tablefoot.gif
    [上のソースファイル]
  • twocolumnmulticolを指定しているときは、\begin{figure*}\begin{table*}として段組から外す。
  • ! LaTeX Error: Too many unprocessed floats.のErrorが出たら、\clearpageを入れる。\newpageではメッセージが消えないときもある。
  • \begin{tabular}...\end{tabular}全体を{\small ...}{\tiny ...}で囲んで全体のフォントを小さくする。
    %%
    [上のソースファイル]
  • Excelからの表は、Excel2TabularExcel2LaTeXCalc2LaTeXを利用すると簡単に作ることが出来る。
  • 横罫線と縦罫線の交点は、拡大すると
    table100.gif
    のようになっている。hhline.styを用いることで
    table101.gif
    に出来る。array.sty参照。
  • 図と表を常に真ん中に配置(\centeringの記述が不要になる)
      \makeatletter
        \newenvironment{myfigure}[1][\fps@figure]%
        {\begin{figure}[#1]\centering}%
        {\end{figure}}
        \newenvironment{myfigure*}[1][\fps@figure]%
        {\begin{figure*}[#1]\centering}%
        {\end{figure*}}
      \makeatother
    
    footmisc
    [上のソースファイル]
  • 図の番号と表の番号を通し番号にする。
      \makeatletter
      \let\c@figure\c@table
      \let\p@figure\p@table
      \let\cl@figure\cl@table
      \let\thefigure\thetable
      \makeatother
    
    footmisc
    [上のソースファイル(jreport.cls, jbook.cls)][上のソースファイル(jarticle.cls)]


@
[上のソースファイル]

description環境
*
[上のソースファイル]


\usepackage{multicol}
multicol004
[上のソースファイル]

\documentclass[twocolumn]{jarticle}
\makeatletter
\newcommand{\figcaption}[1]{\def\@captype{figure}\caption{#1}}
\newcommand{\tblcaption}[1]{\def\@captype{table}\caption{#1}}
\makeatother
を入れて、図と表のキャプションを追加。
multicol004
[上のソースファイル]

\documentclass[twocolumn]{jarticle}
multicol004
[上のソースファイル]

\documentclass[twocolumn]{jarticle}
\makeatletter
\newcommand{\figcaption}[1]{\def\@captype{figure}\caption{#1}}
\newcommand{\tblcaption}[1]{\def\@captype{table}\caption{#1}}
\makeatother
を入れて、図と表のキャプションを追加。
multicol004
[上のソースファイル]

\documentclass[twocolumn]{jarticle}
 \begin{figure*}\begin{table*}を利用。
multicol004
[上のソースファイル]

[表組み] [例 --1] [例 -- 2] [例 -- 3]


@

To the TeX Page
TeX

@