Page Layout ⇒ Allowing line break with in-text citation?
-
- Posts: 29
- Joined: Thu Feb 19, 2009 3:23 pm
Allowing line break with in-text citation?
I asked this on the Ubuntu forums but I think it may be the wrong place.
Anyway I am using a custom (author-date) citation style created with the custom-bib program. Citations should mostly appear in the text like so (Citation 2009:101). I have a couple of citations that have two authors with long names that are being treated like one word, making the paragraph look really wierd. I can't figure out how to get these citations to wrap to the next line at the margin, like normal text.
For example, if I have a paragraph that carries on like this, and want to put a citation (Jiminez Martinez and Valdez Diaz 2009:158-159) into it that is sort of long, it should wrap at whatever word is at the end of the paragraph (at the moment, it wraps to the next line after the "Valdez"). However, the citation
(Jiminez Martinez and Valdez Diaz 2009:158-159) in question looks like this in the document (i.e. it starts on a new line, regardless of how little text is on the line before it).
Does anyone know how I can fix this? There aren't any extra {} in the .bib file for the citation that is causing problems.
Anyway I am using a custom (author-date) citation style created with the custom-bib program. Citations should mostly appear in the text like so (Citation 2009:101). I have a couple of citations that have two authors with long names that are being treated like one word, making the paragraph look really wierd. I can't figure out how to get these citations to wrap to the next line at the margin, like normal text.
For example, if I have a paragraph that carries on like this, and want to put a citation (Jiminez Martinez and Valdez Diaz 2009:158-159) into it that is sort of long, it should wrap at whatever word is at the end of the paragraph (at the moment, it wraps to the next line after the "Valdez"). However, the citation
(Jiminez Martinez and Valdez Diaz 2009:158-159) in question looks like this in the document (i.e. it starts on a new line, regardless of how little text is on the line before it).
Does anyone know how I can fix this? There aren't any extra {} in the .bib file for the citation that is causing problems.
NEW: TikZ book now 40% off at Amazon.com for a short time.
Re: Allowing line break with in-text citation?
I have the exact same problem. Have you been able to figure it out? Thanks.
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Allowing line break with in-text citation?
Hi emimca,
welcome to the board!
My in-text citations could be broken, I'm using natbib. Perhaps post a compilable minimal working example, we could examine that.
Stefan
welcome to the board!
My in-text citations could be broken, I'm using natbib. Perhaps post a compilable minimal working example, we could examine that.
Stefan
LaTeX.org admin
Re: Allowing line break with in-text citation?
Hi Stefan,
Thank you. Here's an example. I am using a Harvard style bibliography. Thanks a lot for your help.
Thank you. Here's an example. I am using a Harvard style bibliography. Thanks a lot for your help.
- Attachments
-
- example.zip
- (21.1 KiB) Downloaded 1042 times
- Stefan Kottwitz
- Site Admin
- Posts: 10324
- Joined: Mon Mar 10, 2008 9:44 pm
Allowing line break with in-text citation?
That's good example code allowing testing, I've found that using cite allows line breaks in \cite:
Stefan
Code: Select all
\usepackage{cite}
LaTeX.org admin
Re: Allowing line break with in-text citation?
Works wonderfully! Thank you so much!
-
- Posts: 29
- Joined: Thu Feb 19, 2009 3:23 pm
Re: Allowing line break with in-text citation?
Unfortunately for me, the cite package conflicts with natbib (well, as I understand it, natbib is a re-implementation of cite).
In trying to construct a MWE I have run across a strange problem. When using my custom style, I get "citation XX on page X is undefined" errors. If I use, say, plain or humannat, the citation appears just fine, although the line wrap issue is still present.
I would just use humannat except that it has two issues: any text in the "note" field is printed in the references, and it has trouble with certain non-English names. For example, one author's first name is João Zilhão, which appears in the references at the end of the thesis as Zilhão, J. a.
In trying to construct a MWE I have run across a strange problem. When using my custom style, I get "citation XX on page X is undefined" errors. If I use, say, plain or humannat, the citation appears just fine, although the line wrap issue is still present.
I would just use humannat except that it has two issues: any text in the "note" field is printed in the references, and it has trouble with certain non-English names. For example, one author's first name is João Zilhão, which appears in the references at the end of the thesis as Zilhão, J. a.
-
- Posts: 29
- Joined: Thu Feb 19, 2009 3:23 pm
Re: Allowing line break with in-text citation?
I searched and searched for the answer to this and never hit on the right search terms to find the answer. However, I asked an acquaintance and they pointed me right to an answer that worked for me. See here:
http://newsgroups.derkeiler.com/Archive ... 00301.html
and
http://newsgroups.derkeiler.com/Archive ... 00370.html
The important bit is to try enclosing the author's last name in curly brackets in the bibtex file. So, using my previous example:
Jiminez Martinez and Valdez Diaz 2009:158-159
@ARTICLE{martinez09citation,
author = {{Jim\'{i}nez Mar\'{i}inez}, Emiliano and {Valdez D\'{i}az}, Francisco},
title = {Citation},
journal = {Journal},
year = {2009},
volume = {13},
pages = {150-160},
}
It's worked for me so far, anyway!
http://newsgroups.derkeiler.com/Archive ... 00301.html
and
http://newsgroups.derkeiler.com/Archive ... 00370.html
The important bit is to try enclosing the author's last name in curly brackets in the bibtex file. So, using my previous example:
Jiminez Martinez and Valdez Diaz 2009:158-159
@ARTICLE{martinez09citation,
author = {{Jim\'{i}nez Mar\'{i}inez}, Emiliano and {Valdez D\'{i}az}, Francisco},
title = {Citation},
journal = {Journal},
year = {2009},
volume = {13},
pages = {150-160},
}
It's worked for me so far, anyway!
-
- Posts: 29
- Joined: Thu Feb 19, 2009 3:23 pm
Re: Allowing line break with in-text citation?
I also learned that there are some conflicts between natbib and hyperref. If you take out hyperref the citations will break across lines.
ETA:
Actually, all you need to do is add the option breaklinks:
\usepackage[breaklinks]{hyperref}
ETA:
Actually, all you need to do is add the option breaklinks:
\usepackage[breaklinks]{hyperref}
Re: Allowing line break with in-text citation?
If use option \usepackage[breaklinks]{hyperref}, it works well for me.
Thank you so much
Thank you so much