错误 (1) 缺少 \endcsname,(2) 在 media9 中包含音频时超出 TeX 容量

错误 (1) 缺少 \endcsname,(2) 在 media9 中包含音频时超出 TeX 容量

我正在尝试将声音片段包含在我的 .tex 文件中。

在最小文件中,我没有遇到任何问题:

\documentclass[a4paper, 11pt]{article}
\usepackage{media9}

\begin{document}
\section{Lyd}
\includemedia[addresource=dodonusman01.mp3,
transparent,
flashvars={source=dodonusman01.mp3&autoPlay=true}]{\bf Here}{APlayer.swf} 
is some sound.
\end{document}

但是,如果我在实际想要包含声音文件的 .tex 文件中输入相同的代码,首先会出现这些错误:

Extra \endcsname. ....mp3&autoPlay=true}]{\bf Her}{APlayer.swf}

Missing \endcsname inserted. ....mp3&autoPlay=true}]{\bf Here}{APlayer.swf}

当我再次编译时,我得到:

TeX capacity exceeded, sorry [parameter stack size=10000]. \catcode`\noexpand\^^A

我尝试包含的文件是 15kb。我猜它与我在 .tex 文档中使用的其他内容有冲突。这是我的序言,我删除了所有文本,因为它有 150 页:

\documentclass[12pt,twoside]{report}
\usepackage[margin=2.5cm]{geometry} % margins
\usepackage[natbibapa]{apacite} % references
\usepackage{graphicx}
\usepackage{subfig}
\usepackage[section]{placeins}
\usepackage{tipa} % ipa
\usepackage{gb4e} % gloss
\usepackage{cgloss4e} % gloss
\usepackage{caption} % table and figure captions
\captionsetup[table]{skip=0pt,font=footnotesize}
\captionsetup[figure]{skip=0pt,font=footnotesize}
\usepackage[T1]{fontenc}
\usepackage{multicol}
\usepackage{nomencl}
\usepackage{longtable}
\usepackage{tabularx}
\usepackage{array}
\usepackage{marvosym} % play arrow button
\usepackage{media9} % sound files
\usepackage{enumitem} % to make lists with more levels
\setlistdepth{5}

\let\ipa\textipa
\let\cap\textsc
\usepackage{vowel}

\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
{-2.5ex\@plus -1ex \@minus -.25ex}%
{1.25ex \@plus .25ex}%
{\normalfont\normalsize\bfseries}}
\makeatother
\setcounter{secnumdepth}{4} % how many sectioning levels to assign numbers to
\setcounter{tocdepth}{4}    % how many sectioning levels to show in ToC

\usepackage{wrapfig} % to wrap text around figures
\newcommand{\BlankCell}{}
\let\eachwordone=\it
\usepackage{slashbox} % to make tables with slash in upper left field
\usepackage{amssymb}


\newenvironment{dedication} % for the dedication
{\clearpage           % we want a new page
\thispagestyle{empty}% no header and footer
\vspace*{\stretch{1}}% some space at the top 
\itshape             % the text is in italics
\raggedleft          % flush to the right margin
}
{\par % end the paragraph
\vspace{\stretch{3}} % space at bottom is three times that at the top
\clearpage           % finish off the page
}

\begin{document}
\section{Test}

\includemedia[addresource=dodonusman01.mp3,
transparent,
flashvars={source=dodonusman01.mp3&autoPlay=true}]{\bfHere}{APlayer.swf} 
is some sound. 
\end{document}

答案1

问题出在automath的功能上gb4e,可以使用以下最小示例重现该问题:

\documentclass[12pt,twoside]{report}
\usepackage{media9} % sound files
\usepackage{gb4e} % gloss
\usepackage{cgloss4e} % gloss

\begin{document}

\section{Test}

\includemedia[
  addresource=click.mp3,
  transparent,
  flashvars={source=click.mp3&autoPlay=true}
]{\textbf{Here}}{APlayer.swf}

\end{document}

只需添加\noautomath,如文档gb4e第 3 节“Varia”中所述。

• 下标和上标(_^)在数学模式之外也能起作用。
笔记:已知此功能会导致许多其他软件包出现问题。保留此功能是为了向后兼容。如果出现问题,您可以\noautomath在加载 gb4e 软件包后立即在前言中添加命令来禁用它。您也可以稍后使用命令重新启用它\automath。[添加于 2009/12/28]

\documentclass[12pt,twoside]{report}
\usepackage{media9} % sound files
\usepackage{gb4e} % gloss
\usepackage{cgloss4e} % gloss
\noautomath % <----------------- Here it is!

\begin{document}

\section{Test}

\includemedia[
  addresource=click.mp3,
  transparent,
  flashvars={source=click.mp3&autoPlay=true}
]{\textbf{Here}}{APlayer.swf}

\end{document}

相关内容