How to draw up a slightly more complicated table with LaTeX

| コメント(0) | トラックバック(0)

I have recently and unfortunately run into the problems while making a slightly more complicated table with considerably varied vertical lines and horizontal lines using LaTeX. It may be presumptuous of me to comment on these debatable matters, but I intend to write down in this article how to solve some of them in the service of your society.

I compiled the table as is given below and the source code is also given below.

table0206

      source code: table0206.tex

\documentclass[11pt]{article}
\usepackage{hangcaption,array,multirow,hhline}
\parindent=0pt
\begin{document}
\begin{table}[h]
\begin{center}
\begin{sffamily}
\begin{large}
\captionwidth=0.9\textwidth
\newcommand{\captionfonts}{\large\bfseries}
\makeatletter
\long\def\@makecaption#1#2{%
\vskip\abovecaptionskip
\sbox\@tempboxa{{\captionfonts #1: #2}}%
\ifdim \wd\@tempboxa >\hsize
{\captionfonts #1: #2\par}
\else
\hbox to\hsize{\hfil\box\@tempboxa\hfil}%
\fi
\vskip\belowcaptionskip}
\makeatother
\hangcaption{\large\sffamily
\mdseries A Slightly More Complicated Example}\medskip
\newlength{\hheight}
\setlength{\hheight}{32pt}
\newlength{\gheight}
\setlength{\gheight}{20pt}
\newcommand{\bhline}[1]{\noalign{\hrule height #1}}
\newcommand{\bvline}[1]{\vrule width #1}
\renewcommand{\multirowsetup}{\centering}
\renewcommand{\arraystretch}{0.8}
\extrarowheight=15pt
\arraycolsep=0pt
$\hspace{7pt}\overbrace{\hspace{38pt}}^{\mbox{\normalsize65pt}}
\hspace{2pt}\overbrace{\hspace{10pt}}^{\mbox{\normalsize1.6pt}}
\hspace{2pt}
\overbrace{\hspace{38pt}}^{\mbox{\normalsize65pt}}\hspace{2pt}
\overbrace{\hspace{10pt}}^{\mbox{\normalsize1.6pt}}\hspace{2pt}
\overbrace{\hspace{38pt}}^{\mbox{\normalsize65pt}}\hspace{2pt}
\overbrace{\hspace{8pt}}\hspace{2pt}
\overbrace{\hspace{80pt}}^{\mbox{\normalsize100pt}}$\\
$\begin{array}{p{65pt}!{\bvline{1.6pt}}p{65pt}!{\bvline{1.6pt}}
p{65pt}||b{100pt}} \bhline{1.6pt}
\multicolumn{3}{p{198.2pt}||}{\mbox{\centerline{$\backslash
$multicolumn\{3\}\{p\{198.2pt\}\}\{\}}}} &
\multirow{3}{100pt}{\rule{0pt}{\hheight} \mbox{\centerline{$
\backslash$multirow}}}\\[11pt] \hhline{=:=:=#~}
\multicolumn{1}{c!{\bvline{1.6pt}}}{\multirow{2}{65pt}
{\rule{0pt}{\gheight} \mbox{\centerline{$\backslash
$multirow}}}} & \multicolumn{1}{p{65pt}!{\bvline{1.6pt}}}
{\mbox{\centerline{$\backslash$vrule}}} &
\multicolumn{1}{p{65pt}||}{\mbox{\centerline
{$\backslash$vrule}}} & \\[11pt] \cline{2-3}
& \mbox{\centerline{$\backslash$vrule}} &
\mbox{\centerline{$\backslash$vrule}} &
\\[11pt] \hhline{=::=::=#=}
\multicolumn{1}{p{65pt}||}{\mbox{\centerline{
$\backslash$hrule}}} & \multicolumn{1}{p{65pt}||}
{\mbox{\centerline{$\backslash$hrule}}} &
\multicolumn{1}{p{65pt}||}{\mbox{\centerline{
$\backslash$hrule}}} & \multicolumn{1}{p{100pt}}
{\mbox{\centerline{$\backslash$hhline}}}\\[11pt]
\bhline{1.6pt}
\end{array}$ \\
\end{large}
\end{sffamily}
\end{center}
\end{table}
\end{document}

At first, you could draw the vertical lines with varied thickness when you might use \vrule and you could draw the horizontal lines with varied thickness when you might use \hrule. The command lines are given below.

   \documentclass[11pt]{article}
   \usepackage{array}
   \begin{document}
   \newcommand{\bhline}[1]{\noalign{\hrule height #1}}
   \newcommand{\bvline}[1]{\vrule width #1}
   $\begin{array}{p{20pt}!{\bvline{1pt}}p{20pt}} \bhline{1pt}
   01 & 02 \\ \bhline{1pt}
   \end{array}$
   \end{document}

Secondly, you could put the double bottom lines on some cells when you might use \hhline. The command lines are given below.

   \documentclass[11pt]{article}
   \usepackage{array,hhline}
   \begin{document}
   $\begin{array}{p{20pt}||p{20pt}} \hhline{=#=}
   01 & 02 \\ \hhline{=#=}
   \end{array}$
   \end{document}

Thirdly, you could merge some cells in the same row when you might use \multicolumn and you could merge some cells in the same column when you might use \multirow. The command lines are given below.

   \documentclass[11pt]{article}
   \usepackage{array,multirow}
   \begin{document}
   $\begin{array}{p{20pt}|p{20pt}} \hline
   \multicolumn{2}{p{40.4pt}}{text} \\ \hline
   \multirow{2}{20pt}{\mbox{text}} &
   \multirow{2}{20pt}{\mbox{text}} \\
   & \\ \hline
   \end{array}$
   \end{document}

Finally I am happy to assist you in drawing up a slightly
more complicated table with the varied lines using LaTeX.

トラックバック(0)

トラックバックURL: http://www.suzuki-labor.com/mt/mt-tb.cgi/3176

コメントする

My Photo
プロフィール!
2016・11・15 改訂
spacer01
rssspacer01foaf
spacer01
atom.xml
spacer01

この記事について

このページは、Suzuki TakashiがFebruary 6, 2011 9:25 PMに書いた記事です。

ひとつ前の記事は「本調子ではない。」です。

次の記事は「現代中国に対する欧米の見方について一考察。」です。

最近のコンテンツはインデックスページで見られます。過去に書かれたものはアーカイブのページで見られます。

August 2023

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Recent Posts

月別 アーカイブ

Workbooks

  • Basic Word List
  • Basic Word List 3rd Edition
  • Samuel C. Brownstein (著), Mitchel Weiner (著), Sharon Weiner Green (著)
  • SAT、GRE用の語彙が2000語以上収録され、2009年4月に4th Editionが出版される。又、Synonym Testが750題、Comprehensive Testが75題付記されている。2005年8月に国内向けの訳本として『最強の英語ボキャブラリー1700語』が出版され、Synonym Testが500題、Comprehensive Testが50題付記されている。
  • 1100 Words You Need to Know
  • 1100 Words You Need to Know 4th Edition
  • Murray Bromberg (著), Melvin Gordon (著)
  • SAT用の語彙が920語、熟語が184語収録され、2008年6月に5th Editionが出版される。Review, 24題で1週分の知識の確認を、Analogy Review, 15~20題で10週分の確認を、Final Review Test, 150題で46週分の確認を行うことになる。1周しただけで定着する程簡単なものではなく、繰り返しが重要なことは他のボキャビル本と同様。音声教材として Wordplay: 550+ Words You Need to Know 2nd Edition が出されており、The Rambling Panthersから始まる7つのドラマに新出語句を散りばめている。
  • Kaplan Word Power
  • Kaplan Word Power 3rd Edition
  • Kaplan (著)
  • SAT、GRE用の語彙が750語収録され、Plug Inの10~15題で1課分の知識の確認を行うことになる。収録語彙の水準は類書よりやや高めで、Plug Inでの設問の尋ね方もやや高度なものになっている。具体的には Fill in the blanks. や Match the word closest to the word that means the opposite. といった形式に苦労した。又、音声教材として Kaplan Word Power (CD) があり、CD2枚の構成になっている。
  • Word Smart
  • Word Smart for the GRE, 2nd Edition
  • Princeton Review (著)
  • GRE用の語彙が678語収録され、Quick Quizは65課あり、6~15題で1課分の知識の確認を、Final Exam Drillの570題で57課分の確認を行うことになる。類書にSAT用のWord Smart、Word Smart Ⅱ等があり、それらを含めて繰り返し訓練するとなると、結構時間が掛かるのは当然だろう。又、音声教材としてSAT用だが The Princeton Review Word Smart CD があり、All or Nothingから始まる14のドラマに228語が散りばめられている。
spacer01

Banner


Bookmark

  • Valid XHTML 1.0 Transitionalspacer01
  • Valid CSS!spacer01
OpenID 対応しています OpenIDについて