EnDashで引用

Oct 31 2020

Newey and West (1987)の推定量ではなく、Newey–West(1987)の推定を次のように書く必要がある場合があります。

\documentclass{article}

\usepackage{filecontents,natbib}
\begin{filecontents}{z.bib}
@article{newey1987simple,
  title={A Simple, Positive Semi-Definite, Heteroskedasticity and Autocorrelation},
  author={Newey, Whitney K and West, Kenneth D},
  journal={Econometrica},
  volume={55},
  number={3},
  pages={703--708},
  year={1987}
}
\end{filecontents}
\bibliographystyle{apalike}

\begin{document}

\citeauthor{newey1987simple}'s \citeyearpar{newey1987simple} estimator.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Newey--West (1987) estimator.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\bibliography{z}

\end{document}

このように、著者名がダッシュでつながっている論文を引用できますか?

回答

3 moewe Oct 31 2020 at 18:54

参考文献スタイルがカスタマイズ可能な名前区切り文字をサポートしている場合、これはこの区切り文字をローカルで変更するのと同じくらい簡単です。残念ながら、すべての.bstファイルがカスタマイズ可能な名前区切り文字をサポートしているわけではなく、多くのファイルは「and」をハードコーディングするだけです。

ステップ1はapalike、引用でカスタマイズ可能な区切り文字を使用することです。この目的を達成するために

  1. apalike.bstマシン上で見つけます。これを行うkpsewhich apalike.bstには、コマンドライン/ターミナルに入力します。または、CTANからファイルのコピーを入手しますhttp://mirrors.ctan.org/biblio/bibtex/base/apalike.bst

  2. TeXが見つけることができる場所にファイルをコピーします。ドキュメントディレクトリは問題なく動作します。も参照してくださいhttps://texfaq.org/FAQ-inst-wlcf

  3. ファイルの名前を次のように変更しますapalike-namedelim.bst(のライセンスでapalike.bstは、ファイルを変更する場合は名前を変更する必要があります)

  4. FUNCTION {format.lab.names}(ll。841-587)を見つけて、完全な関数定義を次のように置き換えます。

     FUNCTION {format.lab.names}
     { 's :=
       s #1 "{vv~}{ll}" format.name$ s num.names$ duplicate$ #2 > { pop$ " et~al." * }
         { #2 <
             'skip$ { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
                 { " et~al." * }
                 { "\finalnamedelim " * s #2 "{vv~}{ll}" format.name$ * } if$
             }
           if$ } if$
     }
    
  5. ファイルの先頭に、名前、現在の日付、変更の簡単な説明を含むコメントを追加します。

  6. ドキュメントの\bibliographystyle{apalike-namedelim}代わりに使用\bibliographystyle{apalike}します。

手順1〜5の代わりに、パッチを適用したバージョンのファイルを次のURLで入手できます。 https://gist.github.com/moewew/1808df0569958a79ce5058b133495260

ステップ2は、ダッシュで引用する目的で定義する新しいコマンドでカスタマイズ可能なマクロを利用することです。の定義\citet\citeauthorからの定義をコピーし、natbib.sty変更するコードを挿入するだけです\finalnamedelim

\documentclass{article}

\usepackage{natbib}
\bibliographystyle{apalike-namedelim}

\newcommand*{\finalnamedelim}{}
\DeclareRobustCommand*{\finalnamedelim}{ and }

\makeatletter
\newcommand*{\citetattr}{}
\DeclareRobustCommand\citetattr
   {\begingroup
    \DeclareRobustCommand*{\finalnamedelim}{--}%
    \NAT@swafalse\let\NAT@ctype\z@\NAT@partrue
     \@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
     
\newcommand*{\citeauthorattr}{}
\DeclareRobustCommand\citeauthorattr
   {\begingroup
    \DeclareRobustCommand*{\finalnamedelim}{--}%
    \NAT@swafalse\let\NAT@ctype\@ne\NAT@parfalse
    \@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}

\newcommand*{\Citetattr}{}
\DeclareRobustCommand\Citetattr
   {\begingroup
    \DeclareRobustCommand*{\finalnamedelim}{--}%
    \NAT@swafalse\let\NAT@ctype\z@\NAT@partrue
     \let\NAT@up\NAT@Up
     \@ifstar{\NAT@fulltrue\NAT@citetp}{\NAT@fullfalse\NAT@citetp}}
\makeatother

\begin{filecontents}{\jobname.bib}
@article{newey1987simple,
  title   = {A Simple, Positive Semi-Definite, Heteroskedasticity 
             and Autocorrelation Consistent Covariance Matrix},
  author  = {Newey, Whitney K. and West, Kenneth D.},
  journal = {Econometrica},
  volume  = 55,
  number  = 3,
  pages   = {703--708},
  year    = 1987,
}
\end{filecontents}

\begin{document}
\citeauthor{newey1987simple}'s \citeyearpar{newey1987simple} estimator.

\citetattr{newey1987simple} --- with citation alias

\bibliography{\jobname}
\end{document}


これらの種類のものは、を使用すると少し簡単になりbiblatexます。

\documentclass[british]{article}

\usepackage{babel}
\usepackage{csquotes}
\usepackage[style=authoryear]{biblatex}

\newcommand*{\textattrcite}{%
  \AtNextCite{\AtEachCitekey{\delimcontext{textattrcite}}}%
  \textcite}

\DeclareDelimFormat[textattrcite]{multinamedelim}{\textendash}
\DeclareDelimAlias[textattrcite]{finalnamedelim}[textattrcite]{multinamedelim}

\begin{filecontents}{\jobname.bib}
@article{newey1987simple,
  title   = {A Simple, Positive Semi-Definite, Heteroskedasticity 
             and Autocorrelation Consistent Covariance Matrix},
  author  = {Newey, Whitney K. and West, Kenneth D.},
  journal = {Econometrica},
  volume  = 55,
  number  = 3,
  pages   = {703--708},
  year    = 1987,
}
\end{filecontents}
\addbibresource{\jobname.bib}

\begin{document}
\citeauthor{newey1987simple}'s \parencite*{newey1987simple} estimator.

\textattrcite{newey1987simple} --- with citation alias

\printbibliography
\end{document}
2 Mico Oct 31 2020 at 18:25

あなたが採用しているのでnatbib、引用管理パッケージを、あなたは、その使用することができる\defcitealias\citetaliasあなたの書式設定の目的を達成するためのマクロを。

\documentclass{article}

\begin{filecontents}[overwrite]{z.bib}
@article{newey1987simple,
  title  ={A Simple, Positive Semi-Definite, Heteroskedasticity 
           and Autocorrelation Consistent Covariance Matrix},
  author ={Newey, Whitney K. and West, Kenneth D.},
  journal={Econometrica},
  volume =55,
  number =3,
  pages  ={703--708},
  year   =1987,
}
\end{filecontents}

\usepackage{natbib}
\defcitealias{newey1987simple}{Newey--West (1987)}
\bibliographystyle{apalike}

\begin{document}
\setlength\parindent{0pt} % just for this example

\citeauthor{newey1987simple}'s \citeyearpar{newey1987simple} estimator.

\citetalias{newey1987simple} --- with citation alias

Newey--West (1987) --- brute force

\bibliography{z}
\end{document}