Biblatex 和 Musixtex 发生冲突

Biblatex 和 Musixtex 发生冲突

由于 Biblatex(使用 biber 后端)和 Musixtex 似乎发生冲突,我在撰写论文时遇到了一些问题。

其中一个问题是在文本中放置 Musixtex 注释,而另一个问题似乎是参考文献中的间距问题。

我在序言中加入了以下内容Miramoto 的建议

\let\mxaddspace\addspace\let\addspace\relax

然后重置 \addspace,如下例所示:

\\def\notesintext#1{% no staff lines, no clefs
{\let\addspace\mxaddspace\let\extractline\relax
   \setlines10\smallmusicsize \nobarnumbers \nostartrule
   \staffbotmarg0pt \setclefsymbol1\empty
   \startextract\addspace{-\afterruleskip}#1\zendextract}}

\begin{table}[h]
\centering
\begin{tabular}{lrcc}
 & \multicolumn{1}{r}{\textbf{Note Name}} & \textbf{Timebase Value} & \textbf{**kern Value} \\ \hline
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\wh1\en}}
 & Semibreve                              & 96                      & 1                   \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\hup1\en}}& Dotted Minim                           & 72                      & 2.                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\hu1\en}}& Minim                                  & 48                      & 2                   \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\qup1\en}}& Dotted Crotchet                        & 36                      & 4.                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\xtuplet3n\hu1\en}}& Minim Triplet                          & 32                      & 3.                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\qu1\en}}& Crotchet                               & 24                      & 4                   \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\cup1\en}}& Dotted Quaver                          & 18                      & 8.                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\xtuplet3n\qu1\en}}& Crotchet Triplet                       & 16                      & 6                   \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\cu1\en}}& Quaver                                 & 12                      & 8                   \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\ccup1\en}}& Dotted Semiquaver                      & 9                       & 16.                 \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\xtuplet3n\cu1\en}}& Quaver Triplet                         & 8                       & 12                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\ccu1\en}}& Semiquaver                             & 6                       & 16                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\cccu1\en}}& Dotted Demisemiquaver                  & 4.5                     & 32.                 \\
 & Semiquaver Triplet                     & 4                       & 24                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\cccu1\en}}& Demisemiquaver                         & 3                       & 32                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\ccccu1\en}}& Hemidemisemiquaver                     & 1.5                     & 64                 
\end{tabular}
\caption{A comparison of the representation of the duration of musical events using an appropriate timebase representation}
\label{tbl:kern-timebase-representation}
\end{table}

不幸的是,这不会显示表格也不会引发任何错误,所以我不确定从哪里开始调试它。

编辑:我在下面附上了一个最小工作示例,它似乎可以很好地显示表格,因此一定是另一个包造成了干扰。但是,它还会破坏参考文献中的间距,这也是我遇到的问题,希望在解决 biblatex-musixtex 冲突时能够修复。

\documentclass[11pt, twoside, a4paper]{book}

\usepackage[style=apa,hyperref=true,autocite=inline,backend=biber]{biblatex}
\addbibresource{clashtest.bib}
\usepackage{musixtex}
\let\mxaddspace\addspace\let\addspace\relax
\usepackage{tabularx}

