TeX スタイルファイルmemo


LaTeX209 スタイル・ファイルのページで手にいれた「tree.sty」だが, サンプルが分かりづらい.なのでここにmemo.

treetest.tex

\documentstyle[tree]{article}
\newcommand{\sstack}[1]{\fbox{\shortstack{#1}}}
\newcommand{\treeroot}[2]{\tree \sstack{#1}#2 \endtree}
\newcommand{\branch}[2]{\subtree \sstack{#1}#2 \endsubtree}
\newcommand{\LEAF}[1]{\leaf{\sstack{#1}}}
\begin{document}

\tree \shortstack{Animal}
 \subtree \shortstack{Bird}
   \leaf{\shortstack{Penguin\\Cardinal}}
   \leaf{\shortstack{Ostrich}}
   \leaf{\shortstack{Robin}}
 \endsubtree
 \subtree \shortstack{Mammal}
   \leaf{\shortstack{Human Being}}
   \subtree \shortstack{Dog}
      \leaf{\shortstack{Sheep Dog}}
      \leaf{\shortstack{Dachshund}}
   \endsubtree
   \leaf{\shortstack{Cat}}
 \endsubtree
\endtree

\treeroot{Animal}
 {\branch{Bird}
   {\LEAF{Penguin\\Cardinal}
    \LEAF{Ostrich}
    \LEAF{Robin}}
  \branch{Mammal}
   {\LEAF{Human Being}
    \branch{Dog}{\LEAF{Sheep Dog}
                 \LEAF{Dachshund}}
    \LEAF{Cat}}}
\end{document}
四角で囲まれるかが違うだけで、上と下は同じ。 下の方が書いている量が少ないけど, 上の方が分かりやすいと思う。 (\LEAFくらいは使ってもよいかもしれないけど、 突然大文字がでてくる違和感は拭えないよなあ。)

見出しを変える

「jreport」で修論書いていて,教授がsubsubsectionでも 番号をつけろ,といってきた. うーん,手でつけようか.. でもそれじゃあ美しくない.. ということで探してみました.

節の見 だしを変えたいで紹介してました. いいね.

\subsubsectionの再定義 /
\renewcommand{\subsubsection}[1]{%
\refstepcounter{subsubsection}%
\addcontentsline{toc}{subsubsection}{%
\protect\numberline{\thesubsubsection}#1}%
\par\vspace{.5em plus.2em
minus.2em}{\large\bfseries%
\noindent{}{\arabic{chapter}.\arabic{section}.\arabic{subsection}.%
\arabic{subsubsection} #1}}%
\vspace{.2em plus.1em}%
}%


Honkusa Keshi kenstarkenstar.org