Skip to content

Problème de Natbib-Multibib avec les étiquettes de préfixe

Nous avons trouvé la solution à ce bourrage, du moins nous le pensons. Si vous avez encore des inquiétudes laissez votre commentaire et sans aucun doute

Solution :

Voici une façon d'arriver à votre résultat. (J'avais dupliqué vos références pour vérifier si le tri et la compression fonctionnent).

Vous devez garder à l'esprit que le site natbib doit être commenté jusqu'à ce que vous génériez O.bbl et .bbl. C'est pour charger le paquetage natbib une fois que vous avez généré le paquet bbl en utilisant bibtex. Sinon, les fichiers citation n'écriront que dans .aux et les O.bbl sera générée sans bibitem{...}. Vous devrez garder cela à l'esprit à un stade ultérieur lorsque vous modifierez votre fichier main.bib fichier.

documentclass{scrbook}

usepackage{filecontents}
begin{filecontents}{main.bib}
@ARTICLE{travis,
  author = {Brehm, M. and Kirchner, B.},
  title = {TRAVIS - A free Analyzer and Visualizer for Monte Carlo and Molecular
    Dynamics Trajectories},
  journal = {J. Chem. Inf. Model.},
  year = {2011},
  volume = {51 (8)},
  pages = {2007-2023},
  owner = {Brehministrator},
  timestamp = {2011.11.27}
},
@ARTICLE{travis1,
  author = {Brehm, M. and Kirchner, B.},
  title = {TRAVIS - A free Analyzer and Visualizer for Monte Carlo and Molecular
    Dynamics Trajectories},
  journal = {J. Chem. Inf. Model.},
  year = {2011},
  volume = {51 (8)},
  pages = {2007-2023},
  owner = {Brehministrator},
  timestamp = {2011.11.27}
},
@ARTICLE{travis2,
  author = {Brehm, M. and Kirchner, B.},
  title = {TRAVIS - A free Analyzer and Visualizer for Monte Carlo and Molecular
    Dynamics Trajectories},
  journal = {J. Chem. Inf. Model.},
  year = {2011},
  volume = {51 (8)},
  pages = {2007-2023},
  owner = {Brehministrator},
  timestamp = {2011.11.27}
},
@ARTICLE{travis3,
  author = {Brehm, M. and Kirchner, B.},
  title = {TRAVIS - A free Analyzer and Visualizer for Monte Carlo and Molecular
    Dynamics Trajectories},
  journal = {J. Chem. Inf. Model.},
  year = {2011},
  volume = {51 (8)},
  pages = {2007-2023},
  owner = {Brehministrator},
  timestamp = {2011.11.27}
},
@ARTICLE{welton2001,
  author = {L. Cammarata and S. G. Kazarian and P. A. Salter and T. Welton},
  title = {Molecular states of water in room temperature ionic liquids},
  journal = {Phys. Chem. Chem. Phys.},
  year = {2001},
  volume = {3},
  pages = {5192-5200},
  owner = {Brehministrator},
  timestamp = {2011.12.11}
}
@ARTICLE{welton20011,
  author = {L. Cammarata and S. G. Kazarian and P. A. Salter and T. Welton},
  title = {Molecular states of water in room temperature ionic liquids},
  journal = {Phys. Chem. Chem. Phys.},
  year = {2001},
  volume = {3},
  pages = {5192-5200},
  owner = {Brehministrator},
  timestamp = {2011.12.11}
}
@ARTICLE{welton20012,
  author = {L. Cammarata and S. G. Kazarian and P. A. Salter and T. Welton},
  title = {Molecular states of water in room temperature ionic liquids},
  journal = {Phys. Chem. Chem. Phys.},
  year = {2001},
  volume = {3},
  pages = {5192-5200},
  owner = {Brehministrator},
  timestamp = {2011.12.11}
}
@ARTICLE{welton20013,
  author = {L. Cammarata and S. G. Kazarian and P. A. Salter and T. Welton},
  title = {Molecular states of water in room temperature ionic liquids},
  journal = {Phys. Chem. Chem. Phys.},
  year = {2001},
  volume = {3},
  pages = {5192-5200},
  owner = {Brehministrator},
  timestamp = {2011.12.11}
}
}
end{filecontents}

