6

The command \uppercase does not work properly with certain accented characters, like the Hungarian ő or ű or such characters as ł, đ and ć. If I type the characters like \H{o}, it works, but I'd like to type it directly as ő, as it's used multiple times. Could you suggest a workaround?

\documentclass{article}

\usepackage{t1enc}
\usepackage[utf8]{inputenc}

\begin{document}
\uppercase{árvízt\H{u}űr\H{o}ő tükörfúrógép đdłlćc}
\end{document}

enter image description here

1
  • 1
    t1enc is obsolete and should be replaced by \usepackage[T1]{fontenc}
    – egreg
    Jul 18 '20 at 7:18
8

\uppercase is a TeX "primitive". If you use the LaTeX macro \MakeUppercase instead, you'll achieve your objective easily.

You should also replace the obsolete \usepackage{t1enc} with \usepackage[T1]{fontenc}.

enter image description here

Observe, incidentally, that the output of \uppercase{ű} is ő, which is rather incorrect.

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

\begin{document}
\texttt{\string\uppercase}:
\uppercase{árvízt\H{u}űr\H{o}ő tükörfúrógép đdłlćc}

\medskip
\texttt{\string\MakeUppercase}:
\MakeUppercase{árvízt\H{u}űr\H{o}ő tükörfúrógép đdłlćc}
\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.