8

Electrochemical cells should be typeset

  • According to the "Green Book" from IUPAC with vertical bars, dashed vertical bars and double dashed vertical bars. (first picture)
  • According to Atkins, Physical Chemistry with vertical bar, three vertical dots and double vertical bar. (second picture)

How do i properly typeset those symbols? The single bar I can directly input from the keyboard like "|". For the double, do i just make two bars like "||" or is there a more suitable symbol? How do i get (double) dashed vertical bars and three vertical dots? In text mode or math mode?

\documentclass[11pt,a4paper]{scrartcl}
\usepackage[ngerman,english]{babel}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{array, lipsum, epstopdf, amssymb}
\usepackage{textcomp}   %symbols e.g. °C
\usepackage{textgreek}  %greek letters in text mode
\usepackage{siunitx}

\usepackage{chemmacros}
\chemsetup{modules={all}}

\begin{document}
Cu(s) | CuSO4(aq) || KCl(aq) || ZnSO4(aq) | Zn(s)
\end{document}

IUPAC, "Green Book" Atkins, Physical Chemistry

  • For the vertical dots you can use \vdots. You might want to lower it to match the vertical bar by using \raisebox{-2pt}{\vdots}, or possibly compress the dots by importing (e.g.) the MnSymbol package. There is a math symbol \| for a double vertical bar, which gives bars slightly closer together than ||, but if you're also doubling the vertical dots or dashes those will probably give something more similar to ||. – Emma Nov 19 '16 at 23:02
6

I don't know this symbol in LaTeX but you may build it with \vrule.

\newcommand\dashbar{{%
    \setbox0=\hbox{(}%
    \dimen0=\dimexpr\ht0+\dp0\relax
    \lower\dp0\hbox{%
      \kern.2pt\relax
      \vrule height .2\dimen0 depth 0pt\kern-.4pt\relax
      \vrule height .6\dimen0 depth -.4\dimen0\kern-.4pt\relax
      \vrule height \dimen0 depth -.8\dimen0\relax
      \kern.2pt\relax
  }}}

\newcommand\dashbarii{\dashbar\dashbar}
\newcommand\dashbariii{\dashbar\dashbar\dashbar}

After this,

Cu(s) $|$ CuSO$_4$(aq) \dashbarii\ KCl(aq,sat) \dashbarii\ ZnSO$_4$(aq) $|$ Zn(s)

gives enter image description here

The code above has a small drawback: the dash bars are narrower than the vertical bar |. I modified it to ajust this.

\makeatletter
 \newcommand\@dashbar{{%
     \setbox0=\hbox{(}%
     \dimen0=\dimexpr\ht0+\dp0\relax
     \lower\dp0\hbox{%
       \kern.2pt\relax
       \vrule height .2\dimen0 depth 0pt\kern-.4pt\relax
       \vrule height .6\dimen0 depth -.4\dimen0\kern-.4pt\relax
       \vrule height \dimen0 depth -.8\dimen0\relax
       \kern.2pt\relax
 }}}
\newcommand\dashbar{\begingroup\setbox0\hbox{$|$}\hbox to\wd0\bgroup\hss\@dashbar\@@dashbar}
\newcommand\@@dashbar{\@ifnextchar\dashbar{\@dashbar\expandafter\@@dashbar\@gobble}{\hss\egroup\endgroup}}
\makeatother

Now, everythings lines up!

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.