%%
%% The following commands and command groups are only used
%% for abbreviating the typing work of the documentation.
%%
%% Special thanks to Dan Luecking who suggested to add a \kern0pt
%% after \exa and \exb; without these, pdfelatex and elatex would
%% result in a different page layout!
%%
\newcommand\exa{\nopagebreak \begin{flushleft}\smallskip \nopagebreak
                \begin{minipage}[t]{6cm}\sloppy\kern0pt}%
\newcommand\exb{\end{minipage}\kern 1cm\begin{minipage}[t]{8cm}\sloppy\kern0pt}%
\newcommand\exc{\end{minipage}\kern -3cm \smallskip\end{flushleft}}%
%
%\renewcommand{\MonTeX}{Mon\TeX\ \textsf{Mongolian for \LaTeX}}
%
% The commands \cmd and \cmda take one argument, check whether
% they've seen it before, and if not, create a label with the
% argument's name. Otherwise, they confine themselves to putting the
% argument in the margin and making it stand out \texttt-like, which
% is the default behaviour even if a label is defined.
%
% The difference between \cmd and \cmda is simple. \cmd accepts a
% command name _without_ the leading backslash and prints it with
% backslash. \cmda takes _arguments_ to other commands, environments
% etc.
%
% The code was inspired by the acronym package.
%
\newcommand{\cmd}[1]{%
	\expandafter\ifx\csname cmd@#1\endcsname\relax
		\expandafter\gdef\csname cmd@#1\endcsname{#1}%
		\label{cmd:#1}
		% (new label: #1)
	\else
		% (label #1 already defined, do nothing!)
	\fi
	\texttt{\char92 #1}%
	\marginpar{\texttt{\char92 #1}}%
}
%
\newcommand{\cmda}[1]{%
	\expandafter\ifx\csname cmda@#1\endcsname\relax
		\expandafter\gdef\csname cmda@#1\endcsname{#1}%
		\label{a:#1}
		% (new label: a:#1)
	\else
		% (label #1 already defined, do nothing!)
	\fi
	\texttt{#1}%
	\marginpar{\texttt{#1}}%
}
%
\newcommand{\refcmd}[1]{%
	\texttt{\char92 #1}
	(see section~\ref{cmd:#1}, page~\pageref{cmd:#1})
}
%
\newcommand{\refcmda}[1]{%
	\texttt{#1}
	(see section~\ref{a:#1}, page~\pageref{a:#1})
}
%
\ifthenelse{\value{GreekGammaAvailable}=1}{%
	\def\IfG#1{#1}%
	}
	{\def\IfG#1{}%
	}
%
\newcommand{\Soyombo}{\textsc{Soyombo}}
\newcommand{\Zanabazar}{\textsc{Zanabazar}}
\newcommand{\XD}{\textsc{X\"awt\"a\"a D\"orw\"oljin}}
\newcommand{\LMA}{\textsf{LMA}}
\newcommand{\LMC}{\textsf{LMC}}
\newcommand{\LMO}{\textsf{LMO}}
\newcommand{\LMS}{\textsf{LMS}}
\newcommand{\LMT}{\textsf{LMT}}
\newcommand{\LMU}{\textsf{LMU}}
\newcommand{\LMX}{\textsf{LMX}}
\newcommand{\Tone}{\textsf{T1}}
\newcommand{\Ttwo}{\textsf{T2}}
\newcommand{\TW}{{\mnr S\"UXBAT}}
\newcommand{\WT}{{\rnm S\"UXBAT}}
\newcommand{\Tw}{{\mnr S\"uxbat}}
\newcommand{\Wt}{{\rnm S\"uxbat}}
\newcommand{\WtSh}{{\rnm S\"uxbat \IfG{\Sh a\g dur}}}

\newcommand{\ff}[1]{\fontfamily{#1}}
\newcommand{\fs}[1]{\fontseries{#1}}
\newcommand{\fsh}[1]{\fontshape{#1}}

\newcommand{\tttt}[1]{\texttt{\char92#1}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
% The Captions List is helpful for presenting the captions in
% various languages.
%
\newcommand{\CaptionsList}[1]{%
	\begin{center}
	\begin{tabular}{l|l|l}
	 Command			& English	& #1 \\
	 \hline
	 \tttt{prefacename}	& Preface	& \prefacename\\
	 \tttt{refname}		& References	& \refname\\
	 \tttt{abstractname}	& Abstract	& \abstractname\\
	 \tttt{bibname}		& Bibliography	& \bibname\\
	 \tttt{chaptername}	& Chapter	& \chaptername\\
	 \tttt{appendixname}	& Appendix	& \appendixname\\
	 \tttt{contentsname}	& Contents	& \contentsname\\
	 \tttt{listfigurename}	& List of Figures& \listfigurename\\
	 \tttt{listtablename}	& List of Tables& \listtablename\\
	 \tttt{indexname}	& Index		& \indexname\\
	 \tttt{figurename}	& Figure	& \figurename\\
	 \tttt{tablename}	& Table		& \tablename\\
	 \tttt{partname}	& Part		& \partname\\
	 \tttt{enclname}	& encl		& \enclname\\
	 \tttt{ccname}		& cc		& \ccname\\
	 \tttt{headtoname}	& To		& \headtoname\\
	 \tttt{pagename}	& Page		& \pagename\\
	 \tttt{seename}		& see		& \seename\\
	 \tttt{alsoname}	& see also	& \alsoname\\
	 \end{tabular}
	\captionsenglish
	\caption{Captions in #1%
		\label{#1captions}}
	\end{center}%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 
% The following command creates the structure of each entry in the
% Command Reference.
%
\newcommand{\MyEnvironment}[8]{%
	\hrule
	\section[\texttt{\hskip1em#1}]%
		{\texttt{#1}}% Command Name
	\begin{description}
	\ifthenelse{\equal{#2}{-}}%
		{}{\item [Synopsis] \texttt{#1}#2}
	\item [Function] \emph{(Environment \emph{or} Option) }#3	% Function
	\ifthenelse{\equal{#5}{-}}%
		{}{\item [Limitations] #5}	% Limitations
	\ifthenelse{\equal{#6}{-}}%
		{}{\item [Comments] #6}	% Comments
	\ifthenelse{\equal{#7}{-}}%
		{}{\item [Related commands] \texttt{#7}}% See also
	\ifthenelse{\equal{#8}{-}}%
		{}{\item [See page] \pageref{#8}}% See page
	\ifthenelse{\equal{#4}{-}}%
		{}{\item [Example]}
	\end{description}
	\ifthenelse{\equal{#4}{+}}{\vspace{-6mm}}{}%
	}
%
\newcommand{\MyCommand}[8]{%
	\hrule
	\section[\hskip1em\tttt{#1}]%
		{\tttt{#1}}% Command Name
	\begin{description}
	\ifthenelse{\equal{#2}{-}}%
		{}{\item [Synopsis] \tttt{#1}#2}
	\item [Function]  \emph{(Command) }#3	% Function
	\ifthenelse{\equal{#5}{-}}%
		{}{\item [Limitations] #5}	% Limitations
	\ifthenelse{\equal{#6}{-}}%
		{}{\item [Comments] #6}	% Comments
	\ifthenelse{\equal{#7}{-}}%
		{}{\item [Related commands] \texttt{#7}}% See also
	\ifthenelse{\equal{#8}{-}}%
		{}{\item [See page] \pageref{#8}}% See page
	\ifthenelse{\equal{#4}{-}}%
		{}{\item [Example]}
	\end{description}
	\ifthenelse{\equal{#4}{+}}{\vspace{-6mm}}{}%
	}
%
\endinput
%
% The file mtdocmac.tex ends here. Do not expect any secret to
% follow!
%
% OC, Berlin, Beijing, Ulaanbaatar 2001
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

