You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to this question, I would like to ask what I should configure to use any TeX engines, rather than pdflatex when I knit a document in RStudio. My final goal is following: just pressing knit button creates the right PDF output, calling the TeX engines I want to use.
My question may seem similar to this but due to the difference in the final goals, I newly raised the issue.
What I intend to do by customizing the TeX engines
I'm trying to use jecon-unicode.bst to produce my citation sections (I changed the file name as jeconunicode.bst in my working directory due to the error with the hyphen in the file name). Since, in my case, there is no .csl file which satisfies my citation style, I have to specify .bst file in biblio-style line in the YAML of .Rmd as shown below.
Since jecon-unicode.bst adopt different citation styles according to the language, the user has to allow the .bst to recognize which article is written in Japanese. To do so, it is necessary to add language = {ja}.
@article{ST-jp,
title = {われらの発見について:変貌を遂げつつある何とかの将来に関する過去・現在・未来},
journal = {何十華論考},
volume = 42,
number = 5,
pages = {128 -- 182},
year = {2021},
author = {鈴木, 一郎 and 田中, 太郎},
language = {ja}
}
@article{ST-en,
title = {Our first investigation: this is not the first, but this should be the last},
journal = {Journal of Something},
volume = 23,
number = 5,
pages = {19 -- 176},
year = 2032,
author = {Suzuki, Ichiro and Tanaka, Taro}
}
The example of the desirable output
By using jecon-unicode.bst, I can cite the documents published in English in APA style. Simultaneously, I can also cite the documents written in Japanese following the style common with Japanese academic societies. I intend to make the citation section as shown below:
However, in order to use this .bst file, the users have to activate (u)pbibtex to resolve Japanese characters correctly.
What I have done so far
My goal is, by bookdown::pdf_document2 of RStudio insatlled in my Windows 10, knitting a document which finally requires lualatex + pbibtex engines to be processed rightly, as I mentioned before.
So far, I have tried options(tinytex.latexmk.emulation = FALSE) on R console, following the guide to avoid using tinytex's emulation, so that I can directly use latexmk command of TeX from RStudio, rather than tinytex's latexmk'. Moreover, I wrote a .latexmkrc file to specify which TeX engines should be use to compile a .tex files and placed the file in R's home dir, TeX's home dir and my current working dir.
However, pressing knit button (or ctrl + shift + k) and tinytex::latexmk() fail to produce the pdf output because RStudio always calls pdflatex. I also tried tinytex::latexmk(..., engine = "lualatex") but still RStudio seems to call pdflatex. In each way, I got .tex file and other auxiliary files. I also received the following error message.
In fact, I haven't installed tinytex itself, though I do have tinytex package in my R, because I've already have a huge TeX system called TeX Live 2018.
Related to Yihui's comment, I think my RStudio directly calls TeX Live 2018 in my computer, because when I comment out citation_package: natbib in test2.Rmd, I do get a PDF file though its citation section is not correct.
The text was updated successfully, but these errors were encountered:
@yihui
Related to this question, I would like to ask what I should configure to use any TeX engines, rather than
pdflatex
when I knit a document in RStudio. My final goal is following: just pressing knit button creates the right PDF output, calling the TeX engines I want to use.My question may seem similar to this but due to the difference in the final goals, I newly raised the issue.
What I intend to do by customizing the TeX engines
I'm trying to use
jecon-unicode.bst
to produce my citation sections (I changed the file name asjeconunicode.bst
in my working directory due to the error with the hyphen in the file name). Since, in my case, there is no.csl
file which satisfies my citation style, I have to specify.bst
file inbiblio-style
line in the YAML of.Rmd
as shown below.test2.Rmd
myref.bib
Since
jecon-unicode.bst
adopt different citation styles according to the language, the user has to allow the.bst
to recognize which article is written in Japanese. To do so, it is necessary to addlanguage = {ja}
.The example of the desirable output
By using
jecon-unicode.bst
, I can cite the documents published in English in APA style. Simultaneously, I can also cite the documents written in Japanese following the style common with Japanese academic societies. I intend to make the citation section as shown below:However, in order to use this
.bst
file, the users have to activate(u)pbibtex
to resolve Japanese characters correctly.What I have done so far
My goal is, by
bookdown::pdf_document2
of RStudio insatlled in my Windows 10, knitting a document which finally requireslualatex
+pbibtex
engines to be processed rightly, as I mentioned before.So far, I have tried
options(tinytex.latexmk.emulation = FALSE)
on R console, following the guide to avoid using tinytex's emulation, so that I can directly uselatexmk
command of TeX from RStudio, rather thantinytex
'slatexmk
'. Moreover, I wrote a.latexmkrc
file to specify which TeX engines should be use to compile a.tex
files and placed the file in R's home dir, TeX's home dir and my current working dir.However, pressing knit button (or
ctrl
+shift
+k
) andtinytex::latexmk()
fail to produce the pdf output because RStudio always callspdflatex
. I also triedtinytex::latexmk(..., engine = "lualatex")
but still RStudio seems to callpdflatex
. In each way, I got.tex
file and other auxiliary files. I also received the following error message.I've tried
tinytex::lualatex()
, too. However, it had stuck without any error messege, though it produced a.tex
file and other auxil files.Then, is there any way to force RStudio to use TeX engine which the user specifies in
.latexmkrc
file to create a PDF output?BTW, my attempts did created
test2.tex
and executinglatexmk test2
on the shell (Windows PowerShell, in my environment) produces the desirable PDF.Session Infos
In fact, I haven't installed
tinytex
itself, though I do havetinytex
package in my R, because I've already have a huge TeX system called TeX Live 2018.Related to Yihui's comment, I think my RStudio directly calls TeX Live 2018 in my computer, because when I comment out
citation_package: natbib
intest2.Rmd
, I do get a PDF file though its citation section is not correct.The text was updated successfully, but these errors were encountered: