1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

environment環境を用いた図・式挿入環境の簡略表記

Last updated at Posted at 2018-03-14

卒業論文の執筆をし,よく使うLaTeX環境を自己定義環境で簡略表記できないかと思案.とりあえず式と図でうまくいったのでまとめておく.

#図
\begin{document}より前に

shiki.tex
\newenvironment{shiki}[2]{\begin{equation} #1 \label{eq:#2}}{\end{equation}}

と記述.引数は式の内容(#1)とラベル(#2)

本文中では,

shiki.tex
\begin{shiki}{式の中身}{ラベル名}
\end{shiki}

のように書けばよい.

#図
同様に,プリアンブル部に

zu.tex
\newenvironment{zu}[4]
{\begin{figure}[H] \centering \includegraphics 
[width=#1,pagebox=mediabox,clip,keepaspectratio]{#2} 
\caption{#3} \label{fig:#4}}{\end{figure}}

と記述.引数は幅(#1),図のディレクトリ(#2),キャプション名(#3),ラベル(#4)

本文では

zu.tex
\begin{zu}{}{図のディレクトリ}{キャプション}{ラベル}
\end{zu}

とすればうまくいく.

式の"eq:"の部分や図のバウンディングボックス,アスペクト比の維持などの指定をいちいち書かなくてよくなる分は効率化が図られる(?)

#参考文献
[改訂第7版]LaTeX2ε美文書作成入門

1
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?