如何使用 bibtex 书目缩进书目项目?

如何使用 bibtex 书目缩进书目项目?

我在这里看到了一个很好的答案,可以添加缩进到参考书目中 缩进参考书目的第二行并希望使用 bibtex 复制此示例,而不是像其他问题的作者那样将参考书目直接放入 .tex 文件中。这就是这个问题的不同之处。

因此,我想知道您是否能帮我采用该问题中的代码?我本质上希望重现其他作者所做的工作,为我的示例添加缩进,这样我就可以将每个参考文献的第二行和第三行缩进。例如,以“期望”开头的行将被缩进。非常感谢。

样本书目

这是另一个问题的代码:

\documentclass{article}
\begin{document}

\def\bibindent{1em}
\begin{thebibliography}{99\kern\bibindent}
\makeatletter
\let\old@biblabel\@biblabel
\def\@biblabel#1{\old@biblabel{#1}\kern\bibindent}
\let\old@bibitem\bibitem
\def\bibitem#1{\old@bibitem{#1}\leavevmode\kern-\bibindent}
\makeatother

\bibitem{Lorem}\textsc{Lorem ipsum dolor sit}
\texttt{Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras vitae purus mi.        Fusce quam urna, elementum at ullamcorper in, tempus sed quam.}
\end{thebibliography}

\end{document}

请参阅.tex下面的 MWP 文件以及该文件的内容bibo.bib

\documentclass[aps,superscriptaddress,nofootinbib]{revtex4}

\usepackage[latin9]{inputenc}

\setcounter{secnumdepth}{3}

\usepackage{mathtools}

\usepackage{natbib}

\makeatletter

\special{papersize=\the\paperwidth,\the\paperheight}

%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}

\newcommand\mycite[1]{% with Numbers 
\citeauthor{#1}~(\citeyear{#1})\@
}
%%%%%Here is the command to be tried out.
\renewcommand\@biblabel[1]{}
%%%%%%%%%%%%End of Jerome's custom area
\makeatother

\begin{document}

\vspace{0.6cm}

\title{Test Document}

\author{Me}

%
\date{2 December, 2014}
%

\maketitle

\section{Testing Citations}

As he said, \mycite{ECTA:ECTA438}, we need to be clear on testing. Also, \mycite{RefWorks:14} will play a role. When we now add \mycite{RefWorks:12}.

\section{Introduction}

Hello Intro.

\bibliographystyle{ecta}

\bibliography{bibo}{}

\end{document}

附有参考书目文件:

@article{RefWorks:12,
    Abstract = {Abstract.},
    Author = {Sophocles Mavroeidis and Mikkel Plagborg-M{\o}ller and James H. Stock},
    Date-Modified = {2015-01-14 22:54:50 +0000},
    Journal = {Journal of Economic Literature},
    Number = {1},
    Pages = {124-188},
    Title = {Empirical evidence on inflation expectations in the New Keynesian Phillips Curve},
    Volume = {52},
    Year = {2014}
}
@article{RefWorks:14,
    Abstract = {Abstract.},
    Author = {Kang Yong Tan and David Vines},
    Date-Modified = {2015-01-15 13:45:29 +0000},
    Journal = {Available at SSRN 1026339},
    Title = {Woodford goes to Africa},
    Year = {2007}}
@article{ECTA:ECTA438,
    Abstract = {Abstract},
    Author = {Moreira, Marcelo J.},
    Date-Added = {2015-01-14 22:57:58 +0000},
    Date-Modified = {2015-01-14 22:57:58 +0000},
    Doi = {10.1111/1468-0262.00438},
    Issn = {1468-0262},
    Journal = {Econometrica},
    Keywords = {Instruments, similar tests, Wald test, score test, likelihood ratio test, confidence regions, 2SLS estimator, LIML estimator},
    Number = {4},
    Pages = {1027--1048},
    Publisher = {Blackwell Publishing Ltd},
    Title = {A Conditional Likelihood Ratio Test for Structural Models},
    Url = {http://dx.doi.org/10.1111/1468-0262.00438},
    Volume = {71},
    Year = {2003}}

答案1

您可以使用etoolbox包进行修补\NAT@thebibliography并进行方便的重新定义\@biblabel(我在这里假设您想抑制 bib 项目的标签,正如您在其他问题中所要求的那样):

\usepackage{etoolbox}

\makeatletter
\renewcommand\@biblabel[1]{\hspace*{\labelwidth}}
\apptocmd{\NAT@thebibliography}{\setlength\itemindent{-25pt}}{}{}
\makeatother

完整示例:

\documentclass[aps,superscriptaddress,nofootinbib]{revtex4}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\usepackage{mathtools}
\usepackage{natbib}
\usepackage{etoolbox}

\makeatletter
\special{papersize=\the\paperwidth,\the\paperheight}
\providecommand{\tabularnewline}{\\}
\newcommand\mycite[1]{% with Numbers 
\citeauthor{#1}~(\citeyear{#1})\@
}
\renewcommand\@biblabel[1]{\hspace*{\labelwidth}}
\apptocmd{\NAT@thebibliography}{\setlength\itemindent{-25pt}}{}{}
\makeatother

\begin{document}

\title{Test Document}
\author{Me}
\date{2 December, 2014}
\maketitle

\section{Testing Citations}

As he said, \mycite{ECTA:ECTA438}, we need to be clear on testing. Also, \mycite{RefWorks:14} will play a role. When we now add \mycite{RefWorks:12}.

\section{Introduction}

Hello Intro.

\bibliographystyle{ecta}
\bibliography{bibo}

\end{document}

这是输出(我在你的问题中使用了 .bib 文件):

在此处输入图片描述

相关内容