3


I want to use the command \hyphanation to force latex keeping terms in the same line
The terms are for example IAS 39 and IFRS 9.
I use acornyms for IAS and IFRS and let a white space between the numbers. In code it looks like this:

\acs{IAS} 39 and \acs{IFRS} 9

In the preamble I insert this code:

\hyphenation{
IFRS 9
IAS 39
IAS 01
IAS 02}

But when I compile my document I get the error message that it is not a letter.
If I remove the numbers it works fine.

Now the questions:

  1. How can I use this command with the needed whitespaces?
  2. Can this command handle acronyms?

I know that I can use the \mbox{}command, but these terms appear very often, so it would be a high invest.

Thanks for you help!!

  • 1
    Why don't you simply write \acs{IAS}~39 and \acs{IFRS}~9? – clemens May 25 '13 at 19:59
  • Because I didn't know that this is possible :/. Thanks for the simple and great help :D But I would still have to correct nearly 100 terms. Is there a possibality like or with \hyphanation? – j0chn May 25 '13 at 20:05
  • It is possible (but highly unusual) to make \hyphenation work with digits (by using non standard lowercase codes, but it is essentially impossible to make it work with spaces. It is designed to hyphenate each word in a paragraph where space(or more generally glue) is used to separate the words,.. – David Carlisle May 25 '13 at 20:28
  • A space is always a legitimate line break point. Unfortunately the only way to correct is to do a search and replace. – egreg May 25 '13 at 20:48
  • Than I think I will have to do a search and replace. Thanks for your comments!!! – j0chn May 25 '13 at 20:56
3

It's not possible to define hyphenation exceptions involving spaces (at least without doing nasty things with category codes).

If you define

\newcommand{\IAS}{\acs{IAS}~\ignorespaces}

you can just search and replace without worrying about possible spaces that could creep in.

Alternatively, replace \acs{IAS} (with a trailing space) with \acs{IAS}~.

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.