Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

As the title says, there's no spacing after my closing quotes, I have boiled my huge preamble down to the following,

% Manual: http://ctan.org/tex-archive/macros/latex/contrib/memoir/memman.pdf
\documentclass[a4paper,oneside,article]{memoir}

\usepackage[utf8]{inputenc}
\usepackage[danish]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\begin{document}
Hello "I AM A" DUMMY SENTENCE
\end{document}

Which renders to

Hello "I AM A"DUMMY SENTENCE

And I would really like it to become

Hello "I AM A" DUMMY SENTENCE

I'm using the MikTex package for windows and my editor is TexMaker.

I looked at the Spacing after closing double quotes in XeLaTeX but I don't think the solution applies since I don't think I'm loading any CJK packages.

share|improve this question
add comment

2 Answers 2

up vote 13 down vote accepted

The babel package turns " into an active character (so-called shorthands) that gives nice shortcuts for special treatment of non-English language. (Quick and dirty and typographically wrong work-around would be the use of {}1,2: "I AM A"{} DUMMY)

Correct danish quotation marks are acquired with "` („) and "' (“).
By the way, since you use utf8 anyway you could input and directly: „I AM A“

Take a look at the babel manual and its section about the Danish language!

You also might be interested in the csquotes that provides useful macros for quotation. It is also babel-aware and uses the right quotation marks.

Code with babel's shorthands

\documentclass[a4paper,oneside,article]{memoir}

\usepackage[utf8]{inputenc}
\usepackage[danish]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\begin{document}
Hello "`I AM A"' DUMMY SENTENCE
\end{document}

Code with \enquote from the csquotes package

\documentclass[a4paper,oneside,article]{memoir}

\usepackage[utf8]{inputenc}
\usepackage[danish]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{csquotes}

\begin{document}
Hello \enquote{I AM A} DUMMY SENTENCE
\end{document}

Output of both variants

Output of both variants

Stiff after "?

If you are still after the straight double quotation mark ", you can use \textquotedbl.

\documentclass[a4paper,oneside,article]{memoir}

\usepackage[utf8]{inputenc}
\usepackage[danish]{babel}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\begin{document}
Hello \textquotedbl I AM A\textquotedbl{} DUMMY SENTENCE 
\end{document}

Ouput with \textquotedbl

\textquotedbl output

share|improve this answer
    
This is absolutely excellent! thank you very much! –  DrLime2k10 Nov 4 '12 at 16:44
add comment

Just to complement Qrrbrbirlbel's excellent answer, some comments about why this happens.

The " character should never be used in LaTeX to get quotes. The correct way to get (British style) double quotes is

``Opening and closing quotes''

The fact that " produces seemingly correct quotes (”) should not be relied upon: it can fail depending on the font one is using. Moreover, in good typography, opening and closing quotes should be different from each other.

When different typographic traditions are followed, the quotes change; German uses lowered opening quotes and raised closing ones, but reversed with respect to British usage. The same seems to hold for Danish, and babel provides shorthands for getting the correct characters without hunting for them on the keyboard, as explained by Qrrbrbirlbel.

In many language modules of babel the “straight double quote” character is used in the same way to introduce shorthands. These work in babel always in the same way:

<shorthand_char><char>

Some of these combinations are meaningful (they may mean different things in different languages), others don't. When the combination doesn't have a predefined meaning, <shorthand_char> fallbacks to something that, in the case of " is “print the character in the current font at position 34”. However the procedure for recognizing the following character uses \@ifnextchar which, by design, eats all the spaces that it finds in the process.

So in the example

Hello "I AM A" DUMMY SENTENCE

LaTeX looks whether the combination "I is meaningful for Danish, which isn't, so it prints

”I

Then it finds the second " and starts looking for the following character, swallowing spaces. Eventually A is found and since "A is not a predefined combination,

”A

is printed.

share|improve this answer
    
Before I read your great addition to the below answer, I was inclined to use \usepackage[danish, english]{babel} since that would make "something" be printed with spaces around the entire thing, and since I'm mostly writing in english (handins for school) it doesn't make sense to not have it loaded. But now I see that quotes does matter, and I'll practice the use of ``Opening and closing quotes'' rather. Thanks for going in detail! –  DrLime2k10 Nov 4 '12 at 17:02
    
And to make the confusion complete: the babel manual—not exclusively I might add—uses the wrong characters in its manual: "‘ for "` and "’ for "' where and are the (English) opening and closing single quotation marks produced by the auto-ligature feature of ` and ' (similar to `` and ''). … and then there are typewriter fonts that don't use straight lines for " and ' where you explicit want to distinguish " and ! \end{rage} –  Qrrbrbirlbel Nov 4 '12 at 17:02
    
I just love how texexchange has code/uncode formatted your last message :) (I still understood it though^^) –  DrLime2k10 Nov 4 '12 at 17:05
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.