# Preventing hyphenation for words containing numbers

I have a word containing a number, "MyVeryBigWord1", that I never want hyphenated in my document. Here's a file replicates the problem:

\documentclass{article}

%\hyphenation{MyVeryBigWord1} % ERROR: Not a letter.

\usepackage[a4paper, total={1mm, 8in}]{geometry} % make tiny paper area

\begin{document}
some-otherword
MyVeryBigWord1 MyVeryBigWord1 MyVeryBigWord1
\end{document}


If I comment in the \hyphenation this toy document builds (with an error) and looks fine but the document I'm actually writing it doesn't build properly with the error. How do I prevent the error and make it so my word is never hyphenated?

• \newcommand{\MVBW}{\mbox{MyVeryBigWord1}} in the preamble and \MVBW{} in the document. Sep 9, 2016 at 9:54
• Have you tried \hyphenation{MyVeryBigWord}? (TeX won't hyphenate between "MyVeryBigWord" and "1".) Alternatively, assuming the real word -- it's not really "MyVeryBigWord1", right? -- doesn't occur very often in your document, have you considered encasing all instances in an \mbox wrapper?
– Mico
Sep 9, 2016 at 9:54
• I ended up going with this mbox idea. I don't know why I didn't try it earlier. The end result: \newcommand*{\dataset}[1]{\mbox{\textit{#1}}} used \dataset{MyDataSet1}. Thanks. Sep 9, 2016 at 10:18

You can make 1 a letter for hyphenation purposes, if you really need it

\documentclass{article}

\lccode1=1
\hyphenation{MyVeryBigWord1} % ERROR: Not a letter. (it is now)

\usepackage[a4paper, total={1mm, 8in}]{geometry} % make tiny paper area

\begin{document}
some-otherword
MyVeryBigWord1 MyVeryBigWord1 MyVeryBigWord1
\end{document}

• Clever. I ended up going with an mbox implementation as my I was already using a macro tat made mbox. But I appreciate the help. I gave you an upvote :) Sep 9, 2016 at 10:20