degryuter 範本:不顯示森林樹木和 langsci-avm 矩陣

degryuter 範本:不顯示森林樹木和 langsci-avm 矩陣

我在使用 degruyter Latex 文章模板時遇到一些問題。除了句法樹和 lfg AVM 之外,一切正常。我正在使用 xelatex 進行編譯,並且正在使用森林和 langsci-avm語言學LFG分別作為選項。有人可以幫我嗎?謝謝。這是最小的程式碼。

\documentclass[english]{article}
\RequirePackage[no-math]{fontspec}[2017/03/31]%(only for the luatex or the xetex engine)
\usepackage{fontspec}
\setmainfont{Linux Libertine}
\usepackage[small]{dgruyter}
% get packages from local sty-file
\usepackage{packages}

% Note: A different font will be used in the final version
%\usepackage{times}
% Names for Tables, Figures
\AtBeginDocument{%
  \renewcommand\tablename{Table}
}

\AtBeginDocument{%
  \renewcommand\figurename{Figure}
}

% We use todonotes for margin notes

\newcommand{\jdg}[1]{\makebox[0pt][r]{\normalfont#1\ignorespaces}}

\usepackage{ifthen}
\newboolean{finalcompile}

% Please set finalcompile to true for the final version, to false otherwise

\setboolean{finalcompile}{true}
%\setboolean{finalcompile}{false}

\ifthenelse{\boolean{finalcompile}}{
\usepackage[disable]{todonotes}
\usepackage[final]{showlabels}
}{
\usepackage{todonotes}
\newcommand{\todonote}[2][]{\tikzexternaldisable\todo[#1]{#2}\tikzexternalenable} %needed for externalization
\usepackage[right]{showlabels}
\paperwidth=\dimexpr \paperwidth + 6cm\relax
\marginparwidth=\dimexpr \marginparwidth + 6cm\relax
%\makeatletter 
%\@mparswitchfalse
%\makeatother
%\normalmarginpar
%\reversemarginpar
}

\usepackage[linguistics]{forest}
\usepackage[lfg]{langsci-avm}
\usepackage{pst-node}
\avmdefinestyle{plain}{attributes=\scshape,
values=\scshape,
types=\normalfont}


\begin{document}

\begin{forest}
[IP[DP][I']]
\end{forest}


\avm[style=plain]{
[pred & `silue']}


\end{document}

這是錯誤訊息:

! Misplaced \noalign.
\bottomrule ->\noalign
{\ifnum 0=`}\fi \@aboverulesep =\aboverulesep \global...
l.67 \end{forest}
I expect to see \noalign only after the \cr of
an alignment. Proceed, and I'll ignore this case.
! Missing } inserted.
<inserted text>
}
l.67 \end{forest}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)
With luck, this will get me unwedged. But if you
really didn't forget anything, try typing `2' now; then
my insertion and my current dilemma will both disappear.
! Missing \endgroup inserted.
<inserted text>
\endgroup
l.67 \end{forest}
I've inserted something that you may have forgotten.
(See the <inserted text> above.)

答案1

DeGruyter 套件將所有表格重新定義為booktabs表格,這搞砸了內部使用常規表格環境的套件。幸運的是,他們還提供了一種撤消更改的方法,因此對於任何forest導致此錯誤的環境,您可以使用:

\AtBeginEnvironment{forest}{\baretabulars}

如果langsci-avm命令是巨集而不是環境,因此您可以使用from\avm修補命令:\pretocmdetoolbox

\usepackage{etoolbox}
\pretocmd{\avm}{\baretabulars}{}{\fail}

如果由於您嘗試修補的特定命令的定義方式而導致修補失敗,則巨集\fail將傳回未定義的控制序列錯誤,在這種情況下,您需要找到另一種方法來修補該特定命令。

這是一個最小的工作範例(這就是您的非工作範例應該是什麼樣子)。

\documentclass[english]{article}
\RequirePackage[no-math]{fontspec}[2017/03/31]%(only for the luatex or the xetex engine)
\usepackage{fontspec}
\usepackage[small]{dgruyter}

\usepackage[linguistics]{forest}
\AtBeginEnvironment{forest}{\baretabulars}
\usepackage[lfg]{langsci-avm}
\pretocmd{\avm}{\baretabulars}{}{\fail}
\avmdefinestyle{plain}{attributes=\scshape,
values=\scshape,
types=\normalfont}


\begin{document}

\begin{forest}
[IP[DP][I']]
\end{forest}


\avm[style=plain]{
[pred & `silue']}


\end{document}

程式碼的輸出

相關內容