5

I have an old document, for what I don't have the original LaTex-code. So I need to rewrite it. I stumbled upon some fancy examples using musical symbols. For the notes i found some packages (like "wasysym" or "harmony") wich allow inline usage. But for the musical repeat sign i can't find anything to use it inline.

Here the example:

To be Texed code

This is the code-environment I'm working with

\documentclass[a4paper]{article}
\usepackage[USenglish,ngerman]{babel}
\usepackage[ngerman]{varioref}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{tabular}{ll}
    $S \to A ~ | ~ AS ~ | ~ D$ & $C \to ~ | ~$      \\
    $A \to BB ~ | ~ CBC$       & $D \to S ~ | ~ SS$ \\
    $B \to CC ~ | $
\end{tabular}
\end{document}

An help is highly appreciated.

  • The leadsheets package – more precisely its musicsymbols library provides \leftrepeat, \rightrepeat and \leftrightrepeat – cgnieder May 17 '17 at 11:28
  • Surprisingly it's not even in lilyglyph. – Chris H May 17 '17 at 11:58
3

Build your own: \repeat and \frepeat. EDITED to also use wasysym symbols for the notes and increased \arraystretch.

\documentclass[a4paper]{article}
%\usepackage[USenglish,ngerman]{babel}
\usepackage[ngerman]{varioref}
\usepackage[utf8]{inputenc}
\usepackage{stackengine,wasysym}
\def\repeat{%
  \stackanchor{.}{.}%
  \rule[-\dp\strutbox]{.3pt}{\normalbaselineskip}%
  \kern0.5pt%
  \rule[-\dp\strutbox]{1pt}{\normalbaselineskip}%
  \kern1pt%
}
\def\frepeat{%
  \kern1pt%
  \rule[-\dp\strutbox]{1pt}{\normalbaselineskip}%
  \kern0.5pt%
  \rule[-\dp\strutbox]{.3pt}{\normalbaselineskip}%
  \stackanchor{.}{.}%
}
\newcommand\vsep{\quad | \quad}
\begin{document}
\tabcolsep=40pt
\renewcommand\arraystretch{1.5}
\begin{tabular}{ll}
    $S \to A \vsep AS \vsep \frepeat D$ & 
      $C \to \quarternote \vsep \twonotes$\\
    $A \to BB \vsep CBC$       & 
      $D \to S \repeat \vsep S \repeat S$ \\
    $B \to CC \vsep \halfnote$
\end{tabular}
\end{document}

enter image description here

| improve this answer | |

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.