rstudio / rticles

LaTeX Journal Article Templates for R Markdown
https://pkgs.rstudio.com/rticles/
1.46k stars 516 forks source link

! Package inputenc Error: Unicode char \u8:γ not set up for use with LaTeX. #69

Closed englianhu closed 6 years ago

englianhu commented 8 years ago

---
author:
  - name: ®γσ Lian Hu, ENG
    affiliation: Coursera/Scibrokes®
    address: >
      43300 Seri Kembangan
      Selangor, Malaysia.
    email: englianhu@gmail.com/englianhu@scibrokes.com
    url: https://github.com/scibrokes/owner
title:
  formatted: "A Capitalized Title: Something about a Package \\pkg{Rmodel}"
  # If you use tex in the formatted title, also supply version without
  plain:     "A Capitalized Title: Something about a Package foo"
  # For running headers, if needed
  short:     "\\pkg{Rmodel}: A Capitalized Title"
abstract: >
  The abstract of the article.
keywords:
  # at least one keyword must be supplied
  formatted: [keywords, not capitalized, "\\proglang{Java}"]
  plain:     [keywords, not capitalized, Java]
preamble: >
  \usepackage{amsmath}
output: rticles::jss_article

---

Below error prompted me when I knitted.

output file: Odds_Modelling_and_Testing_Inefficiency_of_Sports-Bookmakers.knit.md

- ! Package inputenc Error: Unicode char \u8:γ not set up for use with LaTeX.

- See the inputenc package documentation for explanation.
- Type  H <return>  for immediate help.
 ...                                              

- l.40 \begin{document}

- Try running pandoc with --latex-engine=xelatex.
- pandoc: Error producing PDF from TeX source
- Error: pandoc document conversion failed with error 43
- Execution halted

When I check the tex file and tried to look at the structure and the process of knit2pdf..

\documentclass[article]{jss}
\usepackage[utf8]{inputenc}

\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}

\author{
®γσ Lian Hu, ENG\\Coursera/Scibrokes®
}
\title{A Capitalized Title: Something about a Package \pkg{foo}}
\Keywords{keywords, not capitalized, \proglang{Java}}

\Abstract{
The abstract of the article.
}

\Plainauthor{®γσ Lian Hu, ENG}
\Plaintitle{A Capitalized Title: Something about a Package foo}
\Shorttitle{\pkg{foo}: A Capitalized Title}
\Plainkeywords{keywords, not capitalized, Java}

ov3ut4m 1

englianhu commented 8 years ago

I found there has similar error and try to modify the tex file but the outcome doesn't appear the latin greek letters.

oxhubz2 1

gcmicah commented 6 years ago

Hi, I'm experiencing the same error. have you found a solution? can you please share?

yihui commented 6 years ago

The LaTeX engine xelatex is much friendlier than the default pdflatex when your document contains multibyte characters. I'd try

output:
  rticles::jss_article:
    latex_engine: xelatex
github-actions[bot] commented 3 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.