脚注中的 Covington 示例

脚注中的 Covington 示例

我正在使用该covington包显示注释语言示例,到目前为止效果非常好。但是,当我尝试将示例放在脚注中时遇到了问题。我收到错误消息Paragraph ended before \towsent was complete.这里的问题是什么?

没有注释的示例环境在脚注中运行良好。

    \documentclass{article}
    \usepackage{covington}


    \begin{document}
    Some text.\footnote{This is commented with an example:

\begin{example}
    \gll qaama l-qawm-u illaa zayd-an
stood.up DEF-people but zayd-ACC
\glt `Everyone stood up except for Zayd'
\glend
\end{example}


\begin{example}
This is an unglossed example.
\end{example}

    }

    \end{document}

答案1

该包使用活动行尾,但与任何此类 catcode 更改(如\verb)一样,它在宏参数中不起作用。这定义了一个命令\xx,该命令在本地定义命令以拾取显式\xnewline标记而不是行尾字符。

    \documentclass{article}
    \usepackage{covington}

\let\xtwosent\twosent
\let\xthreesent\threesent
\begingroup\lccode`@`\^^M\lowercase{\endgroup
\def\xx{%
\def\twosent##1\xnewline##2\xnewline{\xtwosent##1@##2@}
\def\threesent##1\xnewline##2\xnewline##3\xnewline{\xthreesent##1@##2@##3@}}}
\def\xnewline{ }

    \begin{document}
    Some text.\footnote{\xx This is commented with an example:

\begin{example}
    \gll qaama l-qawm-u illaa zayd-an\xnewline
stood.up DEF-people but zayd-ACC\xnewline
\glt `Everyone stood up except for Zayd'\xnewline
\glend
\end{example}


\begin{example}
This is an unglossed example.
\end{example}

    }

    \end{document}

答案2

Covington 1.3(刚刚发布到 CTAN)将提供特定的 \xgll 和 \xglll 宏,这些宏不会摆弄行尾 catcode。相反,行必须由 \xgle 明确终止。因此,上面的示例应为:

\documentclass{article}
\usepackage{covington}

\begin{document}
Some text.\footnote{This is commented with an example:

\begin{example}
\xgll qaama l-qawm-u illaa zayd-an\xgle
       stood.up DEF-people but zayd-ACC\xgle
\glt `Everyone stood up except for Zayd'
\glend
\end{example}

\begin{example}
This is an unglossed example.
\end{example}
}
\end{document}

相关内容