Fonts & Character SetsDanish characters "æ,ø,å" arent compiled after \rightarrow

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
Robert270706
Posts: 3
Joined: Thu Apr 04, 2024 9:07 am

Danish characters "æ,ø,å" arent compiled after \rightarrow

Post by Robert270706 »

When i compile my tex file the æ,ø and å's arent registered after i have used a \rightarrow

Im using following packages after searching online for similar questions

Code: Select all

\usepackage[utf8]{inputenc}
\usepackage[danish]{babel}
\renewcommand{\danishhyphenmins}{22}
\usepackage[T1]{fontenc}
\usepackage[utf8x]{inputenc}
\usepackage[danish=quotes]{csquotes}
Here what i was trying to write

Code: Select all

Fællesskaber/ungdom æøå \rightarrow Skole\ rightarrow Træning \rightarrow Gaming \rightarrow Hobbyer \rightarrow Kreativitet \rightarrow Kunst \rightarrow Samfund \rightarrow Dannelse \rightarrow Mannere \rightarrow Arbejde \rightarrow Økonomi \rightarrow Bopæl \rightarrow Kommune \rightarrow Barndom \rightarrow Tv/Cartoons \rightarrow Indoktrinering \rightarrow Politiske agendaer \rightarrow Forældre \rightarrow Familie \rightarrow Fællessmiddag \rightarrow Ferie \rightarrow Venner \rightarrow Legeaftale \rightarrow Indskoling \rightarrow Digitalisering \rightarrow Gymnasie \rightarrow
Long list i know but why is it that the first æ in "Fællesskaber/ungdom" and the three æ,ø,å after that is compiled while the others are not?
Please let me know if there is a solution
Last edited by Stefan Kottwitz on Thu Apr 04, 2024 2:10 pm, edited 1 time in total.
Reason: code marked

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
rais
Posts: 419
Joined: Sun Nov 16, 2014 8:51 pm

Danish characters "æ,ø,å" arent compiled after \rightarrow

Post by rais »

Hi there,
\rightarrow requires math mode, so if your pdfLaTeX isn''t stopping at errors, the first use of \rightarrow switches output to math mode---and in math mode, there aren't many language-specific characters defined (except for math, of course).
Either enclose all those \rightarrow commands by $..$ or define a command that can be used instead, like

Code: Select all

\newcommand*\textrarrow{\ensuremath{\rightarrow}}
(actually, you could use this \textrarrow in either text or math mode)
and

Code: Select all

Fællesskaber/ungdom æøå \textrarrow Skole[...]
BTW: your

Code: Select all

\usepackage[utf8x]{inputenc}
should only be necessary for eastern languages. Besides, it clashes with

Code: Select all

\usepackage[utf8]{inputenc}
which, on a more-or-less up-to-date TeX installation shouldn't be necessary either (utf8 is default input encoding for a couple of years now).

KR
Rainer
Post Reply