!未定义的控制序列。 <argument> \Rmarkdown 中的 mathindent

问题描述 投票:0回答:1

我正在使用 rmarkdown 来写我的论文。我将论文分成了不同的 rmarkdown 文档,以方便我的工作。具体来说,我有一份介绍文件、一份文献综述文件和一份方法论文件。然后,我使用主 rmarkdown 文档将所有文档合并为一个输出。我的主要文档如下面的代码所示。

---
title: \textbf{Examining The Effect of Paddin}
output:
  pdf_document:
    number_sections: TRUE
    keep_tex: TRUE
    fig_caption: TRUE
    latex_engine: xelatex
geometry: "left = 2.54cm, right = 2.54cm, top = 2.54cm, bottom = 2.54cm"
fontsize: 12pt
header-includes:
  - \usepackage{float}
  - \usepackage{sectsty}
  - \usepackage{paralist}
  - \usepackage{setspace}
  - \setstretch{2.0}
  - \usepackage{fancyhdr}
  - \usepackage{ragged2e}
  - \usepackage{lastpage}
  - \usepackage{dcolumn}
  - \usepackage[nottoc, numbib]{tocbibind}
  - \usepackage{amsmath}
  - \setlength{\mathindent}{0pt}
  - \usepackage{enumitem}
  - \renewcommand{\theequation}{\thechapter.\arabic{equation}}
documentclass: report
---


```{r setup, include=FALSE} 
knitr::opts_chunk$set(echo = TRUE)
```

```{r intro, child = 'introduction.Rmd'}
```

\newpage

```{r litret, child = 'literature.Rmd'}
```

```{r, include=FALSE}
options(tinytex.verbose = TRUE)
```

\newpage

```{r methods, child = 'methodology.Rmd'}
```

我在方法论部分遇到问题,我试图在本节中编写一系列方程。我的方法部分如下所示。

---
title: " "
output: 
  pdf_document:
    number_sections: TRUE
    keep_tex: TRUE
    latex_engine: xelatex
geometry: "left = 2.54cm, right = 2.54cm, top = 2.54cm, bottom = 2.54cm"
fontsize: 12pt
classoption: fleqn
header-includes:
  - \usepackage{float}
  - \usepackage{sectsty}
  - \usepackage{setspace}
  - \setstretch{2.0}
  - \usepackage{ragged2e}
  - \setlength{\mathindent}{0pt}
  - \usepackage{enumitem}
---

\onehalfspacing
\normalsize
\justifying

# Chapter Three
\vspace{-1em}

# Methodology{-}

##  Introduction
|        This section discusses the theory behind neural networks by deriving the back propagation algorithm. The section also discusses techniques used in convolution neural networks by describing how CNNs extract data from images. Specifically, this section focuses on major techniques used in CNNs such as filtering, strides, padding, pooling and batch normalization.

\vspace{-1em}
\begin{equation}
\begin{aligned}
\frac{\partial I_j^{(3)}}{\partial W_{ji}^{(3)}} = Y_i^{(2)} \quad \text{(Obtained from the partial derivative of equation 3.5 with respect to \( W_{ji} \))}
\label{eq:equation 3.12}
\end{aligned}
\end{equation}
\vspace{-1em}

尝试在主文档中编织文档会引发错误

! Undefined control sequence.<argument> \mathindent
。不过,我可以成功地自行运行该方法文档。

latex r-markdown
1个回答
0
投票

方法论章节本身没有使用

documentclass: report
。 显然该文档类不支持
\mathindent
设置。

要解决此问题,只需删除该行即可

  - \setlength{\mathindent}{0pt}

来自主文档。

如果这扰乱了您想要的格式,您可能需要阅读此讨论:https://tex.stackexchange.com/questions/50233/positioning-of-equations .

顺便说一句,当您编译主文档时,

methodology.tex
中包含的标题将被忽略,因此当您整理完整文档时,您可能会发现需要复制其他一些内容。

© www.soinside.com 2019 - 2024. All rights reserved.