diff options
Diffstat (limited to 'macros/latex/contrib/miller')
-rw-r--r-- | macros/latex/contrib/miller/ChangeLog | 16 | ||||
-rw-r--r-- | macros/latex/contrib/miller/Makefile | 81 | ||||
-rw-r--r-- | macros/latex/contrib/miller/README | 30 | ||||
-rw-r--r-- | macros/latex/contrib/miller/miller.dtx | 267 | ||||
-rw-r--r-- | macros/latex/contrib/miller/miller.ins | 25 | ||||
-rw-r--r-- | macros/latex/contrib/miller/miller.pdf | bin | 0 -> 276830 bytes | |||
-rw-r--r-- | macros/latex/contrib/miller/millertest.tex | 35 |
7 files changed, 454 insertions, 0 deletions
diff --git a/macros/latex/contrib/miller/ChangeLog b/macros/latex/contrib/miller/ChangeLog new file mode 100644 index 0000000000..d673074104 --- /dev/null +++ b/macros/latex/contrib/miller/ChangeLog @@ -0,0 +1,16 @@ +v1.2 2004/09/20 Harald Harders <h.harders@tu-bs.de> + - Make \hkl robust. + - Adapt Makefile to TeXLive 2004. + +v1.1 2004/04/07 Harald Harders <h.harders@tu-bs.de> + - Add a documentation. + - Bugfix: In some cases, arguments without space have been parsed + incorrectly. + - Bugfix: Detect isolated minus sign in argument with spaces. + +v1.0 2003/04/11 Harald Harders <h.harders@tu-bs.de>, + Björn Pedersen <bjoern.pedersen@frm2.tum.de> + - Changed \millerminus from \bar to \overline due to numbers with + more than one digit. + - Added support to arguments with space and numbers with more than + one digit. diff --git a/macros/latex/contrib/miller/Makefile b/macros/latex/contrib/miller/Makefile new file mode 100644 index 0000000000..6a6f057bb8 --- /dev/null +++ b/macros/latex/contrib/miller/Makefile @@ -0,0 +1,81 @@ + +SRCDIR=miller +TEXMF=`kpsewhich --expand-path='$$TEXMFLOCAL'` +INSTALLDIR=tex/latex/miller +DOCDIR=/doc/latex/miller +SOURCEDIR=/source/latex/miller +TEXLIVEDIR=texmf-dist +VERSION=`grep -e '\\[.*\\]' miller-v.tex | sed 's/ \\[[0-9/]* *\\([v0-9]*\\)\\.\\([0-9]*\\).*\\]/\\1_\\2/'` + + +.SUFFIXES: .sty .ins .dtx .pdf + +.ins.sty: + latex $< + +.dtx.pdf: + pdflatex $< + pdflatex $< + makeindex -s gind.ist $(*D)/$(*F) + makeindex -s gglo.ist -o $(*D)/$(*F).gls $(*D)/$(*F).glo + pdflatex $< + + +all: miller miller.pdf millertest.pdf ausgabe + +millertest.pdf: millertest.tex miller.sty + pdflatex millertest + + +miller: miller.sty + + + +clean: + @-rm -f miller.glo miller.gls miller.idx miller.ilg + @-rm -f miller.ind miller.aux miller.log miller.toc + @-rm -f millertest.log millertest.aux + @-rm -f *~ + +distclean: clean + @-rm -f miller.sty miller.pdf + @-rm -f millertest.pdf miller-v.tex + +tar: all clean + echo Lege miller-$(VERSION).tar.gz an + -rm -f miller-$(VERSION).tar.gz + tar czCf .. miller-$(VERSION).tar.gz \ + $(SRCDIR)/README \ + $(SRCDIR)/ChangeLog \ + $(SRCDIR)/Makefile \ + $(SRCDIR)/miller.dtx \ + $(SRCDIR)/miller.ins \ + $(SRCDIR)/miller.pdf \ + $(SRCDIR)/millertest.tex \ + $(SRCDIR)/miller.xml + +install: all + if [ ! -d $(TEXMF)/$(INSTALLDIR) ]; then mkdir -p $(TEXMF)/$(INSTALLDIR); else rm -f $(TEXMF)/$(INSTALLDIR)/*; fi + if [ ! -d $(TEXMF)/$(DOCDIR) ]; then mkdir -p $(TEXMF)/$(DOCDIR); else rm -f $(TEXMF)/$(DOCDIR)/*; fi + if [ ! -d $(TEXMF)/$(SOURCEDIR) ]; then mkdir -p $(TEXMF)/$(SOURCEDIR); else rm -f $(TEXMF)/$(SOURCEDIR)/*; fi + install -m644 miller.sty $(TEXMF)/$(INSTALLDIR) + install -m644 miller.pdf README ChangeLog $(TEXMF)/$(DOCDIR) + install -m644 miller.xml millertest.tex $(TEXMF)/$(DOCDIR) + install -m644 miller.dtx miller.ins $(TEXMF)/$(SOURCEDIR) + +texlive: all clean + rm -rf $(TEXLIVEDIR) + mkdir -p $(TEXLIVEDIR)/$(INSTALLDIR) + mkdir -p $(TEXLIVEDIR)/$(DOCDIR) + mkdir -p $(TEXLIVEDIR)/$(SOURCEDIR) + cp miller.sty $(TEXLIVEDIR)/$(INSTALLDIR) + cp miller.pdf README ChangeLog $(TEXLIVEDIR)/$(DOCDIR) + cp miller.xml millertest.tex $(TEXLIVEDIR)/$(DOCDIR) + cp miller.dtx miller.ins $(TEXLIVEDIR)/$(SOURCEDIR) + +ausgabe: + @echo "Please copy miller.sty to a directory" + @echo "in the LaTeX search path" + +miller.sty: miller.ins miller.dtx + diff --git a/macros/latex/contrib/miller/README b/macros/latex/contrib/miller/README new file mode 100644 index 0000000000..bdb7859c71 --- /dev/null +++ b/macros/latex/contrib/miller/README @@ -0,0 +1,30 @@ +miller.sty +========== + +Typeset miller indices, e.g., <1-20>, used in +material sicence with an easy syntax. +Minus signs are printed as bar above the corresponding number. + + +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. + + +Installation: + +automatic: - run make install + - run texhash or the corresponding command of your distribution + +by hand: - execute latex on miller.ins + - execute latex on miller.dtx (2x) + - copy miller.sty to a place LaTeX can find it + - run texhash or the corresponding command of your distribution + + +2004/09/20 +Harald Harders +h.harders@tu-bs.de diff --git a/macros/latex/contrib/miller/miller.dtx b/macros/latex/contrib/miller/miller.dtx new file mode 100644 index 0000000000..c2ce678c5e --- /dev/null +++ b/macros/latex/contrib/miller/miller.dtx @@ -0,0 +1,267 @@ +% \iffalse meta comment +% File: miller.dtx Copyright (C) 2003, 2004 Harald Harders, Bj"orn Pedersen +% \fi +% +% \iffalse +%<*driver> +\documentclass{ltxdoc} +\usepackage[T1]{fontenc} +\title{The \texttt{miller} package} +\author{Harald Harders (\texttt{h.harders@tu-bs.de})\\ + Bj\"orn Pedersen (\texttt{bjoern.pedersen@frm2.tum.de})} +\date{Version \fileversion, \filedate} +\EnableCrossrefs +\CodelineIndex +\DoNotIndex{\def,\edef,\let,\newcommand,\newenvironment,\newcounter} +\DoNotIndex{\setcounter,\space} +\CodelineNumbered +\RecordChanges +\CheckSum{159} +\IfFileExists{miller-v.tex}{% + \input{miller-v.tex} + \GetFileInfo{miller-v.tex} +}{% + \PackageError{miller}{File miller-v.tex not found, + please\MessageBreak + run `latex miller.ins' first}{No additional help}% + \def\fileversion{\textbf{??}}% + \def\filedate{\textbf{??}}% +} +\usepackage{miller} +\begin{document} + \DocInput{miller.dtx} +\end{document} +%</driver> +% \fi +% +% \changes{1.0}{2003/04/11}{Changed \cs{millerminus} from \cs{bar} to +% \cs{overline} due to numbers with more than one digit (HH, BP).}% +% \changes{1.0}{2003/04/11}{Added support to arguments with space and +% numbers with more than one digit (HH, BP).}% +% \changes{1.1}{2004/04/07}{Bugfix: In some cases, arguments without +% space have been parsed incorrectly (HH).}% +% \changes{1.1}{2004/04/07}{Bugfix: Detect isolated minus sign in +% argument with spaces (HH).}% +% \changes{1.1}{2004/04/07}{Add a documentation (HH).}% +% +% \maketitle +% \begin{abstract} +% \noindent +% Typeset miller indices, e.g., $\langle 1\bar20\rangle$, used in +% material sicence with an easy syntax. +% Minus signs are printed as bar above the corresponding number. +% \end{abstract} +% +% \tableofcontents +% +% \section*{Copyright} +% 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. +% +% \section{The user interface} +% +% To use this package place +%\begin{verbatim} +%\usepackage{miller} +%\end{verbatim} +% in the preamble of your document. +% +% \DescribeMacro{\hkl}% +% The \cs{hkl} macro can be used in different ways. +% Its argument is surrounded by the parantheses that you want to +% appear in the document. +% If the argument contains spaces, they are taken as delimiters +% between the different components of the hkl vector. +% If no spaces are given, each component has exactly one digit (plus +% eventually a preceeding minus sign). +% The usage is shown with some examples. +% +% \medskip\noindent +% Specify one direction in space: +%\begin{verbatim} +%\hkl[1 12 3], \hkl[-1 0 -12], \hkl[1 11 -2 0]\\ +%\hkl[123], \hkl[-10-2], \hkl[11-20] +%\end{verbatim} +%\begin{quote} +%\hkl[1 12 3], \hkl[-1 0 -12], \hkl[1 11 -2 0]\\ +%\hkl[123], \hkl[-10-2], \hkl[11-20] +%\end{quote} +% Specify all equal directions in space: +%\begin{verbatim} +%\hkl<1 12 3>, \hkl<-1 0 -12>, \hkl<1 11 -2 0>\\ +%\hkl<123>, \hkl<-10-2>, \hkl<11-20> +%\end{verbatim} +%\begin{quote} +%\hkl<1 12 3>, \hkl<-1 0 -12>, \hkl<1 11 -2 0>\\ +%\hkl<123>, \hkl<-10-2>, \hkl<11-20> +%\end{quote} +% Specify one plane in space: +%\begin{verbatim} +%\hkl(1 12 3), \hkl(-1 0 -12), \hkl(1 11 -2 0)\\ +%\hkl(123), \hkl(-10-2), \hkl(11-20) +%\end{verbatim} +%\begin{quote} +%\hkl(1 12 3), \hkl(-1 0 -12), \hkl(1 11 -2 0)\\ +%\hkl(123), \hkl(-10-2), \hkl(11-20) +%\end{quote} +% Specify all equal planes in space: +%\begin{verbatim} +%\hkl{1 12 3}, \hkl{-1 0 -12}, \hkl{1 11 -2 0}\\ +%\hkl{123}, \hkl{-10-2}, \hkl{11-20} +%\end{verbatim} +%\begin{quote} +%\hkl{1 12 3}, \hkl{-1 0 -12}, \hkl{1 11 -2 0}\\ +%\hkl{123}, \hkl{-10-2}, \hkl{11-20} +%\end{quote} +% +% The first version (with spaces) allows indices with more than one +% digit, while the second one is shorter in the source code. +% +% The symbol used for the bar is changeable by redefining the +% \cs{millerminus} command, e.g., +%\begin{verbatim} +%\usepackage{ushort} +%\ushortCreate:\overline{oshort} +%\renewcommand\millerminus{\oshort} +%\end{verbatim} +% +% The space between numbers can be changed, e.g., +%\begin{verbatim} +%\hkl<123>\\ +%\renewcommand\millerskip{\;}\hkl<123>\\ +%\renewcommand\millerskip{,\,}\hkl<123>\\ +%\renewcommand\millerskip{}\hkl<123> +%\end{verbatim} +%\begin{quote} +%\hkl<123>\\ +%\renewcommand\millerskip{\;}\hkl<123>\\ +%\renewcommand\millerskip{,\,}\hkl<123>\\ +%\renewcommand\millerskip{}\hkl<123> +%\end{quote} +% +% \StopEventually{\PrintChanges \PrintIndex} +% +% \section{The implementation} +% +% Heading of the package: +% \begin{macrocode} +%<package>\ProvidesPackage{miller} +%<version>\ProvidesFile{miller-v.tex} +%<package|version> [2004/09/20 v1.2 print miller indices] +%<*package> +% \end{macrocode} +% Define command for space between numbers. +% \begin{macrocode} +\newcommand*\millerskip{\,} +% \end{macrocode} +% Define the command for the minus. +% \begin{macrocode} +\newcommand*\millerminus{\overline} +% \end{macrocode} +% Check for space in argument. +% \begin{macrocode} +\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 +}% +% \end{macrocode} +% Parse for minus sign. +% \begin{macrocode} +\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 +} +% \end{macrocode} +% Parse the argument (with spaces). +% \begin{macrocode} +\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% +} +% \end{macrocode} +% Parse the argument (without spaces). +% \begin{macrocode} +\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 +} +% \end{macrocode} +% Commands for the different types. +% \begin{macrocode} +\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\}}} +% \end{macrocode} +% \begin{macro}{\hkl} +% \changes{1.2}{2004/09/20}{Make \cs{hkl} robust}% +% The command itself. +% \begin{macrocode} +\DeclareRobustCommand*\hkl{% + \@ifnextchar[{\hkleckig}{% + \@ifnextchar({\hklrund}{% + \@ifnextchar<{\hklspitz}{\hklgeschweift}}}} +%</package> +% \end{macrocode} +% \end{macro} +% +% \Finale diff --git a/macros/latex/contrib/miller/miller.ins b/macros/latex/contrib/miller/miller.ins new file mode 100644 index 0000000000..cf7ca50ad9 --- /dev/null +++ b/macros/latex/contrib/miller/miller.ins @@ -0,0 +1,25 @@ +\input docstrip.tex +\preamble + + 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 + +\endpreamble + +\askforoverwritefalse + +\generate{% + \file{miller.sty}{\from{miller.dtx}{package}}% + \file{miller-v.tex}{\from{miller.dtx}{version}}% +} + +\endbatchfile diff --git a/macros/latex/contrib/miller/miller.pdf b/macros/latex/contrib/miller/miller.pdf Binary files differnew file mode 100644 index 0000000000..f14f38eef5 --- /dev/null +++ b/macros/latex/contrib/miller/miller.pdf diff --git a/macros/latex/contrib/miller/millertest.tex b/macros/latex/contrib/miller/millertest.tex new file mode 100644 index 0000000000..d0628e594f --- /dev/null +++ b/macros/latex/contrib/miller/millertest.tex @@ -0,0 +1,35 @@ +\documentclass{article} +\usepackage{miller} + +%\renewcommand\millerskip{\;} + +\listfiles + +\begin{document} + +\hkl[1 1 0] +\hkl[110] + +\hkl[1 -1 0] +\hkl[1-10] + +\hkl[1 -1 0 2] +\hkl[1-102] + +\hkl(1 -1 0) + +\hkl<1 2 -3> +\hkl<12-3> + +%\hkl<1 2 3 -> +%\hkl<123-> + +\hkl{-12 -1 0} + +\hkl{-a -b c} + +\hkl{-1 -1 21 0} +\hkl{-1 -1 21 -0.5} + + +\end{document} |