עברית ב- RmarkDown

492 views
Skip to first unread message

Ariel Karlinsky

unread,
Mar 20, 2019, 4:50:45 AM3/20/19
to Israel R User Group
הי,

אני מנסה לקמפל מסמך RMD שמכיל גם עברית. זה עובד כ-HTML, אבל אם אני רוצה PDF אני מקבל את השגיאה הבאה:

output file: try.knit.md

! Package inputenc Error: Unicode char × (U+5D0)
(inputenc)                not set up for use with LaTeX.

Error: Failed to compile try.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See try.log for more info.
Execution halted

 בנוסף, האם יש דרך ב-r markdown לעשות את הכיוון כתיבה RTL? 

תודה!

Or Avishay Rizi

unread,
Mar 20, 2019, 5:04:04 AM3/20/19
to Israel R User Group

לגבי שינוי הכיוון
אתה יכול להוסיף לפני הטקסט בעברית את השורה הבאה. 
<div text-align: right; dir="rtl">

לדוגמה:
<div text-align: right; dir="rtl">
## כותרות בעברית
מלל בעברית

## עוד כותרת בעברית
עוד פסקה כאן
<div text-align: left; dir="ltr">
with a line in English
<div text-align: right; dir="rtl">


Jonathan Rosenblatt

unread,
Mar 20, 2019, 6:50:53 AM3/20/19
to israel-r-...@googlegroups.com
תנסה לקמפל עם xelatex במקום pdflatex

--
You received this message because you are subscribed to the Google Groups "Israel R User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to israel-r-user-g...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
--
Jonathan Rosenblatt
Dept. of Industrial Engineering and Management
Ben Gurion University of the Negev

Michael Dorman

unread,
Mar 20, 2019, 8:31:10 AM3/20/19
to israel-r-...@googlegroups.com
אכן כמו שיונתן כתב כדאי להשתמש ב-xelatex

להלן ה-header שאני משתמש בו בקובץ Rmd שהופך ל-PDF עם עברית - 
---
header-includes:
   - \usepackage{wrapfig}
   - \newfontfamily\hebrewfont{David CLM}
   - \let\hebrewfonttt\ttfamily
   - \usepackage{polyglossia}
   - \setdefaultlanguage{hebrew}
output:
  pdf_document:
    latex_engine: xelatex
    highlight: NULL
classoption: 12pt
---

Ariel Karlinsky

unread,
Mar 24, 2019, 10:10:57 AM3/24/19
to Israel R User Group
תודה לכולם על התגובות!
אור - אני מעדיף לא להכניס קוד HTML למסמך RMD עצמו. אפשר להגדיר את זה ב-CSS ולקשר אליו?

יהונתן ומיכאל - כאשר אני משנה את ה-engine ל-xelatex, גם אם אין עברית כלל במסמך, אני מקבל את השגיאה:

output file: try3.knit.md

! Missing number, treated as zero.
<to be read again> 
                   \primitive 
l.7649 ...d:nn { \tex_primitive:D \time } { 60 } }

Error: Failed to compile try3.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See try3.log for more info.
Execution halted

Jonathan Rosenblatt

unread,
Mar 24, 2019, 10:12:47 AM3/24/19
to israel-r-...@googlegroups.com
האם וידאת ש xelatex מותקן אצלך?
האם אתה שומר את הקובץ ב- UTF8?

--
You received this message because you are subscribed to the Google Groups "Israel R User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to israel-r-user-g...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ariel Karlinsky

unread,
Mar 24, 2019, 10:19:35 AM3/24/19
to israel-r-...@googlegroups.com
סליחה על הבורות, אבל איך אני יכול לבדוק ש-xelatex אכן מותקן אצלי? הניסיון שלי עם latex מסתכם ב-Lyx.

אריאל קרלינסקי
Ariel Karlinsky

Or Avishay Rizi

unread,
Mar 24, 2019, 10:45:03 AM3/24/19
to Israel R User Group

אני מסכים שזה מכוער להשתמש בHTML בתוך הrmd.

אפשר כמובן ב ,bookdown אני לא מכיר דרך לעשות את זה ב rmarkdown (אבל קטונתי). בכל אופן, גם אם היית יכול, אם יש עברית פה ושם, האם היית יכול להכליל את זה לתוך ה-?CSS



On Sunday, March 24, 2019 at 4:12:47 PM UTC+2, Jonathan Rosenblatt wrote:
האם וידאת ש xelatex מותקן אצלך?
האם אתה שומר את הקובץ ב- UTF8?

On Sun, Mar 24, 2019 at 4:11 PM Ariel Karlinsky <karl...@gmail.com> wrote:
תודה לכולם על התגובות!
אור - אני מעדיף לא להכניס קוד HTML למסמך RMD עצמו. אפשר להגדיר את זה ב-CSS ולקשר אליו?

יהונתן ומיכאל - כאשר אני משנה את ה-engine ל-xelatex, גם אם אין עברית כלל במסמך, אני מקבל את השגיאה:

output file: try3.knit.md

! Missing number, treated as zero.
<to be read again> 
                   \primitive 
l.7649 ...d:nn { \tex_primitive:D \time } { 60 } }

Error: Failed to compile try3.tex. See https://yihui.name/tinytex/r/#debugging for debugging tips. See try3.log for more info.
Execution halted

--
You received this message because you are subscribed to the Google Groups "Israel R User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to israel-r-user-group+unsub...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

ido bar

unread,
Mar 26, 2019, 12:15:33 AM3/26/19
to israel-r-...@googlegroups.com
תתקין tinytex (מתוך R), זה יתקין גם xelatex


Ido Bar | PhD

Mob: +61 (4) 3571 8770

Twittertwitter.com/DrIdoBar | LinkedIn: www.linkedin.com/in/idobar

Reply all
Reply to author
Forward
0 new messages