~ninjin/Unicode2LaTeX.jl

Tiny Julia library for mapping Unicode characters to their corresponding LaTeX-internal form
Remove test target `--check-bounds`, is implicit
Consistent quoting in Makefile

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~ninjin/Unicode2LaTeX.jl
read/write
git@git.sr.ht:~ninjin/Unicode2LaTeX.jl

You can also use your local clone with git send-email.

Unicode2LaTeX is a tiny Julia library for mapping Unicode characters to their corresponding LaTeX-internal form. While modern TeX engines have Unicode support, passing pure ASCII data is a safer option when programmatically generating content to be consumed by a TeX engine not under your control.

#Installation

Simply use the Julia package manager:

add Unicode2LaTeX

#Usage

Unicode2LaTeX exports a single function that maps strings and characters to their corresponding LaTeX-internal form:

using Unicode2LaTeX

unicode2latex('ö') # => "\\\"o"
unicode2latex("Kurt Gödel") # => "Kurt G\\\"odel"

Do note that ASCII characters are left in place, as TeX already knows how to interpret them.

#Extracurricular reading

To produce this library it was necessary to go deep down a rabbit hole of LaTeX internals. If you also want to find out what lurks in the depths of LaTeX input encoding and font output encoding, you may find the following documents useful:

  1. “Providing some UTF-8 support via inputenc”
  2. “LaTeX font encodings”
  3. “Cyrillic languages support in LaTeX”