4

Why can't I get the danish letter æ, ø, å ind the names in my wheelchart I want to write Mængder but it will not work for me.

\documentclass[dvipsnames]{standalone}

\usepackage[latin1]{inputenc} % Input-indkodning af tegnsaet (UTF8) \usepackage[danish]{babel} % Dokumentets sprog \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{tikz,wheelchart} \usetikzlibrary {decorations.markings} \usetikzlibrary {decorations.text} \usepackage {siunitx} \usetikzlibrary {patterns}

\gdef\exampleforthismanual{% 14/Apricot/Opsamling/, 40/LimeGreen/Mængder/, 20/Melon/Funktioner/% }

\begin{document}

\begin{tikzpicture} \wheelchart[ arc data=\WCvarC, arc data pos=0.5, data=, domain=-60:180, inner plot={ {int((#1)/180)5+(0.5-((-1)^Mod(int((#1)/180),2))2.5)cos(#1)}, {(2.5-((-1)^Mod(int((#1)/180),2))0.5)sin(#1)} }, outer plot={ {int((#1)/180)5+(-0.5-((-1)^Mod(int((#1)/180),2))2.5)cos(#1)}, {(2.5+((-1)^Mod(int((#1)/180),2))0.5)sin(#1)} }, value=1 ]{\exampleforthismanual} \wheelchart[ arc data=\WCvarC, arc data pos=0.5, data=, domain=180:360, inner plot={ {int((#1)/180)5+(0.5-((-1)^Mod(int((#1)/180),2))2.5)cos(#1)}, {(2.5-((-1)^Mod(int((#1)/180),2))0.5)sin(#1)} }, outer plot={ {int((#1)/180)5+(-0.5-((-1)^Mod(int((#1)/180),2))2.5)cos(#1)}, {(2.5+((-1)^Mod(int((#1)/180),2))0.5)sin(#1)} }, value=1 ]{ 16/Peach/Eksponentielle og logaritmefunktioner/ } \wheelchart[ arc data=\WCvarC, arc data pos=0.5, data=,arc data style={text color=white},, domain=360:450, inner plot={ {int((#1)/180)5+(0.5-((-1)^Mod(int((#1)/180),2))2.5)cos(#1)}, {(2.5-((-1)^Mod(int((#1)/180),2))0.5)sin(#1)} }, outer plot={ {int((#1)/180)5+(-0.5-((-1)^Mod(int((#1)/180),2))2.5)cos(#1)}, {(2.5+((-1)^Mod(int((#1)/180),2))0.5)sin(#1)} }, value=1 ]{ 50/Plum/Potensfunktioner/ } \wheelchart[ arc data=\WCvarC, arc data pos=0.5, data=, domain=450:540, inner plot={ {int((#1)/180)5+(0.5-((-1)^Mod(int((#1)/180),2))2.5)cos(#1)}, {(2.5-((-1)^Mod(int((#1)/180),2))0.5)sin(#1)} }, outer plot={ {int((#1)/180)5+(-0.5-((-1)^Mod(int((#1)/180),2))2.5)cos(#1)}, {(2.5+((-1)^Mod(int((#1)/180),2))0.5)sin(#1)} }, value=1 ]{ 50/WildStrawberry/Vektorer/ }
\end{tikzpicture}

\end{document}

Can anybody help me?

2 Answers2

3

I recommend you use either LuaLaTeX or XeLaTeX -- both are natively unicode/utf8-aware -- to compile your document. (If you simply must use pdfLaTeX, be sure to employ the suggestion @UlrikeFischer has posted in a comment.) I used LuaLaTeX to generate the following output.

enter image description here

% !TEX TS-program = lualatex
\documentclass[dvipsnames,border=1pt]{standalone}

\usepackage{iftex} \ifpdftex %%\usepackage[utf8]{inputenc} % that's the default nowadays \usepackage[T1]{fontenc} \usepackage{lmodern} %% And be sure to employ Ulrike Fischer's suggestion %% (e.g., 'M{æ}ngder' instead of 'Mængder') \else \usepackage{unicode-math} % load 'fontspec' automatically \fi

\usepackage[danish]{babel} % Dokumentets sprog \usepackage{siunitx} \usepackage{tikz,wheelchart} \usetikzlibrary {decorations.markings} \usetikzlibrary {decorations.text} \usetikzlibrary {patterns}

\gdef\exampleforthismanual{% 14/Apricot/Opsamling/, 40/LimeGreen/Mængder/, % <-- write 'M{æ}ngder' for pdfLaTeX 20/Melon/Funktioner/% }

\begin{document}

\begin{tikzpicture} \wheelchart[ arc data=\WCvarC, arc data pos=0.5, data=, domain=-60:180, inner plot={ {int((#1)/180)5+(0.5-((-1)^Mod(int((#1)/180),2))2.5)cos(#1)}, {(2.5-((-1)^Mod(int((#1)/180),2))0.5)sin(#1)} }, outer plot={ {int((#1)/180)5+(-0.5-((-1)^Mod(int((#1)/180),2))2.5)cos(#1)}, {(2.5+((-1)^Mod(int((#1)/180),2))0.5)sin(#1)} }, value=1 ]{\exampleforthismanual} \wheelchart[ arc data=\WCvarC, arc data pos=0.5, data=, domain=180:360, inner plot={ {int((#1)/180)5+(0.5-((-1)^Mod(int((#1)/180),2))2.5)cos(#1)}, {(2.5-((-1)^Mod(int((#1)/180),2))0.5)sin(#1)} }, outer plot={ {int((#1)/180)5+(-0.5-((-1)^Mod(int((#1)/180),2))2.5)cos(#1)}, {(2.5+((-1)^Mod(int((#1)/180),2))0.5)sin(#1)} }, value=1 ]{ 16/Peach/Eksponentielle og logaritmefunktioner/ } \wheelchart[ arc data=\WCvarC, arc data pos=0.5, data=,arc data style={text color=white},, domain=360:450, inner plot={ {int((#1)/180)5+(0.5-((-1)^Mod(int((#1)/180),2))2.5)cos(#1)}, {(2.5-((-1)^Mod(int((#1)/180),2))0.5)sin(#1)} }, outer plot={ {int((#1)/180)5+(-0.5-((-1)^Mod(int((#1)/180),2))2.5)cos(#1)}, {(2.5+((-1)^Mod(int((#1)/180),2))0.5)sin(#1)} }, value=1 ]{ 50/Plum/Potensfunktioner/ } \wheelchart[ arc data=\WCvarC, arc data pos=0.5, data=, domain=450:540, inner plot={ {int((#1)/180)5+(0.5-((-1)^Mod(int((#1)/180),2))2.5)cos(#1)}, {(2.5-((-1)^Mod(int((#1)/180),2))0.5)sin(#1)} }, outer plot={ {int((#1)/180)5+(-0.5-((-1)^Mod(int((#1)/180),2))2.5)cos(#1)}, {(2.5+((-1)^Mod(int((#1)/180),2))0.5)sin(#1)} }, value=1 ]{ 50/WildStrawberry/Vektorer/ }
\end{tikzpicture}

\end{document}

Mico
  • 506,678
3

As previously noted by Marijn and Ulrike Fischer and in the answer by Mico, the code in the question works if \usepackage[latin1]{inputenc} is removed and Mængder is replaced by M{æ}ngder (note the braces around æ).

It is unnecessary to use a \wheelchart 4 times. All slices can be drawn with a single \wheelchart. For this, the key value=1 is removed. Instead, the first value for each slice is used for the key value.

The option text color=white is only passed to the fifth slice with the key arc data style{5}.

In the question, the code for each slice had a / 4 times. The last / can be removed.

The package wheelchart (which I wrote) loads the package tikz so \usepackage{tikz} was removed. Also \usetikzlibrary{decorations.markings}, \usepackage{siunitx} and \usetikzlibrary{patterns} are unnecessary for this MWE.

enter image description here

\documentclass[border=6pt,dvipsnames]{standalone}
\usepackage[danish]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{wheelchart}
\usetikzlibrary{decorations.text}
\begin{document}
\begin{tikzpicture}
\wheelchart[
  arc data=\WCvarC,
  arc data pos=0.5,
  arc data style{5}={text color=white},
  data=,
  domain=-60:540,
  inner plot={
    {int((#1)/180)*5+(0.5-((-1)^Mod(int((#1)/180),2))*2.5)*cos(#1)},
    {(2.5-((-1)^Mod(int((#1)/180),2))*0.5)*sin(#1)}
  },
  outer plot={
    {int((#1)/180)*5+(-0.5-((-1)^Mod(int((#1)/180),2))*2.5)*cos(#1)},
    {(2.5+((-1)^Mod(int((#1)/180),2))*0.5)*sin(#1)}
  }
]{%
  80/Apricot/Opsamling,
  80/LimeGreen/M{æ}ngder,
  80/Melon/Funktioner,
  180/Peach/Eksponentielle og logaritmiske funktioner,
  90/Plum/Potensfunktioner,
  90/WildStrawberry/Vektorer%
}
\end{tikzpicture}
\end{document}
matexmatics
  • 4,819