0

I was using \documentclass{article}with

\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}

Which gives the last name of the first author and then et al. depending on the number of authors for \citeauthor.

Now I need to change the document class to: cta-author, for IET. Here I am restricted to use above settings (even not able to include natbib). MnWE is given below:

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

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

The refs.bib file is taken from here

@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}
}

Q: How to get \citeauthor behaviour as in article class?

IET Latex template direct download link, iet.bst file

  • Where can we get iet.bst and cta-author? (Is it the same as tex.stackexchange.com/q/346204/35864?) – moewe Jul 5 '18 at 7:06
  • Probably yes, for convenience I added the direct link. – Mr.EU Jul 5 '18 at 7:10
  • Usually I would recommend you try usebib, but I'm not sure that bibentry parses names as required and depending on the submission procedure it might not be usable. – moewe Jul 5 '18 at 7:11
  • 1
    Good news is that the class uses natbib and that theoretically we could modify the .bst file in a way to allow for \citeauthor to work. I don't have time right now and maybe Mico steps up to the challenge, but if he doesn't I'll have a look at this later. Can't promise anything though. – moewe Jul 5 '18 at 7:20
  • 1
    Ah, I had found that earlier, but I had problems opening that .zip with Windows' built-in .zip utility, it worked with Peazip. – moewe Jul 5 '18 at 11:22
1

Since the class loads natbib it is incompatible with biblatex. Additionally, the submission process required a pasted thebibliography from the .bbl, that means biblatex is quite definitely out of the question.

Since natbib's \citeauthor support depends only on the .bst style used, it is possible to hack iet.bst to get what you want. For submission you will replace the two lines

\bibliographystyle{iet}
\bibliography{refs}

with a copy of the contents of the .bbl file, so it does not cause additional technical complications to hack the .bst file.

You need to be aware of the possibility that even though \citeauthor works in the following it might not work as expected when the file is submitted to the journal. Publisher usually have a workflow to convert LaTeX documents into their own proprietary format. \citeauthor is probably not amongst the commands they expect, so it could go wrong at this point.

For copyright and length reasons I don't feel comfortable providing the .bst file here in its entirety. The following is the patch diff to the iet.bst (file date 2012-10-05, sha256sum: 56decf42e3f5cec42cb9f311b6abc868827dc7ccf9ac8e6d93273984dd25e2e1) contained in http://digital-library.theiet.org/files/IET_ResearchJournals_latex.zip.

The patch also includes the fixes suggested by Mico in How to modify citation and database entry for conf. proceeding with this .bst?.

The code for natbib author-year compatibility was taken in simplified form from Patrick W. Daly's 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

Using the new iet-ay.bst the MWE

\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}

gives

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.