2

MWE

\documentclass[norsk]{beamer}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usetheme{Warsaw}
\begin{document}
\begin{frame}
   ``forkaster hypotesen om at
$P(\text{"mynt"})=0,5$''. 
\end{frame}
\end{document}

Giving the following error message:

ERROR: Argument of \language@active@arg" has an extra }.

--- TeX said ---
<inserted text> 
                \par 
l.15 \end{frame}

From the .log file:

I've run across a } that doesn't seem to match anything. For example, \def\a#1{...} and \a} would produce this error. If you simply proceed now, the \par that I've just inserted will cause me to report a runaway argument that might be the root of the problem. But if your } was spurious, just type 2 and it will go away.

1
  • 1
    What's the reason for typing \text{"mynt"}, which is wrong to begin with?
    – egreg
    May 12 '15 at 10:22
5

This is described in the babel documentation as a typical error, see section 1.5 on Shorthands. The problem is caused by the combination "}; the solution given is to add an empty pair of braces so you write "{}} instead.

Sample output

\documentclass[norsk]{beamer}

\usepackage[utf8]{inputenc}
\usepackage{babel}
\usetheme{Warsaw}

\begin{document}

\begin{frame}
  ``forkaster hypotesen om at
  $P(\text{"mynt"{}})=0,5$''. 
\end{frame}

\end{document}

You can improve the spacing of "m by writing "\!m instead.

Improved spacing

However, it may well be simpler to use \qq from the textcmds package for these quotes:

qq sample

\documentclass[norsk]{beamer}

\usepackage[utf8]{inputenc}
\usepackage[main=norsk]{babel}
\usepackage{textcmds}
\usetheme{Warsaw}

\begin{document}

\begin{frame}
  \qq{forkaster hypotesen om at
  $P(\text{\qq{mynt}})=0,5$}. 
\end{frame}

\end{document}

See also the csquotes package.

5
  • Is there some meaning to use closing before the word?
    – Sigur
    May 12 '15 at 10:18
  • I don't understand the question? May 12 '15 at 10:20
  • @Sigur The poster shows knowledge of ` ``...' ', so I guess there is a specific reason to use "` (I can't get the markdown right :-( ) May 12 '15 at 10:21
  • @kjetilbhalvorsen, I asked why do you use ''mynt'' instead of ``mynt''?
    – Sigur
    May 12 '15 at 10:23
  • hmm.... because that is what emacs gives me? probably an error ... (I am using auctex) May 12 '15 at 10:34

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.