有人知道如何使用 BibTeX 锁定参考书目条目左上角的反向引用吗?结果应该是这样的:
它在使用时对我有用\bibitem
(是的,它会自动到达那里),但不是通过文件.bib
。
这是我的代码:
\documentclass[a4paper,12pt]{book}
\usepackage[spanish]{babel}
\usepackage[T1]{fontenc}
\usepackage{latexsym}
\usepackage{lettrine}
\usepackage[latin1]{inputenc}
\usepackage{setspace}
\spanishdecimal{.}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{eso-pic}
\usepackage{everyshi}
\usepackage{pdfpages}
\usepackage[round]{natbib}
\bibliographystyle{plainnat}
\usepackage[backref=page,citecolor=MidnightBlue,linkcolor=MidnightBlue]{hyperref}
\hypersetup{colorlinks=true,plainpages=false}
\usepackage{etoolbox}
%backref edit. this part is thanks to [lockstep](http://tex.stackexchange.com/questions/36307/formatting-back-references-in-bibliography)
\makeatletter
\patchcmd{\BR@backref}{\newblock}{\newblock p.~}{}{}
\patchcmd{\BR@backref}{\par}{\par}{}{}
%all-in-one hyperlink ([D.Roepo](http://tex.stackexchange.com/questions/115039/single-link-in-author-year-citation-style-using-natbib-and-hyperref))
\pretocmd{\NAT@citex}{%
\let\NAT@hyper@\NAT@hyper@citex
\def\NAT@postnote{#2}%
\setcounter{NAT@total@cites}{0}%
\setcounter{NAT@count@cites}{0}%
\forcsvlist{\stepcounter{NAT@total@cites}\@gobble}{#3}}{}{}
\newcounter{NAT@total@cites}
\newcounter{NAT@count@cites}
\def\NAT@postnote{}
% include postnote and \citet closing bracket in hyperlink
\def\NAT@hyper@citex#1{%
\stepcounter{NAT@count@cites}%
\hyper@natlinkstart{\@citeb\@extra@b@citeb}#1%
\ifnumequal{\value{NAT@count@cites}}{\value{NAT@total@cites}}
{\ifNAT@swa\else\if*\NAT@postnote*\else%
\NAT@cmt\NAT@postnote\global\def\NAT@postnote{}\fi\fi}{}%
\ifNAT@swa\else\if\relax\NAT@date\relax
\else\NAT@@close\global\let\NAT@nm\@empty\fi\fi% avoid compact citations
\hyper@natlinkend}
\renewcommand\hyper@natlinkbreak[2]{#1}
% avoid extraneous postnotes, closing brackets
\patchcmd{\NAT@citex}
{\ifNAT@swa\else\if*#2*\else\NAT@cmt#2\fi
\if\relax\NAT@date\relax\else\NAT@@close\fi\fi}{}{}{}
\patchcmd{\NAT@citex}
{\if\relax\NAT@date\relax\NAT@def@citea\else\NAT@def@citea@close\fi}
{\if\relax\NAT@date\relax\NAT@def@citea\else\NAT@def@citea@space\fi}{}{}
\makeatother
\usepackage{float}
\usepackage{epstopdf}
\usepackage{amsmath,amsbsy,amsfonts,amssymb,amscd,fancyhdr}
\DeclareGraphicsExtensions{.jpg,.pdf,.png,.gif,.eps}
\usepackage{rotating}
\usepackage{longtable}
\usepackage{chngpage}
\usepackage{anysize}
\usepackage{geometry}
\usepackage{aecompl}
\newcommand\BackgroundPic{
\put(0,0){
\parbox[b][\paperheight]{\paperwidth}{
\vfill
\centering
\vfill
}}}
\begin{document}
As it is said in \citet{trigo00} and \citet{venus}...
\mainmatter
{\refname}
\addcontentsline{toc}{part}{Bibliografía}
%%%%%%%% B1 (bibliography according to bibitems) %%%%%%%%%%%%%%%
\begin{thebibliography}{999}\bibliographystyle{plainnat}\label{biblio}
\bibitem[Svedhem et al.(2007)]{venus}
Svedhem, Hakan; Titov, Dmitry V.; Taylor, Fredric V.; Witasse, Oliver (2007). ``Venus as a more Earth-like planet''. Nature 450 (7170): 629-632.
\bibitem[Trigo y DaCamara(2000)]{trigo00}
R. M. Trigo and C. C. DaCamara, ``Circulation weather types and their influence on the precipitation regime in Portugal'', {\em International Journal of Climatology}, vol. 20, pp. 1559-1581, 2000.
\end{thebibliography}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%% B2 (Bibliography according to Bibtex) %%%%%%%%%%%
% \bibliography{my_bib_file}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
我的_bib_文件.bib:
@article
{venus,
title={Venus as a more Earth-like planet.},
author={Svedhem, H. and Titov, D.V. and Taylor, F.W. and Witasse, O.},
journal={Nature},
volume={450},
number={7170},
pages={629-32},
year={2007},
}
@article {trigo00,
author = {Trigo, Ricardo M. and DaCamara, Carlos C.},
title = {Circulation weather types and their influence on the precipitation regime in Portugal},
journal = {International Journal of Climatology},
volume = {20},
number = {13},
publisher = {John Wiley & Sons, Ltd.},
pages = {1559--1581},
keywords = {atmospheric circulation variability, droughts, Portugal, precipitation, weather typing},
year = {2000},
}
如果对 B1 进行了注释并且启用了 B2,则反向引用将转到参考书目条目的末尾,如下所示(我需要顶部的格式但使用 BibTeX):
答案1
似乎每个之后都需要一个空行\bibitem
。这也建议在手册hyperref
,在“扩展选项”部分(backref
)。thebibliography
您的示例中的环境有这些空白行,但 BibTeXplainnat.bst
不会将相应的空白行添加到它.bbl
生成的文件中。
我不知道是否存在更优雅的解决方案,但强制空白行的一种方法是制作本地副本并修改文件中定义的plainnat.bst
函数。output.bibitem
找到原始文件 (
kpsewhich plainnat.bst
)复制一份,例如复制到文档所在的目录。如果副本与原始文件同名,则同一目录中使用 的所有文档都可以看到它
\bibliographystyle{plainnat}
。编辑副本,将 定义中的 final 改为,
newline$
即添加一个。可以通过搜索字符串 找到该定义。output.bibitem
newline$ newline$
newline$
FUNCTION {output.bibitem}
结果: