我已经搜索了一个星期,以便在 LaTeX/Songs 中设置一个宏,以便用不同的大小打印相同和弦的不同部分(斜线和弦必须较小),如下所示:
我尝试了很多类似的方法,但都失败了(主要失败是由于\printchord
宏和stringstring
数据包感觉不好)。感谢您的帮助。
正如这里所问的最终代码示例:
\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}}%
}
答案1
抱歉 Marco,我刚刚读了你的问题,可能有点晚了。无论如何,这是我用来以较小字体打印低音符的代码:
\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}
结果是: