Non-breaking space in citet using natbib?How to prevent line break within a (multiple) citationWrap natbib macros citep and citetHow do I repair “Author1, Author2, & Author3” citations with citet* in natbib?Natbib puts reference data one line per itemHow to restrict number of cited authors in citet or citeasnounUsing apalike and natbib in Lyx with author abbreviation as indexUse location field as address in natbibNatbib citation errorNatbib: How to cite all names of three or more authors the first time and then use “et al.”natbib: displaying author year and citation numberHow to list more than two authors in a citationIs it possible to have natbib list citations consistently?
Validation accuracy vs Testing accuracy
Should I join office cleaning event for free?
Simulate Bitwise Cyclic Tag
A Journey Through Space and Time
How did the USSR manage to innovate in an environment characterized by government censorship and high bureaucracy?
whey we use polarized capacitor?
Is there really no realistic way for a skeleton monster to move around without magic?
The use of multiple foreign keys on same column in SQL Server
Why are 150k or 200k jobs considered good when there are 300k+ births a month?
"You are your self first supporter", a more proper way to say it
Is it tax fraud for an individual to declare non-taxable revenue as taxable income? (US tax laws)
Why is this code 6.5x slower with optimizations enabled?
What is the command to reset a PC without deleting any files
A newer friend of my brother's gave him a load of baseball cards that are supposedly extremely valuable. Is this a scam?
N.B. ligature in Latex
What typically incentivizes a professor to change jobs to a lower ranking university?
How does one intimidate enemies without having the capacity for violence?
Japan - Plan around max visa duration
How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?
Draw simple lines in Inkscape
What defenses are there against being summoned by the Gate spell?
Why has Russell's definition of numbers using equivalence classes been finally abandoned? ( If it has actually been abandoned).
What do you call a Matrix-like slowdown and camera movement effect?
Extreme, but not acceptable situation and I can't start the work tomorrow morning
Non-breaking space in citet using natbib?
How to prevent line break within a (multiple) citationWrap natbib macros citep and citetHow do I repair “Author1, Author2, & Author3” citations with citet* in natbib?Natbib puts reference data one line per itemHow to restrict number of cited authors in citet or citeasnounUsing apalike and natbib in Lyx with author abbreviation as indexUse location field as address in natbibNatbib citation errorNatbib: How to cite all names of three or more authors the first time and then use “et al.”natbib: displaying author year and citation numberHow to list more than two authors in a citationIs it possible to have natbib list citations consistently?
When adding citations in the body of a document I'm used to write
... in some interesting paper~citeinteresting.
So that (if I'm using numbered references) the word “paper” and the citation number stick together and do not accidentally end up in two different lines.
It seems, however, that the citet
command from natbib
(which should produce something like “Authors [4]”), does not use a ~
between the names of the authors and the citation number so that, on a few rare occasions, I end up with something like
... Authors
[4].
Which is annoying. Is there an easy way to make natbib
use a non-breaking space there?
spacing line-breaking natbib
add a comment |
When adding citations in the body of a document I'm used to write
... in some interesting paper~citeinteresting.
So that (if I'm using numbered references) the word “paper” and the citation number stick together and do not accidentally end up in two different lines.
It seems, however, that the citet
command from natbib
(which should produce something like “Authors [4]”), does not use a ~
between the names of the authors and the citation number so that, on a few rare occasions, I end up with something like
... Authors
[4].
Which is annoying. Is there an easy way to make natbib
use a non-breaking space there?
spacing line-breaking natbib
add a comment |
When adding citations in the body of a document I'm used to write
... in some interesting paper~citeinteresting.
So that (if I'm using numbered references) the word “paper” and the citation number stick together and do not accidentally end up in two different lines.
It seems, however, that the citet
command from natbib
(which should produce something like “Authors [4]”), does not use a ~
between the names of the authors and the citation number so that, on a few rare occasions, I end up with something like
... Authors
[4].
Which is annoying. Is there an easy way to make natbib
use a non-breaking space there?
spacing line-breaking natbib
When adding citations in the body of a document I'm used to write
... in some interesting paper~citeinteresting.
So that (if I'm using numbered references) the word “paper” and the citation number stick together and do not accidentally end up in two different lines.
It seems, however, that the citet
command from natbib
(which should produce something like “Authors [4]”), does not use a ~
between the names of the authors and the citation number so that, on a few rare occasions, I end up with something like
... Authors
[4].
Which is annoying. Is there an easy way to make natbib
use a non-breaking space there?
spacing line-breaking natbib
spacing line-breaking natbib
edited Aug 5 '11 at 15:34
lockstep
193k53593723
193k53593723
asked Oct 25 '10 at 14:40
Juan A. NavarroJuan A. Navarro
36.7k27116163
36.7k27116163
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
Looks like NAT@spacechar
needs to be redefined:
documentclassarticle
usepackage[numbers]natbib
makeatletter
% defNAT@spacechar % OLD
defNAT@spacechar~% NEW
makeatother
usepackagefilecontents
beginfilecontentsjobname.bib
@misca01,
author = Author, A.,
year = 2001,
title = Alpha,
endfilecontents
begindocument
Let's test if author and citation number end up in different lines: citeta01.
bibliographystyleplainnat
bibliographyjobname
enddocument
Thanks! It does the trick. I wonder why this isn't the default behavior of natbib or, at least, there is an option to more easily set this.
– Juan A. Navarro
Oct 25 '10 at 15:49
1
I guess the default behavior was chosen with author-year-citations in mind, where allowing a line break between author and year is acceptable.
– lockstep
Oct 25 '10 at 15:58
2
Hey! I realize this is an almost 4 year old question, but I just tried to solve exactly the same line-breakingcitet
problem, and trying your suggestion did not make any difference. (I inserted the re-definition in the document preamble). Do you have any idea why that might be, or what I might try?
– penelope
Jun 24 '14 at 12:48
add a comment |
Since NAT@spacechar
is used, this redefinition prevents such breaks:
makeatletter
renewcommand*NAT@spacechar~
makeatother
This could affect also places where a break could be desired. Thus, an easy way for your rare occasions would be to use just mbox
around the citation:
... in the paper mboxcitetinteresting.
1
Also thanks for the suggestion. However note that thembox
wont always produce the desired result if the author name contains several words (or there are several authors), as there is nothing wrong with breaking the line between those names.
– Juan A. Navarro
Oct 25 '10 at 15:52
Stefans suggestion will also prevent hyphenation of author names.
– lockstep
Oct 25 '10 at 15:55
@Juan @lockstep: that's right! It's just intended to fix the line breaking for such occasions like in the question, where the author isn't hyphenated. Of course, such adjustment should be done at last, when the final version is being produced. This local correction avoids the global effect of changingNAT@spacechar
to be unbreakable.
– Stefan Kottwitz♦
Oct 25 '10 at 16:37
add a comment |
lockstep and Stefan Kottwitz suggest redefining NAT@spacechar
. That may have worked at one time, but I find that it no longer works now, seven years later, using natbib 2010/09/13 8.31b (PWD, AO)
from TeXLive 2016. A comment from @penelope also mentions that this approach was no longer working as of mid-2014.
The following strategy does work for me as of now. Add the following to your document preamble somewhere after usepackagenatbib
:
bibpunctnolinebreak[],n,
The key piece of this is the nolinebreak[
, which discourages LaTeX from breaking a line before the [
that starts a group of bracketed citation numbers. The remaining arguments to bibpunct
merely replicate the standard punctuation for bracketed, numbered citations.
Note that the immediately after
nolinebreak
is not really an empty argument to nolinebreak
. Rather, it simply prevents nolinebreak
from mistaking the following [
for the start of an optional argument. That being said, nolinebreak
does accept an optional argument that determines how strongly a break should be discouraged. So you could instead use something like bibpunctnolinebreak[0][],n,
to make the no-break directive merely a mild request, all the way up to bibpunctnolinebreak[4][],n,
for a strict demand. The latter is equivalent to the default treatment you get if you use the bibpunctnolinebreak[],n,
form I suggested initially.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "85"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f4542%2fnon-breaking-space-in-citet-using-natbib%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
Looks like NAT@spacechar
needs to be redefined:
documentclassarticle
usepackage[numbers]natbib
makeatletter
% defNAT@spacechar % OLD
defNAT@spacechar~% NEW
makeatother
usepackagefilecontents
beginfilecontentsjobname.bib
@misca01,
author = Author, A.,
year = 2001,
title = Alpha,
endfilecontents
begindocument
Let's test if author and citation number end up in different lines: citeta01.
bibliographystyleplainnat
bibliographyjobname
enddocument
Thanks! It does the trick. I wonder why this isn't the default behavior of natbib or, at least, there is an option to more easily set this.
– Juan A. Navarro
Oct 25 '10 at 15:49
1
I guess the default behavior was chosen with author-year-citations in mind, where allowing a line break between author and year is acceptable.
– lockstep
Oct 25 '10 at 15:58
2
Hey! I realize this is an almost 4 year old question, but I just tried to solve exactly the same line-breakingcitet
problem, and trying your suggestion did not make any difference. (I inserted the re-definition in the document preamble). Do you have any idea why that might be, or what I might try?
– penelope
Jun 24 '14 at 12:48
add a comment |
Looks like NAT@spacechar
needs to be redefined:
documentclassarticle
usepackage[numbers]natbib
makeatletter
% defNAT@spacechar % OLD
defNAT@spacechar~% NEW
makeatother
usepackagefilecontents
beginfilecontentsjobname.bib
@misca01,
author = Author, A.,
year = 2001,
title = Alpha,
endfilecontents
begindocument
Let's test if author and citation number end up in different lines: citeta01.
bibliographystyleplainnat
bibliographyjobname
enddocument
Thanks! It does the trick. I wonder why this isn't the default behavior of natbib or, at least, there is an option to more easily set this.
– Juan A. Navarro
Oct 25 '10 at 15:49
1
I guess the default behavior was chosen with author-year-citations in mind, where allowing a line break between author and year is acceptable.
– lockstep
Oct 25 '10 at 15:58
2
Hey! I realize this is an almost 4 year old question, but I just tried to solve exactly the same line-breakingcitet
problem, and trying your suggestion did not make any difference. (I inserted the re-definition in the document preamble). Do you have any idea why that might be, or what I might try?
– penelope
Jun 24 '14 at 12:48
add a comment |
Looks like NAT@spacechar
needs to be redefined:
documentclassarticle
usepackage[numbers]natbib
makeatletter
% defNAT@spacechar % OLD
defNAT@spacechar~% NEW
makeatother
usepackagefilecontents
beginfilecontentsjobname.bib
@misca01,
author = Author, A.,
year = 2001,
title = Alpha,
endfilecontents
begindocument
Let's test if author and citation number end up in different lines: citeta01.
bibliographystyleplainnat
bibliographyjobname
enddocument
Looks like NAT@spacechar
needs to be redefined:
documentclassarticle
usepackage[numbers]natbib
makeatletter
% defNAT@spacechar % OLD
defNAT@spacechar~% NEW
makeatother
usepackagefilecontents
beginfilecontentsjobname.bib
@misca01,
author = Author, A.,
year = 2001,
title = Alpha,
endfilecontents
begindocument
Let's test if author and citation number end up in different lines: citeta01.
bibliographystyleplainnat
bibliographyjobname
enddocument
answered Oct 25 '10 at 15:40
locksteplockstep
193k53593723
193k53593723
Thanks! It does the trick. I wonder why this isn't the default behavior of natbib or, at least, there is an option to more easily set this.
– Juan A. Navarro
Oct 25 '10 at 15:49
1
I guess the default behavior was chosen with author-year-citations in mind, where allowing a line break between author and year is acceptable.
– lockstep
Oct 25 '10 at 15:58
2
Hey! I realize this is an almost 4 year old question, but I just tried to solve exactly the same line-breakingcitet
problem, and trying your suggestion did not make any difference. (I inserted the re-definition in the document preamble). Do you have any idea why that might be, or what I might try?
– penelope
Jun 24 '14 at 12:48
add a comment |
Thanks! It does the trick. I wonder why this isn't the default behavior of natbib or, at least, there is an option to more easily set this.
– Juan A. Navarro
Oct 25 '10 at 15:49
1
I guess the default behavior was chosen with author-year-citations in mind, where allowing a line break between author and year is acceptable.
– lockstep
Oct 25 '10 at 15:58
2
Hey! I realize this is an almost 4 year old question, but I just tried to solve exactly the same line-breakingcitet
problem, and trying your suggestion did not make any difference. (I inserted the re-definition in the document preamble). Do you have any idea why that might be, or what I might try?
– penelope
Jun 24 '14 at 12:48
Thanks! It does the trick. I wonder why this isn't the default behavior of natbib or, at least, there is an option to more easily set this.
– Juan A. Navarro
Oct 25 '10 at 15:49
Thanks! It does the trick. I wonder why this isn't the default behavior of natbib or, at least, there is an option to more easily set this.
– Juan A. Navarro
Oct 25 '10 at 15:49
1
1
I guess the default behavior was chosen with author-year-citations in mind, where allowing a line break between author and year is acceptable.
– lockstep
Oct 25 '10 at 15:58
I guess the default behavior was chosen with author-year-citations in mind, where allowing a line break between author and year is acceptable.
– lockstep
Oct 25 '10 at 15:58
2
2
Hey! I realize this is an almost 4 year old question, but I just tried to solve exactly the same line-breaking
citet
problem, and trying your suggestion did not make any difference. (I inserted the re-definition in the document preamble). Do you have any idea why that might be, or what I might try?– penelope
Jun 24 '14 at 12:48
Hey! I realize this is an almost 4 year old question, but I just tried to solve exactly the same line-breaking
citet
problem, and trying your suggestion did not make any difference. (I inserted the re-definition in the document preamble). Do you have any idea why that might be, or what I might try?– penelope
Jun 24 '14 at 12:48
add a comment |
Since NAT@spacechar
is used, this redefinition prevents such breaks:
makeatletter
renewcommand*NAT@spacechar~
makeatother
This could affect also places where a break could be desired. Thus, an easy way for your rare occasions would be to use just mbox
around the citation:
... in the paper mboxcitetinteresting.
1
Also thanks for the suggestion. However note that thembox
wont always produce the desired result if the author name contains several words (or there are several authors), as there is nothing wrong with breaking the line between those names.
– Juan A. Navarro
Oct 25 '10 at 15:52
Stefans suggestion will also prevent hyphenation of author names.
– lockstep
Oct 25 '10 at 15:55
@Juan @lockstep: that's right! It's just intended to fix the line breaking for such occasions like in the question, where the author isn't hyphenated. Of course, such adjustment should be done at last, when the final version is being produced. This local correction avoids the global effect of changingNAT@spacechar
to be unbreakable.
– Stefan Kottwitz♦
Oct 25 '10 at 16:37
add a comment |
Since NAT@spacechar
is used, this redefinition prevents such breaks:
makeatletter
renewcommand*NAT@spacechar~
makeatother
This could affect also places where a break could be desired. Thus, an easy way for your rare occasions would be to use just mbox
around the citation:
... in the paper mboxcitetinteresting.
1
Also thanks for the suggestion. However note that thembox
wont always produce the desired result if the author name contains several words (or there are several authors), as there is nothing wrong with breaking the line between those names.
– Juan A. Navarro
Oct 25 '10 at 15:52
Stefans suggestion will also prevent hyphenation of author names.
– lockstep
Oct 25 '10 at 15:55
@Juan @lockstep: that's right! It's just intended to fix the line breaking for such occasions like in the question, where the author isn't hyphenated. Of course, such adjustment should be done at last, when the final version is being produced. This local correction avoids the global effect of changingNAT@spacechar
to be unbreakable.
– Stefan Kottwitz♦
Oct 25 '10 at 16:37
add a comment |
Since NAT@spacechar
is used, this redefinition prevents such breaks:
makeatletter
renewcommand*NAT@spacechar~
makeatother
This could affect also places where a break could be desired. Thus, an easy way for your rare occasions would be to use just mbox
around the citation:
... in the paper mboxcitetinteresting.
Since NAT@spacechar
is used, this redefinition prevents such breaks:
makeatletter
renewcommand*NAT@spacechar~
makeatother
This could affect also places where a break could be desired. Thus, an easy way for your rare occasions would be to use just mbox
around the citation:
... in the paper mboxcitetinteresting.
answered Oct 25 '10 at 15:49
Stefan Kottwitz♦Stefan Kottwitz
179k65573762
179k65573762
1
Also thanks for the suggestion. However note that thembox
wont always produce the desired result if the author name contains several words (or there are several authors), as there is nothing wrong with breaking the line between those names.
– Juan A. Navarro
Oct 25 '10 at 15:52
Stefans suggestion will also prevent hyphenation of author names.
– lockstep
Oct 25 '10 at 15:55
@Juan @lockstep: that's right! It's just intended to fix the line breaking for such occasions like in the question, where the author isn't hyphenated. Of course, such adjustment should be done at last, when the final version is being produced. This local correction avoids the global effect of changingNAT@spacechar
to be unbreakable.
– Stefan Kottwitz♦
Oct 25 '10 at 16:37
add a comment |
1
Also thanks for the suggestion. However note that thembox
wont always produce the desired result if the author name contains several words (or there are several authors), as there is nothing wrong with breaking the line between those names.
– Juan A. Navarro
Oct 25 '10 at 15:52
Stefans suggestion will also prevent hyphenation of author names.
– lockstep
Oct 25 '10 at 15:55
@Juan @lockstep: that's right! It's just intended to fix the line breaking for such occasions like in the question, where the author isn't hyphenated. Of course, such adjustment should be done at last, when the final version is being produced. This local correction avoids the global effect of changingNAT@spacechar
to be unbreakable.
– Stefan Kottwitz♦
Oct 25 '10 at 16:37
1
1
Also thanks for the suggestion. However note that the
mbox
wont always produce the desired result if the author name contains several words (or there are several authors), as there is nothing wrong with breaking the line between those names.– Juan A. Navarro
Oct 25 '10 at 15:52
Also thanks for the suggestion. However note that the
mbox
wont always produce the desired result if the author name contains several words (or there are several authors), as there is nothing wrong with breaking the line between those names.– Juan A. Navarro
Oct 25 '10 at 15:52
Stefans suggestion will also prevent hyphenation of author names.
– lockstep
Oct 25 '10 at 15:55
Stefans suggestion will also prevent hyphenation of author names.
– lockstep
Oct 25 '10 at 15:55
@Juan @lockstep: that's right! It's just intended to fix the line breaking for such occasions like in the question, where the author isn't hyphenated. Of course, such adjustment should be done at last, when the final version is being produced. This local correction avoids the global effect of changing
NAT@spacechar
to be unbreakable.– Stefan Kottwitz♦
Oct 25 '10 at 16:37
@Juan @lockstep: that's right! It's just intended to fix the line breaking for such occasions like in the question, where the author isn't hyphenated. Of course, such adjustment should be done at last, when the final version is being produced. This local correction avoids the global effect of changing
NAT@spacechar
to be unbreakable.– Stefan Kottwitz♦
Oct 25 '10 at 16:37
add a comment |
lockstep and Stefan Kottwitz suggest redefining NAT@spacechar
. That may have worked at one time, but I find that it no longer works now, seven years later, using natbib 2010/09/13 8.31b (PWD, AO)
from TeXLive 2016. A comment from @penelope also mentions that this approach was no longer working as of mid-2014.
The following strategy does work for me as of now. Add the following to your document preamble somewhere after usepackagenatbib
:
bibpunctnolinebreak[],n,
The key piece of this is the nolinebreak[
, which discourages LaTeX from breaking a line before the [
that starts a group of bracketed citation numbers. The remaining arguments to bibpunct
merely replicate the standard punctuation for bracketed, numbered citations.
Note that the immediately after
nolinebreak
is not really an empty argument to nolinebreak
. Rather, it simply prevents nolinebreak
from mistaking the following [
for the start of an optional argument. That being said, nolinebreak
does accept an optional argument that determines how strongly a break should be discouraged. So you could instead use something like bibpunctnolinebreak[0][],n,
to make the no-break directive merely a mild request, all the way up to bibpunctnolinebreak[4][],n,
for a strict demand. The latter is equivalent to the default treatment you get if you use the bibpunctnolinebreak[],n,
form I suggested initially.
add a comment |
lockstep and Stefan Kottwitz suggest redefining NAT@spacechar
. That may have worked at one time, but I find that it no longer works now, seven years later, using natbib 2010/09/13 8.31b (PWD, AO)
from TeXLive 2016. A comment from @penelope also mentions that this approach was no longer working as of mid-2014.
The following strategy does work for me as of now. Add the following to your document preamble somewhere after usepackagenatbib
:
bibpunctnolinebreak[],n,
The key piece of this is the nolinebreak[
, which discourages LaTeX from breaking a line before the [
that starts a group of bracketed citation numbers. The remaining arguments to bibpunct
merely replicate the standard punctuation for bracketed, numbered citations.
Note that the immediately after
nolinebreak
is not really an empty argument to nolinebreak
. Rather, it simply prevents nolinebreak
from mistaking the following [
for the start of an optional argument. That being said, nolinebreak
does accept an optional argument that determines how strongly a break should be discouraged. So you could instead use something like bibpunctnolinebreak[0][],n,
to make the no-break directive merely a mild request, all the way up to bibpunctnolinebreak[4][],n,
for a strict demand. The latter is equivalent to the default treatment you get if you use the bibpunctnolinebreak[],n,
form I suggested initially.
add a comment |
lockstep and Stefan Kottwitz suggest redefining NAT@spacechar
. That may have worked at one time, but I find that it no longer works now, seven years later, using natbib 2010/09/13 8.31b (PWD, AO)
from TeXLive 2016. A comment from @penelope also mentions that this approach was no longer working as of mid-2014.
The following strategy does work for me as of now. Add the following to your document preamble somewhere after usepackagenatbib
:
bibpunctnolinebreak[],n,
The key piece of this is the nolinebreak[
, which discourages LaTeX from breaking a line before the [
that starts a group of bracketed citation numbers. The remaining arguments to bibpunct
merely replicate the standard punctuation for bracketed, numbered citations.
Note that the immediately after
nolinebreak
is not really an empty argument to nolinebreak
. Rather, it simply prevents nolinebreak
from mistaking the following [
for the start of an optional argument. That being said, nolinebreak
does accept an optional argument that determines how strongly a break should be discouraged. So you could instead use something like bibpunctnolinebreak[0][],n,
to make the no-break directive merely a mild request, all the way up to bibpunctnolinebreak[4][],n,
for a strict demand. The latter is equivalent to the default treatment you get if you use the bibpunctnolinebreak[],n,
form I suggested initially.
lockstep and Stefan Kottwitz suggest redefining NAT@spacechar
. That may have worked at one time, but I find that it no longer works now, seven years later, using natbib 2010/09/13 8.31b (PWD, AO)
from TeXLive 2016. A comment from @penelope also mentions that this approach was no longer working as of mid-2014.
The following strategy does work for me as of now. Add the following to your document preamble somewhere after usepackagenatbib
:
bibpunctnolinebreak[],n,
The key piece of this is the nolinebreak[
, which discourages LaTeX from breaking a line before the [
that starts a group of bracketed citation numbers. The remaining arguments to bibpunct
merely replicate the standard punctuation for bracketed, numbered citations.
Note that the immediately after
nolinebreak
is not really an empty argument to nolinebreak
. Rather, it simply prevents nolinebreak
from mistaking the following [
for the start of an optional argument. That being said, nolinebreak
does accept an optional argument that determines how strongly a break should be discouraged. So you could instead use something like bibpunctnolinebreak[0][],n,
to make the no-break directive merely a mild request, all the way up to bibpunctnolinebreak[4][],n,
for a strict demand. The latter is equivalent to the default treatment you get if you use the bibpunctnolinebreak[],n,
form I suggested initially.
edited 15 mins ago
answered Apr 15 '17 at 22:21
Ben LiblitBen Liblit
973816
973816
add a comment |
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f4542%2fnon-breaking-space-in-citet-using-natbib%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown