TransWikia.com

Problem with converting accented characters to uppercase

TeX - LaTeX Asked on November 1, 2021

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íztH{u}űrH{o}ő tükörfúrógép đdłlćc}
end{document}

enter image description here

One Answer

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{stringuppercase}:
uppercase{árvíztH{u}űrH{o}ő tükörfúrógép đdłlćc}

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

Answered by Mico on November 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP