- LATEX new command example to represent chemical elements
%chemical elements
%example
%\ele{Mg}{2}
%\ele{SF}{6}
\newcommand{\ele}[2]{$\mathrm{#1}_{#2}$}
Here
Command part - \ele
passing value to the command [2]
actual implementation starts $ to $
#1 - first input to the command
#2 - second input to the command
- Another simple Example
%resonance integrals
\newcommand{\oliHij}{
\begin{equation}\label{eq:resonanceIntegrals}
H_{ij} = \int \chi_{i} H \chi_{j} dv
\end{equation}}
- Example to use matrix in the equation and within the command
\newcommand{\SecEq}{\begin{equation}\label{eq:SecularEquation}
\begin{Vmatrix}
H_{11} - \epsilon S_{11} & H_{21} - \epsilon S_{21} & H_{31} - \epsilon S_{31} &... & H_{n1} - \epsilon S_{n1} \\
H_{12} - \epsilon S_{12} & H_{22} -\epsilon S_{22} & H_{32} - \epsilon S_{32} &... & H_{n2} - \epsilon S_{n2} \\
H_{13} - \epsilon S_{13} & H_{23} -\epsilon S_{23} & H_{33} - \epsilon S_{33} &... & H_{n3} - \epsilon S_{n3} \\
. & . & . &... & . \\ . & . & . &... & . \\ . & . &. & ... & . \\
H_{1n} - \epsilon S_{1n} & H_{2n} - \epsilon S_{2n} & H_{3n} - \epsilon S_{3n} &... & H_{nn} - \epsilon S_{nn} \\ \end{Vmatrix} \begin{bmatrix}
C_{1}\\
C_{2}\\
C_{3}\\
.\\
.\\
.\\
C_{n}\\
\end{bmatrix}=0
\end{equation}}
No comments:
Post a Comment