LoginSignup
12
10

More than 5 years have passed since last update.

Texで図○とか表○を自動で入れるコマンドの定義

Last updated at Posted at 2015-02-17

newcommandで定義する

\begin{document}の前に以下を定義

newcommand.tex
\newcommand\figref[1]{\textbf{図~\ref{fig:#1}}}
\newcommand\tabref[1]{\textbf{表~\ref{tab:#1}}}
  • 太字にしたくなかったら\textbfを消す

図のラベルは\label{fig:hoge},表のラベルは\label{tab:hoge}のように書いておく

使い方

sample.tex
\begin{figure}[ht]
    \begin{center}
    \includegraphics{./images/hoge.eps}
    \end{center}
    \caption{hoge}
    \label{fig:hoge}
\end{figure}

\figref{hoge}に○○を示す.

出力

%図が入る%
図1に○○を示す.
12
10
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
12
10