\def\notesintext#1{% no staff lines, no clefs
  {\let\addspace\mxaddspace\let\extractline\relax
   \setlines10\smallmusicsize \nobarnumbers \nostartrule
   \staffbotmarg0pt \setclefsymbol1\empty
   \startextract\addspace{-\afterruleskip}#1\zendextract}}

\begin{document}

\setlength{\tabcolsep}{15pt}
\renewcommand{\arraystretch}{1.75}

Table~\ref{tbl:kern-timebase-representation} shows a comparison of the representation of the duration of musical events using an appropriate timebase representation from~\cite{Pearce2005} (with a granularity of~\texttt{96}), and **kern representation from~\cite{Huron1998}.

\begin{table}[h]
\centering
\begin{tabular}{lrcc}
 & \multicolumn{1}{r}{\textbf{Note Name}} & \textbf{Timebase Value} & \textbf{**kern Value} \\ \hline
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\wh1\en}}
 & Semibreve                              & 96                      & 1                   \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\hup1\en}}& Dotted Minim                           & 72                      & 2.                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\hu1\en}}& Minim                                  & 48                      & 2                   \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\qup1\en}}& Dotted Crotchet                        & 36                      & 4.                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\xtuplet3n\hu1\en}}& Minim Triplet                          & 32                      & 3.                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\qu1\en}}& Crotchet                               & 24                      & 4                   \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\cup1\en}}& Dotted Quaver                          & 18                      & 8.                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\xtuplet3n\qu1\en}}& Crotchet Triplet                       & 16                      & 6                   \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\cu1\en}}& Quaver                                 & 12                      & 8                   \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\ccup1\en}}& Dotted Semiquaver                      & 9                       & 16.                 \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\xtuplet3n\cu1\en}}& Quaver Triplet                         & 8                       & 12                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\ccu1\en}}& Semiquaver                             & 6                       & 16                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\cccu1\en}}& Dotted Demisemiquaver                  & 4.5                     & 32.                 \\
 & Semiquaver Triplet                     & 4                       & 24                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\cccu1\en}}& Demisemiquaver                         & 3                       & 32                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\ccccu1\en}}& Hemidemisemiquaver                     & 1.5                     & 64                 
\end{tabular}
\caption{A comparison of the representation of the duration of musical events using an appropriate timebase representation}
\label{tbl:kern-timebase-representation}
\end{table}

\printbibliography

\end{document}

间距问题的最小工作文档(删除 musixtex 包可修复引用间距问题):

\documentclass[11pt, twoside, a4paper]{book}

\usepackage[style=apa,hyperref=true,autocite=inline,backend=biber]{biblatex}
\addbibresource{clashtest.bib}
\usepackage{musixtex}
\let\mxaddspace\addspace\let\addspace\relax

\begin{document}

Comparison shown of representation of the duration of musical events using an appropriate timebase representation from~\parencite{Pearce2005} (with a granularity of~\texttt{96}), and **kern representation from~\autocite{Huron1998}.

\printbibliography[title={Bibliography}, keyword={Bibliography}]
\printbibliography[title={Discography}, keyword={Discography}]

\end{document}

围兜文件:

@inproceedings{Pearce2005,
venue = {Esbjerg, Denmark},
author = {Pearce, Marcus and Conklin, Darrell and Wiggins, Geraint},
booktitle = {Computer Music Modeling and Retrieval, Second International Symposium, CMMR 2004},
doi = {10.1007/978-3-540-31807-1_22},
editor = {Wiil, Uffe Kock},
isbn = {3540244581},
number = {February},
pages = {295-312},
publisher = {{Springer-Verlag}},
title = {{Methods for Combining Statistical Models of Music}},
volume = {3310},
year = {2005},
keywords = {Bibliography}
}

