Tex MEMO

履歴

  • 2016-07-06 高橋芳幸 新規作成
  • 2020-05-07 高橋芳幸 bibtex について追記

TeX に pdf ファイルを取り込む方法

プリアンブルに以下を書く.

\usepackage[dvipdfmx]{graphicx}

画像の引用は ps と同じように. 例えば:

\begin{figure}[htbp]
  \begin{center}
    \includegraphics[angle=-90,width=10cm]{fig.pdf}
    \caption{Figure}
  \end{center}
\end{figure}

ただし, コンパイル時には --shell-escape オプションが必要かもしれない.

Dennou6 style との共存

Dennou6.sty を使いたいときは,

\documentclass[dvipdfmx]{jreport}
\usepackage{Dennou6}

としないといけないらしい.

TeX でハイパーリンクを有効にする方法

プリアンブルに以下を書く.

\usepackage[dvipdfmx,hidelinks]{hyperref}
%\AtBeginDvi{\special{pdf:tounicode EUC-UCS2}}
\usepackage{pxjahyper}

URL を書くときの注意

url パッケージを使った方が良いらしい.

プリアンブルに以下を書く.

\usepackage{url}

URL の引用には下のように書く

\url{http://www.xxx.yyy.zzz/}

参考ページ

bibtex

参考文献情報の記述

bibliography ファイル (例えば references.bib) に下のようなことを書く.

@article{
  Baranov-etal2004,
  author = "Baranov, Y. I. and W. J. Lafferty and G. T. Fraser",
  title = "Infrared spectrum of the continuum and dimer absorption in the vicinity of the O$_2$ vibrational fundamental in O$_2$/CO$_2$ mixtures",
  journal = "J. Mol. Spectrosc.",
  volume = "228",
  pages = "432-440",
  doi = "10.1016/j.jms.2004.04.010",
  year = "2004"
}

@book{
  Pierrehumbert2010,
  author = "Pierrehumbert, R. T.",
  title = "Principles of Planetary Climate",
  publisher = "Cambridge University Press",
  year = "2010"
}

@inbook{
  Titov-etal2007,
  author = "Titov, D. V. and M. Bullock and D. Crisp and N. Renno and F.W. Taylor and L.V. Zasova",
  chapter = "Radiation in the Atmosphere of Venus",
  booktitle = "Exploring Venus as Terrestrial Planet",
  editor = "L. W. Esposito and E. R. Stofan and T. E. Cravens",
  series = "AGU Geophysical Monograph",
  volume = "176",
  pages = "121-138",
  year = "2007"
}

TeX ファイルへの取り込み

TeX ファイルに下のように書く (下の例は references.bib).

\bibliography{references}

文章中の引用

本文中に下のように書く.

This is shown by \citeA{Gruszka-Borysow1997}.
This is a test \cite{Baranov-etal2004}.
This is a test \cite<e.g.,>{Baranov-etal2004}.

コンパイル

下の例は main.tex.

$ platex main.tex
$ pbibtex main.aux
$ platex main.tex
$ dvipdfmx main.dvi

書式変更など

参考ページ

protect

コマンド中で別のコマンドが効かない (エラーになる) ことがある. そんな時はエラーになるコマンドの前に

\protect

を入れるとそれとなく動くこともある.

あるいは

こんな方法を使うとか.

trackchanges style file

ダウンロード元

使い方

詳細は <URL:http://trackchanges.sourceforge.net/help_stylefile.html> を参照の事.

パッケージ宣言

\usepackage[footnotes]{trackchanges} % default

または

\usepackage[margins]{trackchanges}

または

\usepackage[inline]{trackchanges}

または

\usepackage[finalold]{trackchanges}

または

\usepackage[finalnew]{trackchanges}

編集者宣言

\addeditor{yot}

コマンド

  • 変更

    \change[yot]{old text}{new text}
  • 追記

    \add[yot]{text}

注意

コマンド中で別のコマンドが効かない (エラーになる) ことがある. そんな時はエラーになるコマンドの前に

\protect

を入れるとそれとなく動くこともある. また, \protect を使う場合は, その後の \add, \change, ... などを含めて {} で囲う方が良いこともある. (囲うとエラーが出ることもある.)

ファイル間の相互参照

一つのファイル内で参照するときには, 参照される側 (file2.tex) に

\label{test}

を書いて, 参照する側 (file1.tex) の参照箇所で,

\ref{test}

とすればよい.

異なるファイル間で参照するときには, 参照される側は上と同じようにし, 参照する側 (file1.tex) のファイルのプリアンブルに

\usepackage{nameref}
\usepackage{zref-xr}
\zxrsetup{toltxlabel}
\zexternaldocument*[file2:]{file2}

を加え,

\ref{file2:test}

として参照する.

ここで, "file2:" は \zexternaldocument*[file2:] で指定している.

file2.tex からも file1.tex 内のラベルを参照する場合には, file2.tex のプリアンブルに上記に相当するものを書く.

参考ページ