Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Problem

I would like to disable all hyphenation within the document, but I want the bibtex URL entries to be properly hyphenated, and also properly linked according to the hyperref package. Because of this I'm having some issues using abntex bibliography formatting with the \usepackage[none]{hyphenation} call.

Example

This bibtex entry:

@ARTICLE{Engelhardt2008,
  author = {Sebastian Engelhardt},
  title = {The Economic Properties of Software},
  journal = {Jena Economic Research Papers},
  year = {2008},
  volume = {45},
  url = {http://zs.thulb.uni-jena.de/servlets/MCRFileNodeServlet/jportal_derivate_00119979/wp_2008_045.pdf}
}

Placed in a document like this:

\documentclass{abnt}
\usepackage[brazilian]{babel}
\usepackage[utf8]{inputenc}
\usepackage{makeidx}
\usepackage{hyperref}
\usepackage{abnt-UFPR}
\usepackage{abntcite}
\usepackage[none]{hyphenat}

\begin{document}
  \sloppy
  \cite{Engelhardt2008}
  \bibliography{test.bib}
\end{document}

Will make abntex format the following bibitem:

\bibitem[Engelhardt 2008]{Engelhardt2008}
\abntrefinfo{Engelhardt}{ENGELHARDT}{2008}
{ENGELHARDT, S. The economic properties of software.
\emph{Jena Economic Research Papers}, v.~45, 2008.
Dispon{\'\i}vel em:
  \htmladdnormallink{$<$http:\-/\-/zs\-.thulb\-.uni-jena\-.de\-/servlets\-/MCR%
FileNodeServlet\-/jportal\underline{\ }derivate\underline{\
  }00119979\-/wp\underline{\ }2008\underline{\
  }045\-.pdf$>$}{http://zs.thulb.uni-jena.de/servlets/MCRFileNodeServlet/jport%
al_derivate_00119979/wp_2008_045.pdf}.}

Output

That looks like this in the A4 page:

wrong bibitem formatting

If I remove \usepackage[none]{hyphenat} from the preamble, this same entry will have the desired formatting, but the whole text will be hyphenated.

right bibitem formatting

Workarounds Tried

Using \usepackage[hyphens]{url} will output this on compilation:

! LaTeX Error: Option clash for package url.

I could also use just \usepackage{url} and change all my bibtex entries url params to:

 note = {Disponível em: $<$\url{http://zs.thulb.uni-jena.de/servlets/MCRFileNodeServlet/jportal_derivate_00119979/wp_2008_045.pdf}$>$}

But I really wouldn't like to do this, as I'm using a bibliography manager to generate the .bib file.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You may try putting

\renewcommand{\-}{\penalty 0 }

just before the bibliography. However, it's very questionable that the bibliography style loaded by abnt does such horrible things to URLs, when it's simply sufficient to input them as \url{...} when the url package is loaded.

This won't give hyphens at break points (which is in my opinion the right thing to do, as it's impossible for the reader to distinguish between real or added hyphens).

However, I find it questionable also inhibiting hyphenation on a global basis.

A different strategy than using hyphenat can be saying

\begin{document}
\hyphenrules{nohyphenation}\exhyphenpenalty 10000

and

\hyphenrules{brazilian}\exhyphenpenalty 50

before the bibliography, in order to allow hyphenation in it. The parameter \exhyphenpenalty is used by TeX to decide whether break a line after an explicit hyphen in the document (a compound word, for instance); setting it to 10000 inhibits the feature; 50 is the usual value. The nohyphenation pseudolanguage has no hyphenation rule.

share|improve this answer
    
Thanks @egreg. That worked great. The abntex package haven't been updated for some years, and still is the most complete package for the ABNT patterns. I will try to suggest these changes. And what would be the best solution to stop text hyphenation instead of doing it globally? –  vmassuchetto Dec 29 '11 at 17:35
    
@ViniciusMassuchetto Why should hyphenation be inhibited to begin with? –  egreg Dec 29 '11 at 17:40
    
It's just a matter of preference. –  vmassuchetto Dec 29 '11 at 17:48
    
@ViniciusMassuchetto Languages like Portuguese or Italian that have generally long words (with respect to English, for instance) receive great benefit from hyphenation, which makes for better typeset paragraphs. –  egreg Dec 29 '11 at 17:54
    
I understand that, even if most of the ABNT formatted documents by other editors have hyphenation disabled. I asked it because I couldn't find a \hyphenationon and a \hyphenationoff commands on the hyphenat package documentation. –  vmassuchetto Dec 29 '11 at 18:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.