R: Encode UTF-8 text to LaTeX

encoded_utf_to_latex {cffr} | R Documentation

## Encode UTF-8 text to LaTeX

### Description

Transform a UTF-8 string to LaTeX special characters.

### Usage

    encoded_utf_to_latex(x)

### Arguments

`x` | A string, possibly encoded in UTF-8 encoding system.

### Details

This is a variation of `tools::encoded_text_to_latex()` performing some additional replacements to increase compatibility.

### Value

A string with the corresponding transformations.

### See Also

`tools::encoded_text_to_latex()`

Other bibtex: `cff_extract_to_bibtex()`, `cff_to_bibtex()`, `write_bib()`

### Examples

    # Full range of supported characters on R
    library(tools)

    range <- 1:511

    ascii_table <- data.frame(
      dec = range,
      utf8 = intToUtf8(range, multiple = TRUE)
    )

    # Add latex using base approach
    ascii_table$latex_base <- encoded_text_to_latex(ascii_table$utf8,
      encoding = "UTF-8"
    )

    # With cffr
    ascii_table$latex_cffr <- encoded_utf_to_latex(ascii_table$utf8)

    ascii_table

[Package cffr version 0.2.1 Index]