LoginSignup
0
0

More than 5 years have passed since last update.

RefTeXで自前のfigure環境を参照する

Last updated at Posted at 2015-01-11

YaTeX+RefTeXで文章を書いていて、自前のfigure環境やtable環境は、RefTeXで読み込めないことに気がつきました。Google先生に聞いてみたところ、自前の命令を読み込む方法は見つかりましたが、環境に関する記述を見つけることが出来ませんでした。

マニュアルをきちんと読むのは面倒だったので、ソースをコピペして少し変えたところ、動いてくれたのでメモ。

設定

以下のコードを.emacsに記述すれば、RefTeXは、myfigure環境をfigure環境と同等に扱ってくれます。

(setq reftex-label-alist
      '(("myfigure" ?f "mfig:" "~\\ref{%s}" caption)))

table環境も追加したい場合は以下のとおりです。

(setq reftex-label-alist
      '(("myfigure" ?f "mfig:" "~\\ref{%s}" caption)
        ("mytable" ?t "mtab:" "~\\ref{%s}" caption)))

環境にこだわった理由

includegraphixで効くYaTeXの補完が便利だったこと。
YaTeX使いでなければ newcommand した方がいい気がします。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0