2011-01-17 2 views
1

それを使用することができるように定義された方程式の変数は、式 E =メートルの*のC^2 がある今、私は、各変数を定義したいと c = ..... これは、方程式環境を使用して実現できます。 しかし、質問は、私が\ makeglossaryを使うときに自動的に用語集に追加されるように、e、m、およびcを定義する方法はありますか? glossariesパッケージを使用ラテックス: 、 E = .. メートル= ..:makeglossaryは

答えて

3

、我々はそうのように、それを表示すると同時に、用語集エントリを定義するコマンドを記述することができます。

\documentclass{report} 

\usepackage[colorlinks]{hyperref} 
\usepackage{glossaries} 
\makeglossaries 

\newcommand{\mathgloss}[2]{ 
    \newglossaryentry{#1}{name={#1},description={#2}} 
    \gls{#1} = #2 
} 

\begin{document} 

Consider the equation 
\begin{equation} 
e = m * c^2 
\end{equation} 
in which\\ 
\mathgloss{e}{energy}\\ 
\mathgloss{m}{mass}\\ 
\mathgloss{c}{speed of light} 

\printglossaries 

\end{document} 

はあなたがお好みのフォーマットスタイルにマッチする\mathglossコマンドを編集することができます。