2

我正在使用papajafor R 并编译为 .pdf。我想在其中包含一个带有乳胶格式的注释字段,但看起来注释字段已被解析,因此它不会编译乳胶语法。有没有解决的办法?下面是一个简短的代表。

---
title             : "My paper"
shorttitle        : "My jerky paper"
note              : "Forthcoming in \\textit{Journal of Jerkface Psychobabble}."

author: 
  - name          : "A. Jerk"
    affiliation   : "1"
    corresponding : yes    # Define only one corresponding author
    address       : "Back alley, New Jersey"
    email         : "a-jerk@hotmail.com"

affiliation:
  - id            : "1"
    institution   : "University of Stuff"

authornote: |
  Shout out to my man Wilbur.

abstract: |
  This paper is amazing

keywords          : "Awesome"

bibliography      : ["r-references.bib"]

floatsintext      : no
figurelist        : no
tablelist         : no
footnotelist      : no
linenumbers       : no
mask              : no
draft             : no
keep_tex          : yes

documentclass     : "apa6"
classoption       : "man"
output            : papaja::apa6_pdf
---

```{r setup, include = FALSE}
library("papaja")
```


Blah blah blah.


# References
```{r create_r-references}
r_refs(file = "r-references.bib")
```

\begingroup
\setlength{\parindent}{-0.5in}
\setlength{\leftskip}{0.5in}

<div id="refs" custom-style="Bibliography"></div>
\endgroup

生成的 .tex 文件具有以下注释字段:

\note{Forthcoming in \textbackslash{}textit\{Journal of Jerkface Psychobabble\}.}

有什么办法可以写出注释,这样乳胶符号就不会被这样解析?

会话信息如下:

- Session info -----------------------------------------
 setting  value                       
 version  R version 3.6.3 (2020-02-29)
 os       Windows 10 x64              
 system   x86_64, mingw32             
 ui       RStudio                     
 language (EN)                        
 collate  English_United States.1252  
 ctype    English_United States.1252  
 tz       America/Chicago             
 date     2020-05-05                  

- Packages ---------------------------------------------
 package     * version    date       lib source                      
 assertthat    0.2.1      2019-03-21 [1] CRAN (R 3.6.3)              
 cli           2.0.2      2020-02-28 [1] CRAN (R 3.6.3)              
 crayon        1.3.4      2017-09-16 [1] CRAN (R 3.6.3)              
 digest        0.6.25     2020-02-23 [1] CRAN (R 3.6.3)              
 evaluate      0.14       2019-05-28 [1] CRAN (R 3.6.3)              
 fansi         0.4.1      2020-01-08 [1] CRAN (R 3.6.3)              
 glue          1.4.0      2020-04-03 [1] CRAN (R 3.6.3)              
 htmltools     0.4.0      2019-10-04 [1] CRAN (R 3.6.3)              
 knitr         1.28       2020-02-06 [1] CRAN (R 3.6.3)              
 papaja        0.1.0.9942 2020-05-05 [1] Github (crsh/papaja@b0a224a)
 Rcpp          1.0.4.6    2020-04-09 [1] CRAN (R 3.6.3)              
 rlang         0.4.5      2020-03-01 [1] CRAN (R 3.6.3)              
 rmarkdown     2.1        2020-01-20 [1] CRAN (R 3.6.3)              
 rstudioapi    0.11       2020-02-07 [1] CRAN (R 3.6.3)              
 sessioninfo   1.1.1      2018-11-05 [1] CRAN (R 3.6.3)              
 withr         2.1.2      2018-03-15 [1] CRAN (R 3.6.3)              
 xfun          0.12       2020-01-13 [1] CRAN (R 3.6.3)              
 yaml          2.2.1      2020-02-01 [1] CRAN (R 3.6.2)
4

2 回答 2

2

在新版本中弄清楚这papaja一点真的很难!我的解决方案是基于这个答案

如果您从标题区域中删除注释并将其添加到某个header-includes部分,它将起作用:

header-includes:
  - \note{Forthcoming in \textit{Journal of Jerkface Psychobabble}.}

本质上,您的新 yaml 需要:

---
title             : "My paper"
shorttitle        : "My jerky paper"

author: 
  - name          : "A. Jerk"
    affiliation   : "1"
    corresponding : yes    # Define only one corresponding author
    address       : "Back alley, New Jersey"
    email         : "a-jerk@hotmail.com"

affiliation:
  - id            : "1"
    institution   : "University of Stuff"

authornote: |
  Shout out to my man Wilbur.

abstract: |
  This paper is amazing

keywords          : "Awesome"


floatsintext      : no
figurelist        : no
tablelist         : no
footnotelist      : no
linenumbers       : no
mask              : no
draft             : no
keep_tex          : yes

documentclass     : "apa6"
classoption       : "man"
output            : papaja::apa6_pdf
header-includes:
  - \note{Forthcoming in \textit{Journal of Jerkface Psychobabble}.}
于 2020-05-05T22:30:00.283 回答
1

使用最新的开发版本 ( remotes::install_github("crsh/papaja@devel")),您应该能够使用惯用的 markdown 语法来设置注释的样式:

note              : "Forthcoming in *Journal of Jerkface Psychobabble*."
于 2020-06-16T07:14:36.297 回答