# Enforcing no hyphenation of the last word in the first line of Definition while keeping the line well-aligned

I am using the IEEEtran theorem environment and \newtheorem{definition}{Definition}[section] to customize the definitions. Generally, I am satisfied with its output:

However, for another definition followed by a long word (i.e., PrecedingWrite here), it splits the word (as Preceding-Write):

I can use \mbox{PrecedingWrite} to enforce its "integrity". But the first line of this definition becomes ill-aligned.

Therefore,

How to both enforce the "integrity" of the word "PrecedingWrite" and keep the first line well-aligned? (To this end, you can break the first line. However, I don't want a global \newline option.) Great thanks.

An illustrating Code for the second figure above:

\documentclass{IEEEtran}% http://www.ctan.org/pkg/ieeetran
\newtheorem{definition}{Definition}[section]
\begin{document}
\begin{definition}[\textsl{PrecedingWrite (PW)}] \label{def:precedingwrite}
\textsl{PrecedingWrite} is a matrix such that for each operation
$o$ and each variable $v$, the entry $\textsl{PW}[o][v] = w$ if and only if
\end{definition}
\end{document}​

• You probably want this automated... but why not just leave such things to the end and then fix the odd ones here-and-there (if any) manually? – Werner Nov 2 '14 at 3:49
• @Werner I just need to fix this definition. So manual methods are OK. – hengxin Nov 2 '14 at 3:52
• I don't understand why you just use \newline or \\ then? I mention this since you say "I don't want a global \newline option" yet also mention "manual methods are OK". – Werner Nov 2 '14 at 4:25
• @Werner I don't want a global \newline option for the whole Definition environment, because I want to leave other definitions (such as Definition 5.3) the same (i.e., no break line after Definition 5.3 (ReachableRead(RR))). I just need to fix Definition 5.4. Therefore, I want to do this locally. Sorry for the vagueness. I am not very familiar with this topic. BTW, the \hfill + a blank line method works for me, as suggested in the answer by @Przemysław Scherwentke. – hengxin Nov 2 '14 at 5:43

But IEEEtran automates the procedure that you described. An example is with some other words, but the result should be visible in the second definition: the first line filled with glue.

\documentclass{IEEEtran}% http://www.ctan.org/pkg/ieeetran
\newtheorem{definition}{Definition}[section]
\begin{document}

\section{}

\begin{definition}[\textsl{PrecedingWrite (PW)}] \label{def:precedingwrite}
\textsl{PrecedingWrite} is a matrix such that for each operation
$o$ and each variable $v$, the entry $\textsl{PW}[o][v] = w$ if and only if
\end{definition}

\begin{definition}[\textsl{LongPrecedingWrite (LPW)}] \label{def:precedingwrite}
\textsl{LongPrecedingWrite} is a matrix such that for each operation
$o$ and each variable $v$, the entry $\textsl{PW}[o][v] = w$ if and only if
\end{definition}

\end{document}


If such a result is not done automatically, you can always (from the comments I can deduce, that it is done once) force a new line e.g. in the following way:

\begin{definition}[\textsl{PrecedingWrite (PW)}] \label{def:precedingwrite}\hfill

\textsl{PrecedingWrite} is a matrix such that for each operation
$o$ and each variable $v$, the entry $\textsl{PW}[o][v] = w$ if and only if
\end{definition}

• The last method works in my case. I have tried \hfill before but missed the blank line followed. Thanks. – hengxin Nov 2 '14 at 5:34