# Weird break before English language citation

I'm using LyX to write my thesis I've encountering this weird problem. When in-paragraph citations are formatted as English in my Danish document (which I do to get the spell checker working for English, this weird break is inserted:

As opposed to the citatioin not being formatted in English:

Curiously the bug doesn't happen if I change the language of the citation to German - only when it's English.

Any suggestions as to why this could be?

EDIT:

I've managed to produce this minimal example:

\documentclass[english,danish]{scrbook}
\usepackage{babel}
\usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=1,
{hyperref}

\makeatletter
\@ifundefined{date}{}{\date{}}
\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
\renewcommand*{\equationautorefname}[1]{}
\renewcommand{\sectionautorefname}{sec.\negthinspace}
\renewcommand{\subsectionautorefname}{sec.\negthinspace}
\renewcommand{\subsubsectionautorefname}{sec.\negthinspace}
\renewcommand{\figureautorefname}{Fig.\negthinspace}
\renewcommand{\tableautorefname}{Tab.\negthinspace}
}

\begin{document}
Kuhn udvider metaforen i sin karakteristik af udviklingen af paradigmer.
Om videnskabelige nyopdagelse hedder det: \foreignlanguage{english}{Produced
inadvertedly by a game played under one set of rules, their assimilation
requires the elaboration of another set.''} Videnskabelige nyopdagelse, der i
første omgang forsøges bortforklaret.
\end{document}


The problem is clearly this from the LyX thesis template:

\addto\extrasenglish{%
\renewcommand*{\equationautorefname}[1]{}
\renewcommand{\sectionautorefname}{sec.\negthinspace}
\renewcommand{\subsectionautorefname}{sec.\negthinspace}
\renewcommand{\subsubsectionautorefname}{sec.\negthinspace}
\renewcommand{\figureautorefname}{Fig.\negthinspace}
\renewcommand{\tableautorefname}{Tab.\negthinspace}
}


What does that code do? What could go wrong in my working document if I delete it?

• I can't reproduce your problem with the code snippet provided. Could you create a complete minimal working example? – Nils L May 14 '13 at 19:46
• Did you add the relevant languages? Perhaps the hyphenation tables are broken/missing? – vonbrand May 14 '13 at 20:42
• Strangely I can't reproduce it in a minimal document - but it's consistent in my working document. – MajorBriggs May 14 '13 at 22:16
• If you can produce a LyX minimal example, please file a LyX bug report – scottkosty May 15 '13 at 2:58

Six comment signs at the end of lines were missing, which produced superfluous whitespace.

\documentclass[english,danish]{scrbook}
\usepackage{babel}
\usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=1,
{hyperref}

\makeatletter
\@ifundefined{date}{}{\date{}}
\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
\renewcommand*{\equationautorefname}[1]{}% <-- This was the first missing comment sign
\renewcommand{\sectionautorefname}{sec.\negthinspace}%
\renewcommand{\subsectionautorefname}{sec.\negthinspace}%
\renewcommand{\subsubsectionautorefname}{sec.\negthinspace}%
\renewcommand{\figureautorefname}{Fig.\negthinspace}%
\renewcommand{\tableautorefname}{Tab.\negthinspace}% <-- And this was the last one
}
\makeatother

\begin{document}
Kuhn udvider metaforen i sin karakteristik af udviklingen af paradigmer.
Om videnskabelige nyopdagelse hedder det: \foreignlanguage{english}{Produced
inadvertedly by a game played under one set of rules, their assimilation
requires the elaboration of another set.''} Videnskabelige nyopdagelse, der i
første omgang forsøges bortforklaret.
\end{document}