[Tex/LaTex] UTF-8 characters not rendered properly

font-encodingsunicode

I have a problem with some of the UTF-8 characters that are in my Tex file. Although I am saving the file in UTF-8 and my text editor (Atom) is displaying all of the characters properly, LaTeX throws errors like these:

[no file]:824: Package inputenc Error: Unicode character Δ (U+394) [...tes $(x,y)$ are $x=x_0+Δx$ and $y=y_0+Δ]
[no file]:857: Package inputenc Error: Invalid UTF-8 byte sequence. [ # calculate ω]
[no file]:857: Package inputenc Error: Invalid UTF-8 byte 137. [ # calculate ω]
[no file]:889: Package inputenc Error: Unicode character θ (U+3B8) [...ce $r$. It was previously at an angle $θ]
[no file]:889: Package inputenc Error: Unicode character ω (U+3C9) [...ngle $θ$ and is now at an angle $θ + ω]
[no file]:976: Package inputenc Error: Invalid UTF-8 byte sequence. [ # calculate ω]

I have tried using utf (and utfx) package to no avail:

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

Here is the entirety of the file: https://pastebin.com/dzzLtUmB.

The formatting might be a little rough on the eyes, because it's generated.

Is there something I could do to fix this?

Best Answer

If I add draft so latex does not stop at the missing figures, there are several errors due to incorrect math mode markup, and some utf8 characters that need to be redefined but you do not get the error

[no file]:976: Package inputenc Error: Invalid UTF-8 byte sequence. [ # calculate ω]

I suspect that you have an older latex release and have a hit a bug in the UTF8 decoder, possibly

https://github.com/latex3/latex2e/pull/83

Make sure that you have an up to date latex.

After adding [draft] to skip past the missing images the remaining warnings are

$ grep -i 'invalid\|error' bb251.log | sort | uniq
! Package amsmath Error: Erroneous nesting of equation structures;
! Package inputenc Error: Unicode character Δ (U+0394)
! Package inputenc Error: Unicode character θ (U+03B8)
! Package inputenc Error: Unicode character ω (U+03C9)
LaTeX Font Warning: Command \large invalid in math mode on input line 659.
LaTeX Font Warning: Command \large invalid in math mode on input line 788.
LaTeX Font Warning: Command \large invalid in math mode on input line 792.
LaTeX Font Warning: Command \large invalid in math mode on input line 794.
LaTeX Font Warning: Command \large invalid in math mode on input line 820.
LaTeX Font Warning: Command \large invalid in math mode on input line 822.
LaTeX Font Warning: Command \large invalid in math mode on input line 900.
LaTeX Font Warning: Command \large invalid in math mode on input line 904.
LaTeX Font Warning: Command \large invalid in math mode on input line 908.
LaTeX Font Warning: Command \large invalid in math mode on input line 916.
LaTeX Font Warning: Command \large invalid in math mode on input line 920.
LaTeX Font Warning: Command \large invalid in math mode on input line 922.
LaTeX Font Warning: Command \large invalid in math mode on input line 926.
LaTeX Font Warning: Command \large invalid in math mode on input line 928.
LaTeX Font Warning: Command \large invalid in math mode on input line 932.
LaTeX Font Warning: Command \large invalid in math mode on input line 934.