\citeauthor 在 \documentclass{cta-author}

\citeauthor 在 \documentclass{cta-author}

我用的\documentclass{article}

\usepackage[backend=biber,
    natbib=true,
    style=ieee,
    citestyle=numeric-comp,
    sorting=none,
    doi=false,
    isbn=false,
    url=true,
    %           minnames=1, % used for setting both minbibnames & mincitenames at a time
    %           maxnames=2,
    mincitenames=1, % used for setting min number of author names in text area
    maxcitenames=1,
    %           minbibnames=1,  % used for setting min number of author names in biblography/reference area
    %           maxbibenames=1,
    urldate=long,   %year(2016), short(08/30/2016), long(Aug. 30, 2016), terse(08/30/2016), comp(Aug. 30, 2016), iso8601(2016-08-30)
]{biblatex}

给出第一作者的姓氏,然后取决于作者的数量\citeauthor

现在我需要将文档类更改为:cta-author,对于IET。这里我只能使用上述设置(甚至不能包含natbib)。MnWE 如下所示:

\documentclass{cta-author}
    \begin{document}
        \citeauthor{lesk:1977}

    \bibliographystyle{iet}
    \bibliography{refs}
\end{document}

refs.bib 文件取自这里

@book{latex2e,
  author = {Leslie Lamport},
  year = {1994},
  title = {\LaTeX: a Document Preparation System},
  publisher = {Addison Wesley},
  address = {Massachusetts},
  edition = {2}
}

@article{knuth:1984,
  title={Literate Programming},
  author={Donald E. Knuth},
  journal={The Computer Journal},
  volume={27},
  number={2},
  pages={97--111},
  year={1984},
  publisher={Oxford University Press}
}

@inproceedings{lesk:1977,
  title={Computer Typesetting of Technical Journals on {UNIX}},
  author={Michael Lesk and Brian Kernighan},
  booktitle={Proceedings of American Federation of
             Information Processing Societies: 1977
             National Computer Conference},
  pages={879--888},
  year={1977},
  address={Dallas, Texas}
}

问:如何获得\citeauthor像在课堂上一样的行为article

IET Latex 模板直接下载链接iet.bst 文件

答案1

由于类加载natbib与 不兼容biblatex。此外,提交过程需要thebibliography从粘贴.bbl,这意味着biblatex肯定是不可能的。

由于natbib\citeauthor支持仅取决于所.bst使用的样式,因此可以通过破解iet.bst来获得您想要的东西。提交时,您将替换以下两行

\bibliographystyle{iet}
\bibliography{refs}

并附有文件内容的副本.bbl,这样破解该文件不会造成额外的技术复杂性.bst

您需要意识到,尽管\citeauthor以下内容有效,但在文件提交给期刊时,它可能无法按预期工作。出版商通常有一个将 LaTeX 文档转换为他们自己的专有格式的工作流程。\citeauthor可能不属于他们期望的命令,因此此时可能会出错。

由于版权和篇幅原因,我不太愿意.bst在此提供整个文件。以下是与iet.bst(文件日期 2012-10-05,: sha256sum)不同的补丁56decf42e3f5cec42cb9f311b6abc868827dc7ccf9ac8e6d93273984dd25e2e1,包含在http://digital-library.theiet.org/files/IET_ResearchJournals_latex.zip

该补丁还包含以下人员建议的修复米科如何修改此 .bst 文件的引用和数据库条目以供继续讨论?

作者年份兼容性代码natbib以简化形式取自 Patrick W. Daly 的plainnat.bst

--- iet.bst 2012-10-05 13:31:53.790000000 +0200
+++ iet-ay.bst  2018-07-05 13:50:00.796440800 +0200
@@ -1,3 +1,9 @@
+% iet-ay.bst
+% 2018-07-05
+% modified following Mico's suggestion in
+% https://tex.stackexchange.com/a/346287/35864
+% and additionally for author-year citation support for
+% https://tex.stackexchange.com/q/439309/35864
 ENTRY
   { address
     assignee     % for patents
@@ -34,7 +40,7 @@
     updated % urlbst
   }
   {}
-  { label }
+  { label short.list }
 %% Declaration of integer variables
 INTEGERS { output.state before.all mid.sentence after.sentence after.block }
 STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl } % urlbst...
@@ -555,7 +561,7 @@
 { "in" }

 FUNCTION {bbl.pages}
-{ "pp.~" }
+{ "pp." }

 FUNCTION {bbl.page}
 { "p." }
@@ -889,10 +895,65 @@
   if$
 }