@misc{Huron1998,
author = {Huron, David},
pages = {436},
title = {{Humdrum User's Guide}},
url = {http://humdrum.ccarh.org/},
year = {1998},
keywords = {Bibliography}
}

在此处输入图片描述

答案1

间距问题是由于您破坏了biblatex的定义\addspace。因此您需要以稍微不同的方式执行此操作。基本思路是\mxaddspace使用定义创建一个新命令,然后在上下文中musixtex本地更改 的定义。如果您有其他命令/环境,它们也需要修补。根据它们的情况,修补 的命令可能是执行此操作的好方法。\addspacemusixtexmusixtexetoolbox

为了正确执行此操作,您还需要加载musixtex biblatex,然后设置\addspace\relax以便biblatex可以赋予它适当的biblatex定义。

这是一个完整的例子:

\documentclass[11pt, twoside, a4paper]{book}
\begin{filecontents}{\jobname.bib}
@inproceedings{Pearce2005,
venue = {Esbjerg, Denmark},
author = {Pearce, Marcus and Conklin, Darrell and Wiggins, Geraint},
booktitle = {Computer Music Modeling and Retrieval, Second International Symposium, CMMR 2004},
doi = {10.1007/978-3-540-31807-1_22},
editor = {Wiil, Uffe Kock},
isbn = {3540244581},
number = {February},
pages = {295-312},
publisher = {{Springer-Verlag}},
title = {{Methods for Combining Statistical Models of Music}},
volume = {3310},
year = {2005},
keywords = {Bibliography}
}

@misc{Huron1998,
author = {Huron, David},
pages = {436},
title = {{Humdrum User's Guide}},
url = {http://humdrum.ccarh.org/},
year = {1998},
keywords = {Bibliography}
}
\end{filecontents}

\usepackage{musixtex}
\let\addspace\relax
\usepackage[style=apa,hyperref=true,autocite=inline,backend=biber]{biblatex}
\addbibresource{\jobname.bib}

\makeatletter
\newcommand*{\mxaddspace}[1]{\kern#1\global\advance\x@skip#1}
\makeatother
\usepackage{tabularx}

\def\notesintext#1{% no staff lines, no clefs
  {\let\addspace\mxaddspace\let\extractline\relax
   \setlines10\smallmusicsize \nobarnumbers \nostartrule
   \staffbotmarg0pt \setclefsymbol1\empty
   \startextract\addspace{-\afterruleskip}#1\zendextract}}

\begin{document}

\setlength{\tabcolsep}{15pt}
\renewcommand{\arraystretch}{1.75}

Table~\ref{tbl:kern-timebase-representation} shows a comparison of the representation of the duration of musical events using an appropriate timebase representation from~\cite{Pearce2005} (with a granularity of~\texttt{96}), and **kern representation from~\cite{Huron1998}.

\begin{table}[h]
\centering
\begin{tabular}{lrcc}
 & \multicolumn{1}{r}{\textbf{Note Name}} & \textbf{Timebase Value} & \textbf{**kern Value} \\ \hline
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\wh1\en}}
 & Semibreve                              & 96                      & 1                   \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\hup1\en}}& Dotted Minim                           & 72                      & 2.                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\hu1\en}}& Minim                                  & 48                      & 2                   \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\qup1\en}}& Dotted Crotchet                        & 36                      & 4.                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\xtuplet3n\hu1\en}}& Minim Triplet                          & 32                      & 3.                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\qu1\en}}& Crotchet                               & 24                      & 4                   \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\cup1\en}}& Dotted Quaver                          & 18                      & 8.                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\xtuplet3n\qu1\en}}& Crotchet Triplet                       & 16                      & 6                   \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\cu1\en}}& Quaver                                 & 12                      & 8                   \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\ccup1\en}}& Dotted Semiquaver                      & 9                       & 16.                 \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\xtuplet3n\cu1\en}}& Quaver Triplet                         & 8                       & 12                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\ccu1\en}}& Semiquaver                             & 6                       & 16                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\cccu1\en}}& Dotted Demisemiquaver                  & 4.5                     & 32.                 \\
 & Semiquaver Triplet                     & 4                       & 24                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\cccu1\en}}& Demisemiquaver                         & 3                       & 32                  \\
 \raisebox{0ex}[0ex][0ex]{\notesintext{\notes\ccccu1\en}}& Hemidemisemiquaver                     & 1.5                     & 64                 
\end{tabular}
\caption{A comparison of the representation of the duration of musical events using an appropriate timebase representation}
\label{tbl:kern-timebase-representation}
\end{table}

\printbibliography

\end{document}

代码输出

答案2

对艾伦的答案的补充方法是保留它的定义并利用具有内部名称空间musixtex的事实。biblatex

许多宏biblatex定义并非在文档的任何地方都定义。相反,它们仅在可能有用的特定上下文中定义。这可以防止这些宏与其他文档命令发生冲突,并防止在它们没有意义时使用它们。

\addspace不是内部名称空间中的这些受保护命令之一,它在文档的任何地方都可用,因此它与 的 冲突musixtex\addspace以下代码biblatex将 的\addspace移入内部名称空间。

\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}

\usepackage[style=authoryear, backend=biber]{biblatex}
\makeatletter
\let\blx@imc@addspace\addspace
\blx@regimcs{\addspace}
\makeatother
\usepackage{musixtex}

\addbibresource{biblatex-examples.bib}

\begin{document}
\cite{sigfridsson}
\printbibliography
\end{document}

biblatex如果您不在\addspace上下文之外使用biblatex,那么就应该没问题。

相关内容