0

The error is as follows

)) (C:\Program Files\MiKTeX\tex/latex-dev/graphics\mathcolor.ltx))
! Argument of � has an extra }.
<inserted text> 
                \par 
l.8 \end{document}

?

This is my code

\documentclass[a4paper]{article}

\usepackage[utf8x]{inputenc} \usepackage[colorlinks=true, allcolors=blue]{hyperref}

\begin{document} This is a \href{www.duckduckgo.com}{hyperlink} \end{document}

If I remove either of the \usepackage's, the code compiles. Although of course, removing the second package would mean I cannot use hyperlinks in my document. So my question is: Can I safely remove \usepackage[utf8x]{inputenc} from all my files, or would it cause other issues?

More background: I updated all my packages after a long while and I got this error, and narrowed the issue down to here. Why is this issue caused?

Ingmar
  • 6,690
  • 5
  • 26
  • 47
mudders
  • 23
  • 2
    \usepackage[utf8x]{inputenc} can be safely removed, since a few years LaTeX automatically assumes utf8 for the input. – Marijn Aug 14 '22 at 11:08
  • Yes, remove inputenc and/or compile with LuaLaTeX (which would simply ignore it). – Ingmar Aug 14 '22 at 11:18
  • Unfortunately the default inputenc is not a complete replacement of utf8x (e.g. Unicode character input in math mode with legacy output font encoding is not supported), but it's true that utf8x breaks a lot of things. Not many options now for non-TeX-programmers. – user202729 Aug 14 '22 at 11:50
  • a new version of the ucs package has been uploaded to ctan. It is already in texlive and miktex will catch up at the next update. With it your example compiles again. But it will then not do more as you get by simply deleting the line. If you really need some of the special features of the ucs package you will have to load the package explicitly. – Ulrike Fischer Aug 14 '22 at 12:29
  • @user202729 inputenc supports math you just need a file of suitable definitions. there are answers here using all command names known to Unicode math for example; – David Carlisle Aug 14 '22 at 16:47
  • @DavidCarlisle https://tex.stackexchange.com/questions/601579/unicode-maths-in-pdflatex/601583#601583 isn't it. Yes I know. – user202729 Aug 14 '22 at 16:49
  • yes thanks on my phone didn't want to search, I may package a nicer interface to that – David Carlisle Aug 14 '22 at 18:08
  • @Marijn I'm not sure this should have been closed as a duplicate of a 6 year old question as the error is specific to the Jun 2020 LaTeX release (and I released a utf8x update yesterday to address it) – David Carlisle Aug 14 '22 at 21:55
  • @DavidCarlisle I wasn't sure about the exact problem in this question, but because the code of the OP was from some time ago and they didn't specifically mention that they need utf8x for something, I thought the general advice of "don't use utf8x" given in the proposed duplicate would apply here. Maybe I was wrong and this question could be reopened and answered with "this is fixed with a newly released update". – Marijn Aug 15 '22 at 06:42

0 Answers0