I had to reinstall my Anaconda Python and it seems to be screwing up the use of Mathjax for some reason, ignoring my backslash-escaped dollar signs. The following raw content:
pears are \$8 million each, and apples are \$6 million.
turns into
How can I fix this or even debug it?
Related
I am trying to use R in VSCode. I downloaded the R extension and followed the steps specified but I keep getting an annoying issue: when I use Alt+126 to write the character '~' in the script everything is fine, but when I run the line, in the R interactive terminal it appears twice. Also, if I use Alt+126 in the R interactive terminal, '~~' appears instead of '~' (two times the character instead of once). I have no idea why this is happening, I tried to uninstall and reinstall both VSCode and R and reset the pc but nothing changed.
I hope somebody knows how to solve this, thanks in advance!
I want to remove those red lines in r studio.
I upgraded to the latest version, according to someone's suggestion.
But it is not working.
The problem occurs when I write Korean words.
The default encoding is UTF-8.
I found a similar problem here, but it didn't work for me.
https://community.rstudio.com/t/why-and-where-is-a-an-unexpected-token-in-r-and-how-should-i-deal-with-it/26496/4
df$번호
df$이름
df$성별
This is a bug -- unfortunately, the RStudio diagnostics system does not correctly handle multibyte characters in R Markdown documents on Windows. This will hopefully be fixed in the next release (v1.3).
ggplot(data=NULL,aes(x=1,y=1))+
geom_text(size=10,label="ক্ত", family="Kohinoor Bangla")
On my machine, the Bengali conjunct cluster "ক্ত" is rendered as its constituents plus a virana:
I have tried several different fonts to no avail. Is there a trick to making conjuncts render correctly?
EDIT:
Explicitly using the unicode still doesn't not render correctly:
This renders correctly for me:
print(stringi::stri_enc_toutf8("\u0995\u09cd\u09a4"))
This still gives me the exact same result as before
ggplot(data=NULL,aes(x=1,y=1))+
geom_text(size=10,label="\u0995\u09cd\u09a4", family="Kohinoor Bangla")
Why is there a difference between the console output and ggplot output?
I'm not familiar with the Bengali language, but if you would look up the unicode characters for the text that you want to render, you could simply use those in geom_text()
# According to unicode code chart, these are some Bengali characters
# U+099x4
# U+09Ex3
ggplot(data=NULL,aes(x=1,y=1))+
# Substitute 'U+' by '\u', leave the 'x' out
geom_text(size = 10, label = "\u0994\u09E3")
Substitute the unicode characters as you see fit.
Hope that helped!
EDIT: I tried your last piece of code, which gave me a warning about the font not being installed. So I ran it without the family = "Kohinoor Bangla":
ggplot(data=NULL,aes(x=1,y=1))+
geom_text(size=10,label="\u0995\u09cd\u09a4")
Which gave me the following output:
From a visual comparison with the character that you posted, it looks quite similar. Next, I ran the same piece of code on my work computer, which gave me the following output:
The difference between work and home, is that work runs on a linux, while home runs on windows, work has R 3.4.4, home has R 3.5.3. Both are in RStudio, both are ggplot 3.2.0. I can't update R on work because of backwards compatibility issues, to check wether the version of R might be the problem. However, you could check wether your version of R is older than 3.5.3 and see if updating relieves the problem. Otherwise, I would guess it is a platform issue.
Macs and androids have non-english keyboards that are easy to integrate and use.
How to use non-english, non-latin scripts in plots?
plot(1:10,main="हिन्दी नाम")
This gives me empty boxes at title (latest Rstudio on latest mac).
After some (more) trial and error, here is a possible direction:
par(family="Kohinoor Devanagari")
plot(1:10,main="हिन्दी नाम")
This does the job somewhat! But not quite satisfactory as the words don't show up properly.
Dear Friends in the knitr community with lyx and Apple Mac
Hello! I am using Apple Mac for Reproducible research of R. Currently, I enjoy knitr in lyx for writing some R scripts. The problem I have is related non-English characters, specially Korean in the knitr chunk.
When I type any Korean Character in a Chunk for typing file name or some extra explanations in #, the pdf output of the file does not print Korean properly. No matter of choosing or not choosing the option "eval=FALSE", R in lyx does not show Korean on the output. But, in the ordinary text part of the writing, Korean shows well. This problem seems to be Apple Mac specific, because another lyx environment in Linux (ubutu) makes the similar problem at al. Is it a lyx issue with MacTex or knitr one? Thank you in advance.
regards,
Jong-Hwa