diff --git a/public/tex/blad.cls b/public/tex/blad.cls index 4c14311..70c9735 100644 --- a/public/tex/blad.cls +++ b/public/tex/blad.cls @@ -1,8 +1,9 @@ % Filename: blad.cls -% Author: Arno Lepisk (2003, v 1.0) -% Oskar Rune (2021, v 1.2.0) +% Author: Arno Lepisk (v1.0, 2003) +% Oskar Rune (v1.2.0, 2021 & v1.2.1, 2023) % -% Version: 1.2.0. Not backwards-compatible with versions 1.0 and 1.1.x +% Version: 1.2.1. Not backwards-compatible with versions 1.0-1.1.x. +% Compatible with 1.2.0 when song indices are disabled. (I.e. use \newcommand{\songindex}[1]{}) % This is a LaTeX2e document class. @@ -16,6 +17,9 @@ \LoadClass[a4paper]{article} +% +% Packages +% \RequirePackage[swedish]{babel} \RequirePackage[utf8]{inputenc} \RequirePackage[T1]{fontenc} @@ -25,11 +29,13 @@ \RequirePackage{xspace} \RequirePackage{ifthen} \RequirePackage{quoting} - \RequirePackage{verbatim} +\RequirePackage{comment} + +\RequirePackage{amsmath,amsfonts,amssymb,bm} +\RequirePackage{graphicx,svg} +\RequirePackage{fancyhdr} -\RequirePackage{amsmath,amsfonts,amssymb,graphicx} -\RequirePackage{svg} % % Layout @@ -59,41 +65,43 @@ \setlength{\paperwidth}{.5\paperwidth} \setlength{\textwidth}{.96\paperwidth} -\setlength{\textheight}{.95\paperheight} +\setlength{\textheight}{.95\paperheight-10mm} % One may want to remove the "-10mm" when not using page-numbering % % Booklet setup % -\usepackage[print]{booklet} +\RequirePackage[print]{booklet} \source{\magstep1}{\paperwidth}{\paperheight} \target{\magstep1}{2\paperwidth}{\paperheight} +% +% Page numbering +% +\pagestyle{fancy} % May be set to "empty" if not using numbering +\pagenumbering{arabic} % May be set to "none" if not using numbering +\renewcommand{\headrulewidth}{0pt} % Removes the horizontal line from the header +\fancyhead{} % Clear default header +\fancyfoot[C]{\thepage} % Set footer (C = center) to display page numbers + +\pagestyle{empty} + % % Song template % -\newcommand{\songtitle}[1]{ +\newcommand{\songindex}[1]{#1. } % Extracted so that it can be overridden. +\newcommand{\songtitle}[2][]{ \begin{flushleft} - \subsection*{#1} + \subsection*{\boldmath\songindex{#1}#2\unboldmath} \end{flushleft} % \nopagebreak } \newcommand{\melody}[1]{ % \nopagebreak \vspace*{0.1cm} - \begin{quoting}[leftmargin=6mm] - \small{\textit{#1}} - \end{quoting} + \begin{quoting}[leftmargin=6mm]\small{\textit{#1}}\end{quoting} \vspace*{-3mm} % \nopagebreak } -\newenvironment{lyrics}{ -% \nopagebreak - \vspace*{1mm} - \begin{verse} -}{ - \end{verse} -% \nopagebreak -} \newcommand{\auth}[1]{ % \nopagebreak \vspace*{0.1cm} @@ -103,6 +111,14 @@ \end{flushright} \end{verse} } +\newenvironment{lyrics}{ +% \nopagebreak + \vspace*{1mm} + \begin{verse} +}{ + \end{verse} +% \nopagebreak +} % fkm* logo \newcommand{\fkm}{\mbox{{\raisebox{-0.2ex} @@ -110,18 +126,24 @@ {\rotatebox{-15}{\bf{k}}}\hspace{-0.17em}\bf{m}\hspace{-0.15em}\raisebox{0.6ex} {\scalebox{0.6}{\bf{*}}}}}\xspace} -\pagenumbering{none} -\pagestyle{empty} - % -% Special character handling +% Special character handling (TODO: Add all greek letters) % \DeclareUnicodeCharacter{0394}{$\Delta$} % Δ \DeclareUnicodeCharacter{03A9}{$\Omega$} % Ω +\DeclareUnicodeCharacter{03B1}{$\alpha$} % α \DeclareUnicodeCharacter{03B2}{$\beta$} % β +\DeclareUnicodeCharacter{03B3}{$\gamma$} % γ \DeclareUnicodeCharacter{03B4}{$\delta$} % δ \DeclareUnicodeCharacter{03B5}{$\varepsilon$} % ε \DeclareUnicodeCharacter{03B6}{$\zeta$} % ζ +\DeclareUnicodeCharacter{03BA}{$\kappa$} % κ +\DeclareUnicodeCharacter{03BB}{$\lambda$} % λ +\DeclareUnicodeCharacter{03B7}{$\eta$} % η +\DeclareUnicodeCharacter{03B8}{$\theta$} % θ +\DeclareUnicodeCharacter{03B9}{$\iota$} % ι +\DeclareUnicodeCharacter{03BC}{$\mu$} % μ +\DeclareUnicodeCharacter{03BD}{$\nu$} % ν \DeclareUnicodeCharacter{03C0}{$\pi$} % π \DeclareUnicodeCharacter{03C1}{$\rho$} % ρ \DeclareUnicodeCharacter{03C3}{$\sigma$} % σ @@ -138,6 +160,11 @@ \DeclareUnicodeCharacter{1E8D}{$\ddot{x}$} % ẍ \DeclareUnicodeCharacter{1E8B}{$\dot{x}$} % ẋ +\DeclareUnicodeCharacter{2124}{$\mathbb{Z}$} % ℤ +\DeclareUnicodeCharacter{2200}{$\forall$} % ∀ +\DeclareUnicodeCharacter{2208}{$\in$} % ∈ +\DeclareUnicodeCharacter{2297}{$\otimes$} % ⊗ +\DeclareUnicodeCharacter{221E}{$\infty$} % ∞ \DeclareUnicodeCharacter{2205}{$\emptyset$} % ∅ \DeclareUnicodeCharacter{2229}{$\cap$} % ∩ \DeclareUnicodeCharacter{222A}{$\cup$} % ∪ @@ -147,4 +174,6 @@ \DeclareUnicodeCharacter{27F8}{$\Leftarrow$} % ⟸ \DeclareUnicodeCharacter{2202}{$\partial$} % ∂ \DeclareUnicodeCharacter{2260}{$\neq$} % ≠ -\DeclareUnicodeCharacter{2228}{$\lor$} % ∨ \ No newline at end of file +\DeclareUnicodeCharacter{2228}{$\lor$} % ∨ +\DeclareUnicodeCharacter{230A}{$\lfloor$} % ⌊ +\DeclareUnicodeCharacter{230B}{$\rfloor$} % ⌋ diff --git a/src/utils/export/contentTeX.ts b/src/utils/export/contentTeX.ts index ef8beaf..fbbef15 100644 --- a/src/utils/export/contentTeX.ts +++ b/src/utils/export/contentTeX.ts @@ -43,7 +43,7 @@ export default function getContentTeX(songs: Song[], gs: GeneralSettings, ss: Sp '\\pagebreak[3]\n', // Try to get everything else on the same page '\\begin{samepage}\n', - `\\songtitle{${escapeAll(song.title)}}\n`, + `\\songtitle[${escapeAll(song.index)}]{${escapeAll(song.title)}}\n`, ...getMelodyContent(gs, song), '\\begin{lyrics}\n' ) diff --git a/src/utils/export/generalSettings.ts b/src/utils/export/generalSettings.ts index e0a5e36..d6a8827 100644 --- a/src/utils/export/generalSettings.ts +++ b/src/utils/export/generalSettings.ts @@ -5,7 +5,9 @@ export type GeneralSettings = { title: StringSetting, showLogo: BoolSetting, showDate: BoolSetting, + showPageNumbers: BoolSetting, showMelody: BoolSetting, + showIndices: BoolSetting, showAuthor: BoolSetting, showSheetMusicNotice: BoolSetting } @@ -27,11 +29,21 @@ export const generalSettings: GeneralSettings = { type: 'bool', value: true }, + showPageNumbers: { + text: 'Inkludera sidnummer', + type: 'bool', + value: true + }, showMelody: { text: 'Inkludera melodi', type: 'bool', value: true }, + showIndices: { + text: 'Inkludera index', + type: 'bool', + value: false + }, showAuthor: { text: 'Inkludera författare', type: 'bool', diff --git a/src/utils/export/mainTeX.ts b/src/utils/export/mainTeX.ts index 16fa063..fa427be 100644 --- a/src/utils/export/mainTeX.ts +++ b/src/utils/export/mainTeX.ts @@ -16,6 +16,8 @@ export default function getMainTeX(gs: GeneralSettings): string { `${gs.showDate.value ? '%' : ''}\\date{}\t%Ta bort kommentaren om du inte vill ha med datum.`, `${gs.showAuthor.value ? '%' : ''}\\renewcommand{\\auth}[1]{}\t%Ta bort kommentaren om du inte vill ha med upphovspersons-angivelse.`, `${gs.showMelody.value ? '%' : ''}\\renewcommand{\\melody}[1]{}\t%Ta bort kommentaren om du inte vill ha med melodier.`, + `${gs.showIndices.value ? '%' : ''}\\renewcommand{\\songindex}[1]{}\t%Ta bort kommentaren om du inte vill ha med index.`, + `${gs.showPageNumbers.value ? '%' : ''}\\fancyfoot{}\\setlength{\\textheight}{.95\\paperheight} \t%Ta bort kommentaren om du inte vill ha med sidnummer.`, '\n\n\\begin{document}\n\\maketitle\n\\input{content.tex}\n\\end{document}' ) return out.join('\n')