2

I'm using songs.sty to create a songbook.

I figured out how to change the background color of the song number boxes by redefining \snumbgcolor like \renewcommand{\snumbgcolor}{green}.

Song title

I can also change the background color in the index with \renewcommand{\idxbgcolor}{green}.

Is there an easy way to change the font color for these to white?

MWE:

\documentclass{book}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage[usenames]{xcolor}

\usepackage[lyric]{songs}
\renewcommand{\snumbgcolor}{green}

\begin{document}

\begin{songs}{}

\beginsong{Bella Notte}[sr={\footnotesize Mel: Bella Notte}, cr={}]

\beginchorus
Nu er det nat, en vidunderlig nat,
åh så stille Bella Notte
\endchorus
\beginverse
Stjernernes skær, bringer himlen så nær,
jeg vil drømme Bella Notte
\endverse

\endsong

\end{songs}
\end{document}
3

Maybe it's not exactly the standard solution, but by listing all commands from the songs package and keeping only stuff with “num” in it using latexdef -ll -p songs | grep num, I found the command \printsongnum. Here is a redefinition of it, only adding the white color:

\renewcommand{\printsongnum}[1]{%
    \sffamily \bfseries \LARGE \color{white}#1%
}

It seems to work if I put it in the preamble of your example. Since there aren't a hundred @ signs in the command, let's assume it's not a dirty trick xD

1

I confirm it works, and give an illustration. B.t.W;, needless to use the usenames option, as it's the default now.

% -----------------------------------------------------------------------------
% !Mode:: "TeX:Hard:UTF-8"
% PDFLaTeX this document and view or print it from Acrobat Reader!
% -----------------------------------------------------------------------------
% Preamble Starts here:
% -----------------------------------------------------------------------------
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[lyric]{songs}
\usepackage[svgnames]{xcolor}

\renewcommand{\snumbgcolor}{SeaGreen!60}
\renewcommand{\printsongnum}[1]{\color{white}\bfseries\Huge#1}

\begin{document}

\begin{songs}{}

\beginsong{How doth the little crocodile}[by={Lewis Carroll}]

\beginverse
How doth the little crocodile\\
   Improve his shining tail,\\
 And pour the waters of the Nile\\
   On every golden scale! \bigskip

 How cheerfully he seems to grin,\\
   How neatly spreads his claws,\\
 And welcomes little fishes in\\
   With gently smiling jaws!
   \endverse

\endsong

\end{songs}

\end{document}

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.