# Incompatibility between \nobreakdash and babel

I use the \nobreakdash command to disallow a linebreak after the dash in short expressions like -s, -ar etc. I use ({\nobreakdash}-s, {\nobreakdash}-ar) but it seems not work as can be seen on the picture below.

Here comes minimul example:

\documentclass[10pt,a4paper,twocolumn]{extbook}
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\usepackage{fancyhdr}
\usepackage[icelandic, latin, czech]{babel}
\usepackage[utf8]{inputenc}
\DeclareUnicodeCharacter{00A0}{~} % finds hidden non-breakable space
\usepackage[T1]{fontenc}
\usepackage{tgpagella}
\usepackage[scaled=0.90]{helvet} % ss
\usepackage{hanging}
\usepackage{makeidx}
\usepackage{tipa}
\usepackage{fix2col}
\usepackage{color}
\usepackage{titlesec}
\usepackage{amsmath} %used for non-breakabledash
\usepackage{hyphenat} % no hyphen in abbreviations

% COLORS
\definecolor{darkgreen}{rgb}{0.4, 0.01, 0.24}

%COMMANDS
\newcommand\entry[3][]{\hangpara{2em}{1}{\fontfamily{phv}\selectfont{\textbf{{#2}}}}\
#3\ifx\relax#1\relax\markboth{#2}{#2}\else\markboth{#1}{#1}\fi
\par}\nopagebreak[4]

\newcommand\n{$n$\nobreakdash-\hspace{0pt}} %nonbreakable dash in grammar endings
\def \nobreakseq {\nobreak \hskip 0pt \hbox} %nolinebreak in case like (-s, -)

% DICTIONARY PAGE STYLE
\fancypagestyle{dictstyle}{%
\fancyhf{}
\entry[stjórnmálafræðingur]{{stjórn$\cdot$mála$\cdot$$\cdotfræðing|ur}}{{\textipa{[{s}{\textsubring{d}}{j}{ou}{r}{\textsubring{d}}{\textsubring{n}}{m}{au}{l}{a}{f}{r}{a}{i}{ð}{i}{\ng}{\r{g}}{\textscy}{\textsubring{r}}]}}{\color{darkgreen}{\small{\textbf{ m}}}}{\color{darkgreen}{\footnotesize{ (\nobreakdash-s, \nobreakdash-ar)}}}\foreignlanguage{czech}{{ politolog, politoložka}}.} \end{document}  - \nobreakdash needs to see how many - tokens follow it; with your usage a closing brace is following, so \nobreakdash does nothing. Remove the braces. – egreg Oct 25 '12 at 6:49 ## 1 Answer Don't surround \nobreakdash with braces. \documentclass{article} \usepackage{amsmath} \textwidth=50pt \begin{document} aaaaaa {\nobreakdash}-bbb% incorrect aaaaaa \nobreakdash-bbb% correct \end{document}  EDIT: Your added example was anything but minimal, but I was able to track down the culprit: \usepackage[czech]{babel} makes the hyphen (-) an active character, which seems to break \nobreakdash. Solution/workaround: Replace \nobreakdash- with \hbox{-}. \documentclass{article} \usepackage[czech]{babel} \usepackage{amsmath} \textwidth=50pt \begin{document} aaaaaa {\nobreakdash}-bbb% incorrect aaaaaa \nobreakdash-bbb% correct, but doesn't work for czech aaaaaa \hbox{-}bbb% workaround for czech \end{document}  - I have tried to type (\nobreakdash-s, \nobreakdash-ar) but with no improvement. Is this correct typing? – chejnik Oct 25 '12 at 6:59 @chejnik Compile my example as-is -- does it work for you? If yes, you must be doing something different in your actual document. – lockstep Oct 25 '12 at 7:17 Yes, it works for me. I am afraid that minimal example is too long though. Here is one entry line, maybe it will serve well - \entry[stjórnmálafræðingur]{{stjórn\cdotmála\cdot$$\cdot$fræðing|ur}}{{\text‌​ipa{[{s}{\textsubring{d}}{j}{ou}{r}{\textsubring{d}}{\textsubring{n}}{m}{au}{l}{a‌​}{f}{r}{a}{i}{ð}{i}{\ng}{\r{g}}{\textscy}{\textsubring{r}}]}}{\color{darkgreen}{\‌​small{\textbf{ m}}}}{\color{darkgreen}{\footnotesize{ (\nobreakdash-s, \nobreakdash-ar)}}}\foreignlanguage{czech}{{ politolog, politoložka}}.} Thank you –  chejnik Oct 25 '12 at 7:27
[czech]{babel} is known for this mal-function. It should definitely be manually reverted. –  tohecz Oct 25 '12 at 8:57