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?













18















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?










share|improve this question




























    18















    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?










    share|improve this question


























      18












      18








      18


      2






      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?










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      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




















          3 Answers
          3






          active

          oldest

          votes


















          11














          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





          share|improve this answer























          • 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-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


















          6














          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.





          share|improve this answer


















          • 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











          • 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



















          2














          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.






          share|improve this answer

























            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
            );



            );













            draft saved

            draft discarded


















            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









            11














            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





            share|improve this answer























            • 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-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















            11














            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





            share|improve this answer























            • 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-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













            11












            11








            11







            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





            share|improve this answer













            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






            share|improve this answer












            share|improve this answer



            share|improve this answer










            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-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

















            • 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-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
















            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











            6














            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.





            share|improve this answer


















            • 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











            • 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
















            6














            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.





            share|improve this answer


















            • 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











            • 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














            6












            6








            6







            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.





            share|improve this answer













            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.






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Oct 25 '10 at 15:49









            Stefan KottwitzStefan Kottwitz

            179k65573762




            179k65573762







            • 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











            • 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













            • 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











            • 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








            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












            2














            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.






            share|improve this answer





























              2














              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.






              share|improve this answer



























                2












                2








                2







                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.






                share|improve this answer















                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.







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 15 mins ago

























                answered Apr 15 '17 at 22:21









                Ben LiblitBen Liblit

                973816




                973816



























                    draft saved

                    draft discarded
















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    How should I use the fbox command correctly to avoid producing a Bad Box message?How to put a long piece of text in a box?How to specify height and width of fboxIs there an arrayrulecolor-like command to change the rule color of fbox?What is the command to highlight bad boxes in pdf?Why does fbox sometimes place the box *over* the graphic image?how to put the text in the boxHow to create command for a box where text inside the box can automatically adjust?how can I make an fbox like command with certain color, shape and width of border?how to use fbox in align modeFbox increase the spacing between the box and it content (inner margin)how to change the box height of an equationWhat is the use of the hbox in a newcommand command?

                    Doxepinum Nexus interni Notae | Tabula navigationis3158DB01142WHOa682390"Structural Analysis of the Histamine H1 Receptor""Transdermal and Topical Drug Administration in the Treatment of Pain""Antidepressants as antipruritic agents: A review"

                    inputenc: Unicode character … not set up for use with LaTeX The Next CEO of Stack OverflowEntering Unicode characters in LaTeXHow to solve the `Package inputenc Error: Unicode char not set up for use with LaTeX` problem?solve “Unicode char is not set up for use with LaTeX” without special handling of every new interesting UTF-8 characterPackage inputenc Error: Unicode character ² (U+B2)(inputenc) not set up for use with LaTeX. acroI2C[I²C]package inputenc error unicode char (u + 190) not set up for use with latexPackage inputenc Error: Unicode char u8:′ not set up for use with LaTeX. 3′inputenc Error: Unicode char u8: not set up for use with LaTeX with G-BriefPackage Inputenc Error: Unicode char u8: not set up for use with LaTeXPackage inputenc Error: Unicode char ́ (U+301)(inputenc) not set up for use with LaTeX. includePackage inputenc Error: Unicode char ̂ (U+302)(inputenc) not set up for use with LaTeX. … $widehatleft (OA,AA' right )$Package inputenc Error: Unicode char â„¡ (U+2121)(inputenc) not set up for use with LaTeX. printbibliography[heading=bibintoc]Package inputenc Error: Unicode char − (U+2212)(inputenc) not set up for use with LaTeXPackage inputenc Error: Unicode character α (U+3B1) not set up for use with LaTeXPackage inputenc Error: Unicode characterError: ! Package inputenc Error: Unicode char ⊘ (U+2298)(inputenc) not set up for use with LaTeX