Tipsいろいろ
忘れた時の為のコマンドのメモです。
解らない時は恐らく教科書なり説明書なり見た方が安全ですよ。
TeX
主にコピペ用
- 数式番号の変更(節.番号)
プリアンブル内
\makeatletter
\renewcommand{\theequation}{\thesection.\arabic{equation}}
\@addtoreset{equation}{section}
\makeatother
- 図とか貼るとき
プリアンブル内
\usepackage{graphics}
document内
\begin{figure}[h]
\begin{center}
\resizebox{横幅}{!}{\includegraphics{file.eps}}
\caption{}\label{}
\end{center}
\end{figure}
- 図とか貼って文章を回り込ませるとき
プリアンブル内
\usepackage{graphics}
\usepackage{wrapfig}
document内
\begin{wrapfigure}[行数]{r}{横幅}
\begin{center}
\resizebox{横幅}{!}{\includegraphics{file.eps}}
\caption{}\label{}
\end{center}
\end{wrapfigure}
- 参考文献
document内
\begin{thebibliography}{99}
\bibitem{chand}著者,
\newblock {\it 論文},
\newblock {\bf vol}, page (year).
\end{thebibliography}
参照
\cite{}
- ギリシャ文字ベクトル
数式内
\mbox{\boldmath$\alpha$}
プリアンブルに
\def\vect#1{\mbox{\boldmath$#1$}}
と定義すると、\vect{\alpha}で書ける。
- 行間隔
document内
\vspace{mm}
ページ初めから空白
\vspace*{mm}
- eqnarray中
&=&で式を並べるとき
\!\!\!\!&=&\!\!\!\!
式を分割するとき。さらに下のほうが長いとき
\lefteqn{数式} \nonumber \\
&& 続き
下のほうが短いとき
左辺\!\!\!\!&=&\!\!\!\!右辺 \nonumber \\
&& \quad 続き
大きめ括弧{分断時
\Bigl\{ 数式 \Bigr. \nonumber \\
\Bigl. 続き \Bigr\}
- 目次を作るとき
document内・目次を出したい場所
\tableofcontents
(\newpage)
さらに目次をいじるとき
.tocファイルをいじる
↓
プリアンブル内
\nofiles
- 目次にsubsubsectionまで出力
プリアンブル内
\setcounter{tocdepth}{3}
階層はこのように数値分けされてるらしい
\part : -1
\chapter : 0
\section : 1
\subsection : 2
\subsubsection : 3
\paragraph : 4
\subparagraph : 5
- ダブルスペース
プリアンブル内
\usepackage{doublespace}
その他パッケージ
- XyMTeX
epic.styをとる。
XyMTeXのぺーじからxymtx402.lzhをとり、解凍。
/usr/local/share/texmf/tex/latex/
に置く。
mktexlsr
で使えるようになるはず。
\usepackage{xymtex,chemist}
\bzdrv{}

化学式です。
- MEDIABB
pdfの図をepsのように貼るとき便利なスタイル。
ここを参考にして、mediabb.styをとる。
/usr/local/share/texmf/tex/latex/
に置く。
mktexlsr
でおわり。
\resizebox{横幅}{!}{\includegraphics{file.pdf}}
ができるようになります。
- 花文字
ここからmathrsfs.sty、ursfs.fdをとる。
/usr/local/share/texmf/tex/latex/
に置く。
もともとあるかも。
\usepackage{mathrsfs}
\mathscr{ABCDEFGH}

主にハミルトニアンですね。
mimeTeX
Web上で数式を印字。
cgiを使って画像を出してるみたい。
詳しくは
こちら。
上のページで試用できます。
例えばこんなの書けます。
=c(r)+\rho\int dr'c(|{\bf r}-{\bf r'}|)h(r'))
分数だっておてのもの。
=\frac{\partial\ln[\rho^{(1)}({\bf r}_1)/z^{\ast}({\bf r}_1)]}{\partial\rho^{(1)}({\bf r}_2)})
一応public_html以下に置いているので、
<img src="http://www.scc.kyushu-u.ac.jp/BioChemPhys/mimetex/mimetex.cgi?数式">
で使えます。
もちろん数式はTeXコマンドで。
省略用スクリプト
platex hoge.tex
dvipdfmx hoge.dvi
や、
dvips hoge.dvi
ps2epsi hoge.ps hoge.eps
の作業が面倒なときのためのスクリプト。
tex2pdf
----------
#!/bin/bash
if [ $# -ne 0 ]; then
if [ -f $1 ]; then
name=${1%.*}
platex $1
dvipdfmx ${name}.dvi
else
echo "tex2pdf: $1: no such file"
fi
else
echo "tex2pdf: no input files"
fi
----------
tex2eps
----------
#!/bin/bash
if [ $# -ne 0 ]; then
if [ -f $1 ]; then
name=${1%.*}
platex $1
dvips ${name}.dvi
ps2epsi ${name}.ps ${name}.eps
else
echo "tex2eps: $1: no such file"
fi
else
echo "tex2eps: no input files"
fi
----------