I'm creating a songbook using the songspackage. I'm very new to LaTex and opted to use overleaf which has worked good, the only problem I really have is with the index. I'm using an older base template for the project which already had a working index-file which I can display, but the index won't update.
While searching the documentation I believe the solution is connected to the line:
texlua songidx.lua titlfile.sxd titlfile.sbx
But I can't seem to find anywhere to put that line in overleaf. Is there anyway to solve this or do I have to learn how to parse it locally on my computer?
Update: Added a MWE below. This example produces either an empty index with the text: "[Index not yet generated.]" or if I add the idxfile.sbx from an older version of the book, the whole register appears as it was years ago and not only the two songs in this example. So clearly the idxfile.sbx would have to be rewritten somehow. Now to the MWE that is splitted in two a min file (first block) and a included file with the songs themselves:
\documentclass[9pt,a6paper,openright,twoside]{extbook}
\usepackage[bookmarks]{hyperref}
\usepackage[top=15mm,bottom=15mm,left=15mm,right=10mm]{geometry}
%\addtolength{\oddsidemargin}{5mm}
\usepackage[lyric,noshading]{songs}
\usepackage{amsmath,amssymb}
\usepackage{amsfonts}
\usepackage{fancyhdr}
\usepackage{enumitem}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[swedish]{babel}
\usepackage{calligra}
\usepackage{lmodern}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{imakeidx}
\usepackage{tikz}
\usepackage{textcomp}
\hypersetup{
colorlinks=false,
pdfborder={0 0 0},
}
\setlength{\sbarheight}{0.2pt}
\renewcommand{\stitlefont}{\bf\large}
\renewcommand{\notefont}{\itshape\small}
\makeatletter
\renewcommand\showindex[3][0]{%
\@ifundefined{SB@idxsel@#3}{\SB@errnoidx{#3}}{%
\expandafter\let\expandafter\SB@temp\csname SB@idxsel@#3\endcsname%
\SB@cnt#1\relax%
\ifnum\SB@cnt<\@ne\SB@cnt\SB@temp232\relax\fi%
\expandafter\SB@temp%
\expandafter\SB@maketitleindex%
\expandafter\SB@makescripindex%
\expandafter\SB@makeauthorindex%
\expandafter{\the\SB@cnt}%
{#2}{#3}%
}%
}
\makeatother
%%%% index
\renewcommand{\idxtitlefont}{\sffamily\small}%\itshape}
\renewcommand{\idxlyricfont}{\itshape\small}%\mdseries}
\renewcommand{\idxheadfont}{\calligra\bfseries\Huge}
\noversenumbers
\nosongnumbers
\songcolumns{0}
%%% Don't try to fill up every page
\raggedbottom
\setcounter{secnumdepth}{-1}
%%%%%%% Index
\newindex{index}{idxfile}
\scriptureon
\title{\large Sångbok
\vfill
\small Denna sångbok trycktes i 1000 exemplar. Detta är exemplar Nr. \rule{0.5cm}{0.5pt}
}
\date{}
\begin{document}
\maketitle
\indexsongsas{index}{\thepage}
\pagestyle{plain}
\newpage
\tableofcontents
\include{Text/bordsvisor}
\indexeson
\injectparagraph{%
\center Rak text: Sångtitel\ ~ \emph{Kursiv text: Första raden\\
\begin{center}
\line(1,0){250}
\end{center}}}
\showindex{Register}{index}
\end{document}
And the included songs (Text/bordvisor.tex) are here:
\songchapter{Bordsvisor}
\thispagestyle{empty}
\begin{tikzpicture}[remember picture,overlay]
\node at (current page.center) {\includegraphics[width=\paperwidth]{bilder/kapitel/kap_bord.JPG}};
\end{tikzpicture}
\pagebreak
\begin{songs}{index}
\beginsong{Måltidssång}[sr={Fredmans sång nr 21},by={Text \& musik: Carl Michael Bellman},index={Så lunka vi så småningom}]
\beginverse
Så lunka vi så småningom
från Bacchi buller och tumult,
när döden ropar: Granne kom,
ditt timglas är nu fullt.
Du gubbe fäll din krycka ner,
och du, du yngling, lyd min lag,
den skönsta nymf som åt dig ler
inunder armen tag.
\endverse
\endsong
\beginsong{Spritbolaget}[by={Mel.: Du kära lille snickerbo'},index={Till spritbolaget ränner jag}]
\beginverse
Till spritbolaget ränner jag
och bankar på dess port.
Jag vill ha nå’t som bränner bra
och gör mig skitfull fort.
Expediten sade goddag,
hur gammal kan min herre va’?
Har du nå’t leg ditt fula drägg?
Kom hit igen när du fått skägg.
\endverse
\endsong
\end{songs}