1

When just writing "een" or "1" the lines still work. They give error's as soon as I replace them with "é" because I want to put an emphasis on the "one".

I googled online and read wikibooks on special characters. I replaced the twho é's with \'{e} but it still gives an error as soon as i put this in.

Code Sample

{\documentclass[a7paper,print,10pt,grid=rear]{kartei}
%Voor info googelen op 'LaTeX kartei'
%a7paper: bepaalt hoe groot de fiches worden.  a6-a7-a8-a9 zijn de opties
%grid: geeft aan of er snijlijnen moeten geprint worden.
\usepackage[utf8]{inputenc}
\usepackage[dutch]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{icomma}
\usepackage{graphicx}

\newcommand{\antwoord}[1]  {%
  \vspace*{\fill}%
  \begin{center}
    #1
  \end{center}
  \vspace*{\fill}%
}

\newcommand{\vraag}[1]{#1}
\newsavebox\myimage
\sbox\myimage{%
  \includegraphics[scale=0.08]{zrm.png} %
}

\newcommand{\kaart}[2]{%
  \begin{karte}[Vraag]
    {\vraag{#1}}
    [\usebox\myimage]
    \answer{Antwoord}

    \antwoord{#2}

  \end{karte}%
}

\author{M.Brouwers}

\begin{document}



   \kaart{%
  $Onderstaande kubus heeft een inhoud van 512cm^{3}. Wat is de lengte van \'{e}\'{e}n ribbe?$

  \includegraphics[scale=1]{kubuszrm.png} }  {$ V = z^{3}$

  $ 512cm^{3} = z^{3} $

  $ We zoeken een getal dat tot de 3^{de} macht 512 $

  $ -> 8 $

  $ 512 cm^{3} = ( 8 cm )^{3}$

  De kubus heeft zijden van 8cm } 


\end{document}}
  • please provide a fully compilable example and please don't post pictures of your code, noone want to retype that code. Exactly which error? Is that code saved as UTF8? – daleif May 25 '16 at 12:42
  • Better like this? – Michelle_B May 25 '16 at 12:53
  • Why the sentence “Onderstaande...” all in math mode? Where is the kartei class file available? – egreg May 25 '16 at 12:54
  • @egreg on GitHub but you need to download all subfiles since the class definition is defined while calling sub-files... (!) – ebosi May 25 '16 at 12:56
  • 4
    The error is because you have put everything in math mode, and \' is not allowed in math mode. Math mode should not be used for text, as it messes with spacing and puts everything in unkerned italics (so unless \kaart does something odd your example won't look any good if you remove \' anyway), so reserve it for the equations. If you want italics, use \itshape or \textit{your text}. The superscripts can be created with \textsuperscript. – Jonas Granholm May 25 '16 at 12:58
  • 1
    @Michelle_B : great to see you're project continues! || Anyway, first, you need to save your file in the utf8 format. || Then, it's better not to write regular text in math-mode (that is between $s): your error occurs because you tries to type accent in math-mode... || You should thus try Onderstaande kubus heeft een inhoud van $512cm^{3}$. Wat is de lengte van één ribbe? and We zoeken een getal dat tot de $3^{de}$ macht 512 || To emphasis text, use rather \emph{<your-text>} – ebosi May 25 '16 at 12:59
  • 1
    @ebo It's better to use 3\textsuperscript{de} to avoid de being in math mode. Also, you can use \mathrm{cm}to get the units in upright text. – Jonas Granholm May 25 '16 at 13:04
  • Haha yes @ebo it will continue untill I am done haha! – Michelle_B May 25 '16 at 13:07
  • @ebo i tried placing the " '{e}'{e}n " outside of the mathmode indicated by $. It worked! Thanks alot! – Michelle_B May 25 '16 at 13:11
  • 2
    By the way, you should add the package fontenc if you plan to use accents, see http://tex.stackexchange.com/q/664/47692. – Jonas Granholm May 25 '16 at 13:15

1 Answers1

4

Perhaps you want this?

\documentclass[a7paper,print,10pt,grid=rear]{kartei}
%Voor info googelen op 'LaTeX kartei'
%a7paper: bepaalt hoe groot de fiches worden.  a6-a7-a8-a9 zijn de opties
%grid: geeft aan of er snijlijnen moeten geprint worden.
\usepackage[utf8]{inputenc}
\usepackage[dutch]{babel}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{icomma}
\usepackage{graphicx}
\usepackage{siunitx}

\newcommand{\antwoord}[1]  {%
  \vspace*{\fill}%
  \begin{center}
    #1
  \end{center}
  \vspace*{\fill}%
}

\newcommand{\vraag}[1]{#1}
\newsavebox\myimage
\sbox\myimage{%
  \includegraphics[scale=0.08]{zrm.png}%
}

\newcommand{\kaart}[2]{%
  \begin{karte}[Vraag]
    {\vraag{#1}}
    [\usebox\myimage]
    \answer{Antwoord}

    \antwoord{#2}

  \end{karte}%
}

\author{M.Brouwers}

\begin{document}

\kaart{%
Onderstaande kubus heeft een inhoud van \SI{512}{cm^{3}}. 
Wat is de lengte van \'{e}\'{e}n ribbe?

\includegraphics[scale=1]{kubuszrm.png} } {
  $ V = z^{3}$

  $ \SI{512}{cm^{3}} = z^{3} $

  We zoeken een getal dat tot de 3\textsuperscript{de} macht 512

  $ \to 8 $

  $ \SI{512}{cm^{3}} = ( \SI{8}{cm} )^{3}$

  De kubus heeft zijden van \SI{8}{cm} } 

\end{document}

Note that you should not have braces around the whole document. Math mode should be only used for math formulas, not for typesetting text.

egreg
  • 1,121,712