4

Hermann--Mauguin notation is used to define a naming scheme for three-dimensional space groups (aka crystallographic groups). A list of these groups together with their names can be found here. I would like to know how to typeset these names correctly.

Judging from the names presented in the International Tables for Crystallography (Vol. A), it seems that the first letter is printed in math mode, between each number there is a tiny bit of space, and the numbers are exactly the same size as the initial letter.

If I typeset the full name in math mode, the spacing is not correct and also the size of the letter and the other symbols is different. If I use text mode it's the same situation with the additional problem that the names are printed in bold face if used in a heading.

What's The Right Way to typeset Hermann-Mauguin notation?

1
  • I am sorry, but it is not clear to me what typeset output you are seeking. Nov 4, 2015 at 11:03

1 Answer 1

5

This might be a starting point: - denotes an overline above the next digit (multidigit numbers should be braced), * denotes the “fraction” with denominator m applied to the next digit, i denotes infinity.

\documentclass{article}

\newcommand{\hmn}[1]{% Hermann-Maguin notation
  \ensuremath{\begingroup\setupHMN #1\endgroup}%
}

\newcommand{\setupHMN}{%
  \doHMN{-}{\HMNoverline}%
  \doHMN{*}{\HMNminverse}%
  \doHMN{i}{\infty}
}

\newcommand{\doHMN}[2]{%
  \begingroup\lccode`~=`#1
  \lowercase{\endgroup\let~}#2%
  \mathcode`#1="8000
}

\newcommand{\HMNminverse}[1]{\frac{#1}{m}}
\newcommand{\HMNoverline}[1]{\mkern1mu\overline{\mkern-1mu#1\mkern-1mu}\mkern1mu}

\begin{document}

\hmn{-6}\quad
\hmn{*4}\quad
\hmn{8mm}\quad
\hmn{im}\quad
\hmn{-3 *2}\quad
\hmn{-4 2 m}\quad
\hmn{*i m}\quad
\hmn{-3m-2-{10}}

\[
\hmn{-6}\quad
\hmn{*4}\quad
\hmn{8mm}\quad
\hmn{im}\quad
\hmn{-3 *2}\quad
\hmn{-4 2 m}\quad
\hmn{*i m}\quad
\hmn{-3m-2-{10}}
\]

\end{document}

enter image description here

Second step, adding thin spaces between items

\documentclass{article}
\usepackage{xparse}

\ExplSyntaxOn

\NewDocumentCommand{\hmn}{m}
 {
  \ensuremath
   {
    \hermannmauguin_group:n { #1 }
   }
 }

\tl_new:N \l_hermannmauguin_input_tl
\tl_new:N \l_hermannmauguin_output_tl

\cs_new_protected:Nn \hermannmauguin_group:n
 {
  \tl_set:Nn \l_hermannmauguin_input_tl { #1 }
  \tl_clear:N \l_hermannmauguin_output_tl
  \tl_map_inline:Nn \l_hermannmauguin_input_tl
   {
    \__hermannmauguin_item:n { ##1 }
   }
  \! % kill the first \,
  \tl_use:N \l_hermannmauguin_output_tl
 }

\cs_new_protected:Nn \__hermannmauguin_item:n
 {
  \str_case:nnF { #1 }
   {
    {*}{ \__hermannmauguin_put:n { \__hermannmauguin_inverse:Nn } }
    {-}{ \__hermannmauguin_put:n { \__hermannmauguin_overline:Nn } }
    {i}{ \__hermannmauguin_put:n { \,\infty } }
   }
   { \__hermannmauguin_put:n { \, {#1} } }
 }

\cs_new_protected:Nn \__hermannmauguin_put:n
 {
  \tl_put_right:Nn \l_hermannmauguin_output_tl { #1 }
 }

\cs_new_protected:Nn \__hermannmauguin_overline:Nn
 {% #1 should be \,; #2 is the number to operate on
  #1 \mkern1mu\overline{\mkern-1mu#2\mkern-1mu}\mkern1mu
 }
\cs_new_protected:Nn \__hermannmauguin_inverse:Nn
 {% #1 should be \,; #2 is the number to operate on
  #1 \frac{ #2 } { m }
 }

\ExplSyntaxOff

\begin{document}

\hmn{-6}\quad
\hmn{*4}\quad
\hmn{8mm}\quad
\hmn{im}\quad
\hmn{-3 *2}\quad
\hmn{-4 2 m}\quad
\hmn{*i m}\quad
\hmn{-3m-2-{10}}

\[
\hmn{-6}\quad
\hmn{*4}\quad
\hmn{8mm}\quad
\hmn{im}\quad
\hmn{-3 *2}\quad
\hmn{-4 2 m}\quad
\hmn{*i m}\quad
\hmn{-3m-2-{10}}
\]

\end{document}

A mapping is done on the token list; items * and - are substituted by macros taking two arguments (one will be \, from the following item), while i is substituted by \,\infty and similarly digits (or braced groups of digits). Next the list is delivered.

enter image description here

2
  • That is already very nice, thanks a lot. However, it would be nice to have a tiny bit more space between two digits or a digit and a fraction. And the space group names start with one of the letters P, I, A, B, C, F, or R. They should be the same size as the following digits (the fractions can be of different size). Do you have an idea how to achieve this?
    – eins6180
    Nov 4, 2015 at 15:50
  • @eins6180 Adding thin spaces can be done, by examining one item at a time. For the space group names, I'm sorry, but the Wikipedia page is quite unclear about their usage.
    – egreg
    Nov 4, 2015 at 16:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .