1

I must use PdfLaTeX to compile, so no XeLaTeX.

I have some unicode characters in the document. I want to somehow declare with a LaTeX command in the header that whenever PdfLaTeX meets a certain unicode character in my document, it replaces it with some predefined LaTeX code.

Packages like utf8 don't cover all possibilities that is why I am asking how to do this explicitly character by character.

How can I do that?

jam
  • 113
  • 1
    Welcome to TeX.SX! Like this: https://tex.stackexchange.com/q/512379/134574, or this: https://tex.stackexchange.com/q/522945/134574? – Phelype Oleinik Feb 10 '20 at 11:30
  • 1
    You probably need to be a bit more specific, what exactly are the chars you are looking for? – daleif Feb 10 '20 at 11:35
  • I have many word documents that contain math formulas. I convert them to latex with pandoc, but it leaves lots of unknown unicode characters. I could replace them by hand but its long to do for each file. – jam Feb 10 '20 at 12:11
  • One non latex solution to my problem, is just to write a script in whatever language to replace all unicode characters occurences by their relevant latex code – jam Feb 10 '20 at 12:13

1 Answers1

0

You should probably use newunicodechar package. https://ctan.org/pkg/newunicodechar

ivankokan
  • 1,046