I have a sentence with the word "ASP.NET", but half of the word doesn't fit in the current line anymore. There is no hyphenation which is quite ok, but latex doesn't insert a linebreak before the word, instead it is overlapping the margin. I suppose this is happening because of the dot. How can I control the linebreak dynamically to avoid overlapping?

  • 2
    Welcome to TeX.SX! Could you rephrase the sentence (or the sentences before that) such that the line break doesn't fall in the middle of the word? Anyways, you should probably only worry about this as the last step, in case you have to change the preceding sentences for other reasons that will disturb the line break. – darthbith Oct 30 '14 at 13:42
  • Is the string ASP.NET a URL (or a part of a URL)? If so, have you tried loading the url package and typing \url{ASP.NET}? URL strings are usually allowed to break across lines after a .. – Mico Oct 30 '14 at 13:45
  • I will avoid changes to the text because words containing something ".NET" appear quite often. @LaRiFaRi microtype works, great! If you add it as answer, I will accept it asap – Matthias Oct 30 '14 at 13:59
  • In addition, if it does not fully with microtype you may write the word as ASP\linebreak[1].NET. (It is just a search/replace in your editor). If you, when you write your text, push the word to the line border, it will break before the full stop. But if you later delete a word from the paragraph, it will move to the previous line as one word. But as you see, microtype is a miracle. – Sveinung Oct 30 '14 at 20:00

Load the package microtype and that's already all you need. If not, you will have to decide which breaking-point you want to allow and add it (e.g. ASP"-.NET). I would not break after the dot: A dot at the end of a line always looks like the end of a sentence and ".NET" is kind of a fix expression which should stick together.

When your document is finished (see darthbith) command, you could try to rephrase ("...using ASP of the .NET framework...") or push the word to the next line with a new not indented paragraph or alike.

If you want to have a line-break without a hyphen, you may want to look here or use some short-hand of the package babel. This depends on the language you are writing in.


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.