0

I have been searching for one week to setup a macro in LaTeX/Songs in order to print with different size different pieces of the same chord (slash chord must be of smaller size) like this:

enter image description here

I've tried tons of things like this but everything fails ( the major failure is due to \printchord macro and stringstring packet doesn't have good feeling). Thanks for any help.

As asked here the final code example:

\newcounter{pos_slash}%
\renewcommand{\printchord}[1]{%
\setcounter{pos_slash}{0}%
\rmfamily\bf\normalsize%
\whereischar[q]{#1}{/}%
\theresult\par%
\ifthenelse{\expandafter\theresult>0}{%
\addtocounter{pos_slash}{\expandafter\theresult}
\addtocounter{pos_slash}{-1}}{}%
\setcounter{pos_slash}{3}}
\large\arabic{pos_slash}\par
\expandafter\substring[q]{\mystring}{1}{\expandafter\theresult}
\ifthenelse{\expandafter\theresult=0}{#1}{%
\substring[q]{#1}{1}{\arabic{pos_slash}}%
\addtocounter{pos_slash}{2}%
\tiny\slash\substring[q]{#1}{\arabic{pos_slash}}{13}}%
}

JamesT
  • 3,169
  • 3
    it would help if you provided a small example document that makes the output shown but without the size change, for those of us not familiar with songs package. – David Carlisle Jan 11 '23 at 00:12

1 Answers1

1

Sorry Marco, I've just read your question, maybe I'm a little late. Anyway, here it is the code that I use for printing bass notes in smaller font:

\documentclass{article}
\usepackage[chorded]{songs}
\notenamesin{A}{B}{C}{D}{E}{F}{G}           
\notenamesout{La}{Si}{Do}{Re}{Mi}{Fa}{Sol}  
%from https://tex.stackexchange.com/questions/650106/recent-update-broke-songs-package/666610#666610
%necessary on TL2023
\makeatletter
\renewcommand\SB@obeylines{%
  \let\obeyedline\SB@par%
  \obeylines%
  \let\@par\SB@@par%
}
\makeatother

%my hit for bass fonts \makeatletter \def\bassfont{\futurelet\next@bassverify} \def@basstrue{\hspace{-0.2em}/\hspace{-0.05em}\scriptsize} \def@bassfalse{/} \def@bassverify{% \ifcat\next f @basstrue \else @bassfalse \fi}

\renewcommand{\chordlocals}{% \catcode`/\active} {\chordlocals\global\let/\bassfont} \makeatother \begin{document} \begin{songs}{} \beginsong{Maria, ora che sei qui} \beginchorus [C]Tu Ma[G/B]ria, tu [F/A]sei, di[E]mora [E/G#]per Ge[A-]su figlio [A-/G]tuo, [F7+] re[E]gina che dal [A-]cie[A-/G]lo, spe[F7+]ran[E]za, e a[A-]mo[A-/G]re ci [F]dai. [G] \endchorus \endsong \end{songs} \end{document}

The result is:

enter image description here

  • This code comes from an answer of Enrico Gregorio to a request of mine on guitex.org (https://guitex.org/home/en/forum/5-tex-e-latex/74621-songs-modifica-catcode) – Francesco Endrici May 18 '23 at 09:47