summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/miller/miller.sty
blob: 608be0dcdd8bf122569921a768977e0e34c4e740 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
%%
%% This is file `miller.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% miller.dtx  (with options: `package')
%% 
%%   miller package
%% 
%%   Copyright 2003, 2004 Harald Harders, Bj"orn Pedersen
%% 
%%   This program can be redistributed and/or modified under the terms
%%   of the LaTeX Project Public License Distributed from CTAN
%%   archives in directory macros/latex/base/lppl.txt; either
%%   version 1.3 of the License, or any later version.
%% 
%%   h.harders@tu-bs.de
%%   bjoern.pedersen@frm2.tum.de
%% 
\ProvidesPackage{miller}
  [2004/09/20 v1.2 print miller indices]
\newcommand*\millerskip{\,}
\newcommand*\millerminus{\overline}
\def\@millerno#1 #2\@empty{%
  \xdef\miller@secondarg{#2}%
  \ifx\@empty\miller@secondarg
    \@@@millerno#1#2\@empty\@empty\@empty
  \else
    \@@millerno#1 #2\@empty
  \fi
}%
\def\@checkminus#1#2\@empty{%
  \ifx-#1%
    \begingroup
    \edef\@tempa{#2}%
    \edef\@tempb{}%
    \ifx\@tempa\@tempb
      \PackageError{miller}{%
        \string\hkl\space command contains a single minus}{No entry of
        the \string\hkl\space command may consist only of a minus.}%
      #1%
    \else
      \millerminus{\vphantom{b}#2}%
    \fi
    \endgroup
  \else
    #1#2%
  \fi
}
\def\@@millerno#1 #2{%
  \ifx\@empty#2%
    \let\next\relax
  \else%
    \let\next\@@millerno
  \fi%
  \@checkminus#1\@empty
  \ifx\@empty#2\else\millerskip\fi
  \next #2%
}
\def\@@@millerno#1#2#3{%
  \ifx-#1
    \millerminus{\vphantom{b}#2}%
    \def\miller@nextarg{#3}%
    \ifx\@empty#3%
      \let\next\relax
      \@tempswafalse
      \ifx-#2 \@tempswatrue\fi
      \ifx\@empty#2 \@tempswatrue\fi
      \if@tempswa
        \PackageError{miller}{%
          Last character of \string\hkl\space command is a minus}{The
          last character may not be a minus.}%
      \fi
    \else%
      \let\next\@@@millerno
      \millerskip
    \fi%
  \else
    #1%
    \def\miller@nextarg{#2#3}%
    \ifx\@empty#2%
      \let\next\relax
      \ifx-#1
        \PackageError{miller}{%
          Last character of \string\hkl\space command is a minus}{The
          last character may not be a minus.}%
      \fi
    \else%
      \let\next\@@@millerno
      \millerskip
    \fi%
  \fi
  \expandafter\next\miller@nextarg
}
\def\hkleckig[#1]{\ensuremath{[\@millerno#1 \@empty]}}
\def\hklrund(#1){\ensuremath{(\@millerno#1 \@empty)}}
\def\hklspitz<#1>{\ensuremath{\langle\@millerno#1 \@empty\rangle}}
\def\hklgeschweift#1{\ensuremath{\{\@millerno#1 \@empty\}}}
\DeclareRobustCommand*\hkl{%
  \@ifnextchar[{\hkleckig}{%
    \@ifnextchar({\hklrund}{%
      \@ifnextchar<{\hklspitz}{\hklgeschweift}}}}
\endinput
%%
%% End of file `miller.sty'.