admin管理员组文章数量:1026396
I am using rmarkdown to write my thesis. I have separated the thesis into different rmarkdown documents to make my work easy. Specifically, I have an introductions document, a literature review document and a methodology document. I then use a main rmarkdown document to combine all the documents into one output. My main document is as shown in the code below.
---
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'}
```
I have a problem in the methodology section where I am trying to write a series of equations in this section. My methodology sections is as shown below.
---
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}
Trying t knit the document in main document raises the error ! Undefined control sequence.<argument> \mathindent
. However I can run the methodology document on its own successfully.
I am using rmarkdown to write my thesis. I have separated the thesis into different rmarkdown documents to make my work easy. Specifically, I have an introductions document, a literature review document and a methodology document. I then use a main rmarkdown document to combine all the documents into one output. My main document is as shown in the code below.
---
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'}
```
I have a problem in the methodology section where I am trying to write a series of equations in this section. My methodology sections is as shown below.
---
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}
Trying t knit the document in main document raises the error ! Undefined control sequence.<argument> \mathindent
. However I can run the methodology document on its own successfully.
- Can you show the intermediate .tex files? – samcarter_is_at_topanswers.xyz Commented Nov 17, 2024 at 10:36
1 Answer
Reset to default 2The methodology chapter on its own isn't using documentclass: report
. Apparently that document class doesn't support the \mathindent
setting.
To fix this, just delete the line
- \setlength{\mathindent}{0pt}
from the main document.
If that messes up your desired formatting, you might want to read this discussion: https://tex.stackexchange/questions/50233/positioning-of-equations . For example, you might want
documentclass: report
classoption: fleqn
to make all your equations be flushed left.
By the way, the header includes in methodology.Rmd
are ignored when you compile the main document, so you may find you need to copy some others there when you put together the full document.
I am using rmarkdown to write my thesis. I have separated the thesis into different rmarkdown documents to make my work easy. Specifically, I have an introductions document, a literature review document and a methodology document. I then use a main rmarkdown document to combine all the documents into one output. My main document is as shown in the code below.
---
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'}
```
I have a problem in the methodology section where I am trying to write a series of equations in this section. My methodology sections is as shown below.
---
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}
Trying t knit the document in main document raises the error ! Undefined control sequence.<argument> \mathindent
. However I can run the methodology document on its own successfully.
I am using rmarkdown to write my thesis. I have separated the thesis into different rmarkdown documents to make my work easy. Specifically, I have an introductions document, a literature review document and a methodology document. I then use a main rmarkdown document to combine all the documents into one output. My main document is as shown in the code below.
---
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'}
```
I have a problem in the methodology section where I am trying to write a series of equations in this section. My methodology sections is as shown below.
---
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}
Trying t knit the document in main document raises the error ! Undefined control sequence.<argument> \mathindent
. However I can run the methodology document on its own successfully.
- Can you show the intermediate .tex files? – samcarter_is_at_topanswers.xyz Commented Nov 17, 2024 at 10:36
1 Answer
Reset to default 2The methodology chapter on its own isn't using documentclass: report
. Apparently that document class doesn't support the \mathindent
setting.
To fix this, just delete the line
- \setlength{\mathindent}{0pt}
from the main document.
If that messes up your desired formatting, you might want to read this discussion: https://tex.stackexchange/questions/50233/positioning-of-equations . For example, you might want
documentclass: report
classoption: fleqn
to make all your equations be flushed left.
By the way, the header includes in methodology.Rmd
are ignored when you compile the main document, so you may find you need to copy some others there when you put together the full document.
本文标签: latex Undefined control sequence ltargumentgt mathindent in RmarkdownStack Overflow
版权声明:本文标题:latex - ! Undefined control sequence. <argument> mathindent in Rmarkdown - Stack Overflow 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://it.en369.cn/questions/1745638603a2160605.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论