7

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:

enter image description here

As opposed to the citatioin not being formatted in English:

enter image description here

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,
 breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=false]
 {hyperref}

\makeatletter
\@ifundefined{date}{}{\date{}}
\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
\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}
}

\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?

  • 1
    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
2

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,
 breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=false]
 {hyperref}

\makeatletter
\@ifundefined{date}{}{\date{}}
\AtBeginDocument{\renewcommand{\ref}[1]{\mbox{\autoref{#1}}}}
\addto\extrasenglish{%
 \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}

enter image description here

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.