Skip to content

Commit

Permalink
Update R/conversion.R
Browse files Browse the repository at this point in the history
Co-authored-by: Yihui Xie <[email protected]>
  • Loading branch information
elong0527 and yihui authored Apr 14, 2024
1 parent 0620b9d commit 8324592
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion R/conversion.R
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ convert <- function(text,

unicode_int <- as.integer(as.hexmode(unicode_latex$unicode))
char_latex <- ifelse(unicode_int <= 255 & unicode_int != 177, unicode_latex$chr,
paste0("\\uc1\\u", unicode_int - if (unicode_int < 32768) 0 else 65536, "*")
sprintf("\\uc1\\u%d*", unicode_int - if (unicode_int < 32768) 0 else 65536)
)

names(char_latex) <- unicode_latex$latex
Expand Down

0 comments on commit 8324592

Please sign in to comment.