+FUNCTION {format.lab.names}
+{ 's :=
+  s #1 "{vv~}{ll}" format.name$
+  s num.names$
+  #1 >
+    { " et~al." * }
+    'skip$
+  if$
+}
+
+FUNCTION {author.key.label}
+{ author empty$
+    { key empty$
+        { cite$ #1 #3 substring$ }
+        'key
+      if$
+    }
+    { author format.lab.names }
+  if$
+}
+
+FUNCTION {author.editor.key.label}
+{ author empty$
+    { editor empty$
+        { key empty$
+            { cite$ #1 #3 substring$ }
+            'key
+          if$
+        }
+        { editor format.lab.names }
+      if$
+    }
+    { author format.lab.names }
+  if$
+}
+
+FUNCTION {calc.label}
+{ author.editor.key.label 'short.list :=
+  short.list
+  "("
+  *
+  year duplicate$ empty$
+  short.list key field.or.null = or
+     { pop$ "" }
+     'skip$
+  if$
+  *
+  ")"
+  *
+  'label :=
+}
+
 FUNCTION {output.bibitem}
-{ outside.brackets 'bracket.state := % urlbst
+{ calc.label
+  outside.brackets 'bracket.state := % urlbst
    newline$
-  "\bibitem{" write$
+  "\bibitem["  write$
+  label  write$
+  "]{" write$
   cite$ write$
   "}" write$
   newline$
@@ -1503,7 +1564,7 @@
     %%{ inbrackets type output }
   if$
   format.publisher.address output
-  format.date "year" output.check
+  format.date "year" output.check ")" *
   new.block
   format.note output
   new.block
@@ -1595,7 +1656,7 @@
   format.edition output
   new.sentence
   format.publisher.address output
-  format.date "year" output.check
+  format.date "year" output.check ")" *
   format.btitle "title" output.check
   add.semicolon
   add.blank
@@ -1618,7 +1679,7 @@
   new.sentence
   format.number.series output
   format.publisher.address output
-  format.date "year" output.check
+  format.date "year" output.check ")" *
   date.block
   add.blank
   format.pages "pages" output.check
@@ -1640,7 +1701,7 @@
   new.sentence
   format.number.series output
   format.publisher.address output
-  format.date "year" output.check
+  format.date "year" output.check ")" *
   date.block
   add.blank
   format.pages "pages" output.check
@@ -1666,7 +1727,7 @@
       format.publisher.address output
     }
   if$
-  format.date "year" output.check
+  format.date "year" output.check ")" *
   date.block
   add.blank
   format.pages "pages" output.check
@@ -1734,7 +1795,7 @@
       if$
      }
   if$
-      format.date "year" output.check
+      format.date "year" output.check ")" *
   new.block
   format.note output
   output.web.refs  % urlbst
@@ -1765,7 +1826,7 @@
   "title" output.check
   format.type "type" output.check
   new.block
-  format.publisher.address output
+  format.publisher.address output ")" *
   format.date "year" output.check
   new.block
   format.note output

使用新的iet-ay.bstMWE

\documentclass{cta-author}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{latex2e,
  author    = {Leslie Lamport},
  year      = {1994},
  title     = {\LaTeX: a Document Preparation System},
  publisher = {Addison Wesley},
  address   = {Massachusetts},
  edition   = {2}
}

@article{knuth:1984,
  title     = {Literate Programming},
  author    = {Donald E. Knuth},
  journal   = {The Computer Journal},
  volume    = {27},
  number    = {2},
  pages     = {97--111},
  year      = {1984},
  publisher = {Oxford University Press}
}

@inproceedings{lesk:1977,
  title     = {Computer Typesetting of Technical Journals on {UNIX}},
  author    = {Michael Lesk and Brian Kernighan},
  booktitle = {Proceedings of American Federation of
               Information Processing Societies: 1977
               National Computer Conference},
  pages     = {879--888},
  year      = {1977},
  address   = {Dallas, Texas}
}

@book{companion,
  author       = {Goossens, Michel and Mittelbach, Frank and Samarin, Alexander},
  title        = {The {LaTeX} Companion},
  year         = 1994,
  edition      = 1,
  publisher    = {Addison-Wesley},
  address      = {Reading, Mass.},
}
\end{filecontents}

\begin{document}
  \citeauthor{lesk:1977}

  \citeauthor{knuth:1984}

  \citeauthor{latex2e}

  \citeauthor{companion}

  \bibliographystyle{iet-ay}
  \bibliography{\jobname}
\end{document}

给出

在此处输入图片描述

相关内容