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.

I need to hyphenate a long lastname with a hyphen in it in a reference, e.g.:

@article{LastHyphenName:2013xy,
author = {Longlast-Namewithhyphen, Antonio and Anotherlastname, David},
title = {{How to hyphenate a reference that has a lastname with a hyphen?}},
journal = {Contributions To the TeX Stackexchange},
year = {2013},
volume = {2},
pages = {539--557},
}

I read in Line breaking (or hyphenation?) of references in apalike that one can hyphenate even a word from the .bib file with \hyphenation, but words that already have a hyphen cannot be hyphenated, or you do something like it's done in this SO thread. However, I think there has to be another way than manipulating the BibTeX entries.

Any solutions for this?

EDIT:

  • I'm editing my library externally and it is still growing as I'm adding new references to the bibliography during the writing process, thus substituting the hyphens with a shorthand in the final (exported) .bib file is not very efficient time-wise.

  • Also, my bibliography has a ton of authors with their last names being of hispanic origin which would mean time-costly, manual editing of the .bib file (I know that hispanic last names are normally not connected with a hyphen, but the hyphens is internationally introduced to avoid confusion).

I'm writing my thesis with \classicthesis, so the preamble is much more complex, but here's a MWE:

\documentclass{scrbook} % KOMA-Script article
\usepackage[english]{babel}
\usepackage{lipsum}
\usepackage[round]{natbib}
\usepackage{fontspec}
\usepackage{xunicode}
\setmainfont[Mapping=tex-text]{Minion Pro}
\usepackage[english]{babel}


\begin{document} 
\hyphenchar\font=\string"7F

\parbox{1cm}{\cite{LastHyphenName:2013xy}}

\bibliographystyle{kluwer} 
\bibliography{lib}

\end{document}

.bib file

@article{LastHyphenName:2013xy,
author = {Longlast-Namewithhyphen, Antonio and Anotherlastname, David},
title = {{How to hyphenate a reference that has a lastname with a hyphen?}},
journal = {Contributions To the TeX Stackexchange},
year = {2013},
volume = {2},
pages = {539--557},
}

Changing the hyphenchar is not working.

share|improve this question
3  
My impression is that changing the names (adding a hyphen) adds to confusion. One should always use the name: is "Paulo-Roberto Massa-Cereda" the same author as "Paulo Roberto Massa Cereda" or not? (Paulo will forgive me for using his name.) –  egreg Feb 19 '13 at 10:55
1  
You could change the hyphenchar. See egreg's answer here tex.stackexchange.com/questions/63232/… –  Ulrike Fischer Feb 19 '13 at 11:03
1  
@egreg OK, but the hispanic authors' names are spelled like this in the actual paper. Also, there's also last names that actually contain two names connected with a hyphen, e.g. married couples who paired their last names. –  Paglia Orba Feb 19 '13 at 12:31
1  
@Christian I just used the parbox to demonstrate that the hyphenation (i.e. line break) is not working by changing the hyphenchar. –  Paglia Orba Feb 19 '13 at 13:44
1  
it's about hyphenating a reference in the main body text and the reference is not wrapped correctly because the author has a lastname with a hyphen in it. it's all in the the question :) –  Paglia Orba Feb 19 '13 at 14:00

2 Answers 2

with package babel use

\defineshorthand{"=}{\penalty1000-\hskip0pt}

and then

author = {Longlast"=Namewithhyphen, Antonio and Anotherlastname, David},
share|improve this answer
    
This would be one solution. But I edit my bibliography externally (like BibDesk) and the bibliography is still changing during the writing process, thus, I would have to edit the bib file every time after I added a new reference to the bibliography (the bibliography has tons of spanish/hispanic authors with hypenated last names). –  Paglia Orba Feb 19 '13 at 10:11
    
@PagliaOrba Two solutions: (1) have the name as written here in BibDesk – I do that to some extent (although I use LaTeX commands). (2) Write a script to post-process your .bib file accordingly and include it into your build process. Do not manually edit generated files (such as the .bib file in this case). BibDesk also has a script hook for saving files but I don’t know how to use that and if it helps here. –  Konrad Rudolph Mar 19 '13 at 19:47

Use two hyphen signs.

For instance, author = {Longlast--Namewithhyphen, Antonio and Anotherlastname, David}

It's not required to use any additional packages.

share|improve this answer
2  
-- would not be a hyphen, but an en-dash. –  Paul Gessler Sep 29 at 0:37

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.