usepackage[square,sort&compress,super,comma]{natbib} %%Comment on first run

usepackage[labeled,resetlabels]{multibib}

newcites{O}{Own Publications}

makeatletter
AtBeginDocument{@ifpackageloaded{natbib}{%
expandafterDeclareRobustCommandcsname cite@suffixendcsname
    {begingrouplet[email protected][email protected][email protected][email protected]
      @ifstar{[email protected][email protected]}{[email protected]csname [email protected]@suffixendcsname}}
expandafternewcommandcsname [email protected]@suffixendcsname{@ifnextchar [{csname [email protected]@citetp@suffixendcsname}{%
     [email protected]else
     [email protected]
     fi
    csname [email protected]@citetp@suffixendcsname[]}}
expandafternewcommandcsname [email protected]@suffixendcsname{@ifnextchar[{csname [email protected]@citetp@suffixendcsname}{csname [email protected]@citetp@suffixendcsname[]}}
expandafternewcommandcsname [email protected]@citetp@suffixendcsname{}
expandafterdefcsname [email protected]@citetp@suffixendcsname[#1]{@ifnextchar[{csname @citex@suffixendcsname[#1]}{csname @citex@suffixendcsname[][#1]}}
expandafternewcommandcsname [email protected]@cites@suffixendcsname{%
  [email protected]
    [email protected] let@cite[email protected]
       def[email protected]##1{unskipnobreaktextsuperscript{##1}}%
       letciteyearpar=citeyear
       let[email protected]relax
       def[email protected]@kern{kern[email protected]}%
    else
       let[email protected]=mbox
       let@cite[email protected]
       let[email protected][email protected]
       let[email protected]@kernrelax
    fi
    expandafterletcsname @citex@suffixexpandafterendcsnamecsname [email protected]@suffixendcsname
    let@biblabel[email protected]
    let@bibsetup[email protected]
    renewcommand[email protected]{[email protected][email protected][email protected][email protected][email protected]}%
    defnatexlab##1{}%
    def[email protected]{penalty@m}%
  else
    let@cite[email protected]
    let@citex[email protected]
    let@biblabel[email protected]
    let@bibsetup[email protected]
    let[email protected][email protected]
    let[email protected]@empty
    renewcommand[email protected]{[email protected][email protected][email protected][email protected][email protected]}%
    defnatexlab##1{##1}%
  fi}
expandafternewcommandcsname [email protected]@suffixendcsname{,@suffix}
expandafterdefcsname [email protected]@suffixendcsname{csname [email protected]@suffixendcsname[email protected]}%
expandafterdefcsname [email protected]@citea@suffixendcsname{def@citea{csname [email protected]@suffixendcsname[email protected]}}%
expandafterdefcsname [email protected]@[email protected]@suffixendcsname{def@citea{csname [email protected]@suffixendcsname[email protected]}}%
expandafterdefcsname [email protected]@[email protected]@suffixendcsname{def@citea{[email protected]@closecsname [email protected]@suffixendcsname[email protected]}}%
expandafterdefcsname [email protected]@[email protected]@suffixendcsname{def@citea{[email protected]{[email protected]@close}csname [email protected]@suffixendcsname[email protected]}}%
expandafterdefcsname [email protected]@suffixendcsname[#1][#2]#3{%
  [email protected]@parser
  [email protected]@cites{#3}%
  [email protected]@citea
  @cite{def[email protected]{-1}let[email protected]@yrrelaxlet[email protected]@empty
    @for@citeb:=[email protected]@listdo
    {@[email protected]
     edef@citeb{expandafter@firstofone@citeb@empty}%
     @[email protected]
     @ifundefined{[email protected]@citeb@[email protected]@citeb}{%
       {[email protected]bfseries?}
        [email protected]PackageWarning{natbib}%
       {Citation `@citeb' on page thepage space undefined}}%
     {let[email protected]@num[email protected]let[email protected]@nm[email protected]
      [email protected]{@citeb}%
      [email protected]@ifundefined{[email protected]@citeb@[email protected]@citeb}{%
        let[email protected]=[email protected]@names
        global@namedef{[email protected]@citeb@[email protected]@citeb}{}}{}%
      fi
      [email protected]let[email protected][email protected]@nameselse
        let[email protected][email protected]fi
      [email protected]
       @ifnum{[email protected]>@ne}{%
        @citea
        [email protected]@{@ifnum{[email protected]=[email protected]}{[email protected]{[email protected]}}{[email protected]}}%
       }{%
        @ifnum{[email protected]>[email protected]}{%
         [email protected]@num[email protected]
          {let[email protected]=[email protected]}%
          {def[email protected]{-2}}%
         [email protected]@num[email protected]@num
          {@tempcnta=[email protected]@numrelax}%
          {@suffix@tempcnta[email protected]}%
         @ifnum{[email protected]=@tempcnta}{%
          @ifnum{[email protected]>@ne}{}{[email protected]@[email protected]}%
         }{%
           advance@tempcnta by@ne
           @ifnum{[email protected]=@tempcnta}{%
             ifx[email protected]@yrrelax
               [email protected]@[email protected]{@citea}%
             else
               [email protected]@[email protected]{--[email protected]@suffix}%
             fi
           }{%
             [email protected]@[email protected]
           }%
         }%
        }{%
         @tempswatrue
         @ifnum{[email protected]>@ne}{@ifnum{[email protected]@num=[email protected]relax}{@tempswafalse}{}}{}%
         [email protected][email protected]@mboxfi
        }%
       }%
       csname [email protected]@citea@suffixendcsname
      else
        ifcase[email protected]
          ifx[email protected]@nm[email protected] [email protected][email protected][email protected]else
            @citea [email protected]{@ne}[email protected][email protected]{[email protected]@kern[email protected]@open}%
          fi
          if*#1*else#1[email protected]fi
          [email protected]{[email protected]@{{citenumfont{[email protected]}}}}%
          csname [email protected]@[email protected]@suffixendcsname
        or
          csname [email protected]@[email protected]@suffixendcsname{[email protected]{[email protected]}}%
        or
          csname [email protected]@[email protected]@suffixendcsname{[email protected]{[email protected]}}%
        or
          csname [email protected]@[email protected]@suffixendcsname[email protected]
        fi
      fi
     }%
    }%
      @ifnum{[email protected]>[email protected]}{[email protected]@yr}{}%
      [email protected]else
        @ifnum{[email protected]=[email protected]}{%
          if*#2*else[email protected]#2fi
        }{}%
        [email protected]{[email protected]@close}%
      fi
  }{#1}{#2}%
}%
csname [email protected]@cites@suffixendcsname
}{}
defmycite{csname cite@suffixendcsname}
}%
makeatother

begin{document}
chapter{Introduction}

Citing my own literaturemycite{travis} andmycite{travis,travis3} andmycite[p.~1]{travis,travis3,travis2,travis1} andmycite{travis,travis3,travis1}
Citing other people's literaturecite{welton2001} andcite{welton2001,welton20013} andcite[p.~1]{welton2001,welton20013,welton20012,welton20011} andcite{welton2001,welton20013,welton20011}.

appendix
bibliographystyle{plain}
bibliographystyleO{plain}
bibliography{main}
bibliographyO{main}

end{document}

Les macros qui sont définies entre makeatletter et makeatother sont prises dans natbib paquet.

La sortie ressemblera à :
Citation de texteLes autres gensPropre littérature



Utilisez notre moteur de recherche

Ricerca
Generic filters

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée.