Comments (11)
Thanks for flagging this! :)
Can you show me an example of Japanese input, and the garbled output, so I can have a look at what the issue is?
from oxforddown.
The part before "Why use it?" in the Introduction is now in Japanese as attached.
BTW, Is this the correct way to contact you?
#########################################
options for knitting a single chapter
#########################################
オックスフォード大学で自分の博士論文を書く際に作成したRMark-down用の論文テンプレート、oxforddown
[@lyngsOxforddown2019]へようこそ。このテンプレートでは、RMarkdownで書きながら、美しく実績のあるOxThesisLaTeXテンプレートでPDF出力をフォーマットすることができ,かつ,長い間使われてきた美しいOxThesisLaTeXテンプレートでPDF出力をフォーマットすることができます。my own PhD thesis at the University of Oxford.
もしあなたがTeXやLaTeXを使ったことがないのであればR Markdownで論文を書くことで、OxThesisテンプレートへのより良いインターフェイスを提供できることを願っています。さらに重要なことは、R Markdownを使うと、論文の中にコードの塊を埋め込むことができ、コピー&ペーストの手順を避けて、基礎となるデータから直接プロットや表を生成することができるということです。これにより、再現可能な研究を行う習慣が身に付き、研究者としての長期的な利益となり、将来的にあなたの結果を再現したり構築したりしようとする人の助けにもなるのです。
Why use it? {.unnumbered}
-------Error message------
processing file: 00-introduction.Rmd
output file: 00-introduction.knit.md
! Package inputenc Error: Unicode character オ (U+30AA)
(inputenc) not set up for use with LaTeX.
Try other LaTeX engines instead (e.g., xelatex) if you are using pdflatex. See https://bookdown.org/yihui/rmarkdown-cookbook/latex-unicode.html
エラー: LaTeX failed to compile 00-introduction.tex. See https://yihui.org/tinytex/r/#debugging for debugging tips. See 00-introduction.log for more info.
追加情報: 警告メッセージ:
1: grep("^\s*$", x) で: 入力文字列 1824 はこのロケールでは不適切です
2: grep("^! ", x) で: 入力文字列 1824 はこのロケールでは不適切です
実行が停止されました
from oxforddown.
Fonts are specified: "MS Mincho" for Japanese and Times "New Roman for Roman" for Europe, US matters.
from oxforddown.
I just looked into this:
As per this latex stack exchange, one way to write Japanese characters in LaTeX is to
- use the
xelatex
LaTeX engine instead ofpdflatex
(whichoxforddown
uses by default) - add the LaTeX package
xeCJK
To do this with oxforddown
, adjust the 'output details' section of index.Rmd to the following:
header-includes:
- \usepackage{xeCJK}
output:
bookdown::pdf_book:
latex_engine: xelatex
citation_pa... (etc.)
Does this work?
from oxforddown.
before input, Japanese characters got an
Error message:
register() で:
Can't find generic scale_type
in package ggplot2 to register S3 method.
yaml::yaml.load(..., eval.expr = TRUE) でエラー:
Parser error: while parsing a block collection at line 152, column 3 did not find expected '-' indicator at line 153, column 3
呼び出し: ... parse_yaml_front_matter -> yaml_load ->
実行が停止されました
When I add #####################
output details
#####################
header-includes:
-\usepackage{xeCJK}
output:
bookdown::pdf_book:
latex_engine: xelatex
citation_package: biblatex
macOS Big Sur 11.5.2, XQuartz 2.8.1(xorg-server 1.20.11)
R version 4.1.3(2022-03-10) -- "One Push-Up"
RStudio 1.4.1717
from oxforddown.
Can you confirm that you used exactly the same indentation as in my example above? It seems like this is just a parsing error of the YAML header. So, for example, you must put two spaces before " - \usepackage{xeCJK}".
As a starting point, try creating a new, R Markdown file that contains only the following, and knit it:
---
header-includes:
- \usepackage{xeCJK}
output:
pdf_document:
latex_engine: xelatex
---
オックスフォ
Can you confirm that this works?
from oxforddown.
I did a new RMarkdown with only 4 lines and put two spaces before " -\usepackage{xeCJK} then showed the following;
The following objects are masked from 'package:base':
errorCondition
Error message:
Can't find generic scale_type
in package ggplot2 to register S3 method.
|......................................................................| 100%
ordinary text without R code
/Applications/RStudio.app/Contents/MacOS/pandoc/pandoc +RTS -K512m -RTS test_Japanese_character.knit.md --to html4 --from markdown+autolink_bare_uris+tex_math_single_backslash --output test_Japanese_character.html --lua-filter /Library/Frameworks/R.framework/Versions/4.1/Resources/library/rmarkdown/rmarkdown/lua/pagebreak.lua --lua-filter /Library/Frameworks/R.framework/Versions/4.1/Resources/library/rmarkdown/rmarkdown/lua/latex-div.lua --self-contained --variable bs3=TRUE --standalone --section-divs --template /Library/Frameworks/R.framework/Versions/4.1/Resources/library/rmarkdown/rmd/h/default.html --no-highlight --variable highlightjs=1 --variable theme=bootstrap --mathjax --variable 'mathjax-url=https://mathjax.rstudio.com/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML' --include-in-header /var/folders/vg/yh8xwzx52dq7dy_mzblw7dl40000gn/T//RtmpGcI3iC/rmarkdown-str28fe35ba391d.html
processing file: test_Japanese_character.Rmd
output file: test_Japanese_character.knit.md
[WARNING] This document format requires a nonempty <title> element.
Defaulting to 'test_Japanese_character.knit' as the title.
To specify a title, use 'title' in metadata or --metadata title="...".
Output created: test_Japanese_character.html
from oxforddown.
Can you show me the content of the entire R Markdown file you created, and I'll try to reproduce the error?
from oxforddown.
from oxforddown.
No, I meant can you confirm that you put only this content in a brand-new R Markdown file in a brand-new project?
---
header-includes:
- \usepackage{xeCJK}
output:
pdf_document:
latex_engine: xelatex
---
オックスフォ
So forgetting everything about oxforddown
for a minute, are you normally able to use Japanese characters in R Markdown documents and output to PDF without any issues?
from oxforddown.
from oxforddown.
Related Issues (20)
- "Render" output HOT 2
- Problem with number of authors and the et al. abbreviation HOT 1
- Figure caption placement HOT 2
- package ‘xelatex’ is not available for this version of R HOT 1
- Linespacing varies amongst pages HOT 8
- Table of contents preventing the LaTeX from compiling for PDF output HOT 5
- if show-abstract-in-toc: true, Abstract TOC hyperlink is to Acknowledgements HOT 1
- Cannot find font information and ways to change it HOT 1
- remove the page breaks for each chapter HOT 1
- Issues with pandoc-citeproc in oxforddown HOT 2
- Compilation problems HOT 4
- Adapting headings to local language
- Cannot Knit
- how create numbered examples HOT 1
- Note below figure in graphic environment
- Minitocs shift pages through the space they take up but don't adjust for this
- Missing Book Title in Bibliography Citations (citing book section)
- How to change font style
- cleaning auxiliary files when knitting single chapter HOT 2
- fresh downloaded oxforddown not building HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from oxforddown.