我是一名西班牙语语言学家,正在使用 RMarkdown 撰写论文。我的文档可以顺利编译成 PDF,直到我尝试使用 gb4e 包添加示例和注释。我正在使用运行 Big Sur 11.1、pdfTeX 3.14159265-2.6-1.40.21 (TeX Live 2020)、R 4.0.3 和 RStudio 版本 1.3.1073 的 Mac 工作。
我从一个小的 rdm 文档开始,直到它工作正常。当我将块移动到实际手稿中时,我遇到了问题,我收到错误“超出 TeX 容量,抱歉 [参数堆栈大小=10000]”。
这是可以编译的玩具文档:
---
title: "testing_latex"
author: "Erwin Lares"
date: "1/5/2021"
output: pdf_document
header-includes:
- \usepackage{gb4e}
---
See (\ref{stm-n-lit}) shows the literal sentence. (\ref{stm-n-idm}) shows the idiomatic sentence. (\ref{stm-plain}) shows an unambiguous sentence that can only be interpreted compositionally.
\begin{exe} % sets up the top-level example environment
\ex
\begin{xlist} % first embedding (alphabetical numbering)
\ex\label{stm-n-lit}
\gll Mary kicked the bucket, she stubbed her toes. \\
Mary kick-PAST the bucket, 3S bruised-PAST 3S-POSS toe-PL \\
\trans ‘Mary made contact with the bucket with her toes forcefully ’
\ex\label{stm-n-idm}
\gll Mary kicked the bucket, she's dead. \\
Mary kick-PAST the bucket, 3S COP-PRE dead-adj \\
\trans ‘Mary is dead.’
\end{xlist} % end first embedding
\ex\label{stm-plain}
\gll This example does not contain sub examples.\\
DEMO-SING example DO-helping NEG contain sub examples\\
\trans ‘This is a plain example’
\end{exe}
当我将这段代码添加到手稿中时,问题就出现了。当我尝试编织文档时,出现了一些问题并产生了错误。这是手稿的副本。我意识到 YAML 中的输出不同,但我需要一个用于 bookdown 包的 pdf_document2。任何建议都将不胜感激。
---
title: "Experimental Design"
author: "Erwin Lares"
date: "12/23/2020"
output:
bookdown::pdf_document2: default
bookdown::html_document2: default
header-includes:
- \usepackage{graphicx}
- \usepackage{float}
- \usepackage{longtable}
- \usepackage{gb4e}
---
<!-- code_folding: hide -->
{r loading-library, include=FALSE, echo=FALSE}
#install.packages("networkD3")
#library(networkD3)
library(tidyverse)
library(DataEditR)
#library(gt)
library(kableExtra)
library(tinytex)
library(rmarkdown)
library(bookdown)
library(knitr)
library(skimr)
library(RColorBrewer)
library(broom)
\begin{exe} % sets up the top-level example environment
\ex
\begin{xlist} % first embedding (alphabetical numbering)
\ex\label{stm-n-lit}
\gll Mary kicked the bucket, she stubbed her toes. \\
Mary kick-PAST the bucket, 3S bruised-PAST 3S-POSS toe-PL \\
\trans ‘Mary made contact with the bucket with her toes forcefully ’
\ex\label{stm-n-idm}
\gll Mary kicked the bucket, she's dead. \\
Mary kick-PAST the bucket, 3S COP-PRE dead-adj \\
\trans ‘Mary is dead.’
\end{xlist} % end first embedding
\ex\label{stm-plain}
\gll This example does not contain sub examples.\\
DEMO-SING example DO-helping NEG contain sub examples\\
\trans ‘This is a plain example’
\end{exe}
答案1
碰巧的是,我碰到了其他人问题的答案,并且该答案也解决了我的问题。
\noautomath
在 YAML 标头后面添加一个\usepackage{gb4e}
可以使我的文档编译正常。
谢谢你们的帮助,我知道这会是对我最大的帮助!