You'll need to hack your .bst
file a bit. See https://gist.github.com/moewew/ac72ac1c5194b146afb5ba5f6b55f928/revisions, the diff is
--- test-companion.bst 2018-06-26 10:08:57.485028100 +0200
+++ test-companion.bst 2018-06-26 09:52:36.723647200 +0200
@@ -683,16 +683,26 @@
if$
}
-FUNCTION {format.edition}
+FUNCTION {format.superedition}
{ edition duplicate$ empty$
+ { pop$ "" }
+ { superscript }
+ if$
+}
+
+FUNCTION {format.edition}
+{ edition duplicate$ empty$ 'skip$
{
- pop$ ""
- }
- {
- superscript
+ output.state mid.sentence =
+ { "l" }
+ { "t" }
+ if$ change.case$
+ "edition" bibinfo.check
+ " " * bbl.edition *
}
if$
}
+
INTEGERS { multiresult }
FUNCTION {multi.page.check}
{ 't :=
@@ -931,7 +941,7 @@
if$
}
if$
- format.edition output
+ format.superedition swap$ write$
format.date "year" output.check
date.block
format.btitle "title" output.check
@@ -1294,6 +1304,12 @@
short.list
"("
*
+ edition duplicate$ empty$
+ short.list key field.or.null = or
+ { pop$ "" }
+ { "$^{" swap$ * "}$" * }
+ if$
+ *
year duplicate$ empty$
short.list key field.or.null = or
{ pop$ "" }
Additionally, you'll need to make sure that postnotes are recognised properly. The footnote detection is more idiomatic with a boolean/\if...
instead of a string variable.
\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[]{natbib}
\bibpunct[:\ ]{(}{)}{;}{a}{}{;}
\newif\ifinfootnote
\let\svfootnote\footnote
\renewcommand{\footnote}[2][\thefootnote]{%
\stepcounter{footnote}%
\svfootnote[#1]{\infootnotetrue#2}%
}
\makeatletter
\newcommand*{\rsacitenopost}[1]{\citeauthor{#1} (\citeyear{#1})}
\newcommand*{\rsacitepost}[2][]{\citeauthor{#2} (\citeyear{#2}\ifinfootnote) #1\else, #1)\fi}
\renewcommand*{\citet}{%
\@ifnextchar[%]
{\rsacitepost}
{\rsacitenopost}}
\makeatother
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Alpha:2002,
Author = {Beta Alpha},
Note = {(= optional note)},
Publisher = {Chicago},
Title = {Book title},
Year = {2002},
edition = {2}}
@book{Gamma:2015,
editor = {Delta Gamma and Zeta Epsilon},
Publisher = {Berlin},
Title = {Another book},
Year = {2015}}
@article{Iota:1998,
Author = {Kappa Iota},
Journal = {journal name},
Volume = {24},
Pages = {11--18},
Title = {article title},
Year = {1998}}
@incollection{Ny:2018,
Author = {Lambda Ny},
Booktitle = {book title},
Editor = {E. Ditor},
Pages = {93--129},
Publisher = {London},
Title = {article title},
Year = {2018}}
\end{filecontents}
\begin{document}
Dies ist ein Testdokument zum Prüfen der bst-Datei.
\footnote{Cf. \citet[12]{Alpha:2002}.}
\footnote{Cf. \citet{Alpha:2002}.}
\citet{Alpha:2002};
\citet[13]{Gamma:2015};
\citet[14]{Iota:1998};
\citet[15]{Ny:2018}
\bibliographystyle{test-companion}
\bibliography{\jobname}
\end{document}

Normally I would suggest to use biblatex
for complex custom styles as these, but (1) even these days publishers can rarely accept biblatex
submissions (see Biblatex: submitting to a journal) - except if they take the PDF directly -, furthermore (2) you seem to have gotten quite far with BibTeX already and lastly (3) the combined editor/year brackets looks like it would need quite a bit of code restructuring (not impossible, but a lot of work).
For the fun of it, here is a suggestion for a biblatex
solution.
\documentclass[british]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{csquotes}
\usepackage[backend=biber, style=ext-authoryear, giveninits=true, uniquename=init, innamebeforetitle, articlein=false]{biblatex}
\renewcommand*{\newunitpunct}{\addcomma\space}
\DeclareNameAlias{sortname}{family-given}
\DeclareDelimFormat{multinamedelim}{\addslash}
\DeclareDelimAlias{finalnamedelim}{multinamedelim}
\DeclareDelimFormat[bib,biblist]{nametitledelim}{\addperiod\space}
\DeclareDelimFormat[bib,biblist]{innametitledelim}{\addcomma\space}
% this is tricky, we want to merge the round brackets around
% the "ed."/"eds." and the year
% the idea is to only open the brackets in the editor string
% and the close it in the labelyear
% since editortype might also be used for editors of @in...
% types where this can't happen, we need a test
\newtoggle{bbx@editor@sortname}
\makeatletter
\renewbibmacro*{bbx:editor}[1]{%
\ifboolexpr{
test \ifuseeditor
and
not test {\ifnameundef{editor}}
}
{\toggletrue{bbx@editor@sortname}%
\usebibmacro{bbx:dashcheck}
{\bibnamedash}
{\printnames{editor}%
\setunit{\printdelim{editortypedelim}}%
\usebibmacro{bbx:savehash}}%
\usebibmacro{#1}%
\clearname{editor}%
\setunit{\printdelim{nameyeardelim}}}%
{\global\undef\bbx@lasthash
\usebibmacro{labeltitle}%
\setunit*{\printdelim{nonameyeardelim}}}%
\usebibmacro{date+extradate}%
\togglefalse{bbx@editor@sortname}}
\makeatother
\DeclareFieldFormat{superedition}{\textsuperscript{#1}}
\DeclareFieldFormat{editortype}{%
\iftoggle{bbx@editor@sortname}
{\bibopenparen #1}
{\mkbibparens{#1}}}
\DeclareFieldFormat{biblabeldate}{%
\iftoggle{bbx@editor@sortname}
{\addcomma\space
\iffieldnum{edition}
{\printfield[superedition]{edition}%
\csgundef{abx@field@edition}}
{}%
#1\bibcloseparen}
{\mkbibparens{%
\iffieldnum{edition}
{\printfield[superedition]{edition}%
\csgundef{abx@field@edition}}
{}%
#1}}}
\DeclareDelimFormat{editortypedelim}{\addspace}
%% tricky bit END
\DeclareFieldFormat{translatortype}{\mkbibparens{#1}}
\DeclareDelimFormat{translatortypedelim}{\addspace}
\renewbibmacro*{pubinstorg+location+date}[1]{%
\setunit{\addperiod\space}%
\printlist{location}%
\iflistundef{#1}
{\setunit*{\locdatedelim}}
{\setunit*{\locpubdelim}}%
\printlist{#1}%
\setunit*{\pubdatedelim}%
\usebibmacro{date}%
\newunit}
\renewcommand*{\bibpagespunct}{\ifentrytype{article}{\addcolon}{\addperiod}\space}
\DeclareFieldFormat{pages}{#1}
% some trickery is needed to get the parentheses right
% but biblatex already has a toggle to check for footnotes
\newtoggle{cbx:rsaparens}
\newbibmacro*{rsacite}{%
\iffieldundef{shorthand}
{\ifthenelse{\ifnameundef{labelname}\OR\iffieldundef{labelyear}}
{\usebibmacro{cite:label}%
\setunit{\printdelim{nonameyeardelim}%
\global\toggletrue{cbx:rsaparens}%
\bibopenparen}}
{\printnames{labelname}%
\setunit{\printdelim{nameyeardelim}%
\global\toggletrue{cbx:rsaparens}%
\bibopenparen}}%
\usebibmacro{rsacite:labeldate+extradate}}
{\usebibmacro{cite:shorthand}}}
\newbibmacro*{rsacite:labeldate+extradate}{%
\iffieldundef{labelyear}
{}
{\printtext[bibhyperref]{%
\iffieldnum{edition}
{\printfield[superedition]{edition}}
{}%
\printlabeldateextra}}}
\newbibmacro*{rsacite:postnote}{%
\iftoggle{blx@footnote}
{\iftoggle{cbx:rsaparens}
{\global\togglefalse{cbx:rsaparens}%
\bibcloseparen}
{}}
{}%
\iffieldundef{postnote}
{}
{\iftoggle{cbx:rsaparens}
{\setunit{\postnotedelim}}
{\setunit{\extpostnotedelim}}%
\printfield{postnote}}%
\iftoggle{cbx:rsaparens}
{\global\togglefalse{cbx:rsaparens}%
\bibcloseparen}
{}}
\RegisterCiteDelims{outer}{rsacite}
\DeclareCiteCommand{\rsacite}[\mkouterrsacitedelims]
{\usebibmacro{prenote}}
{\usebibmacro{citeindex}%
\usebibmacro{rsacite}}
{\iftoggle{cbx:rsaparens}
{\global\togglefalse{cbx:rsaparens}%
\bibcloseparen}
{}%
\multicitedelim}
{\usebibmacro{rsacite:postnote}}
\DeclareMultiCiteCommand{\rsacites}[\mkouterrsacitedelims]
{\rsacite}{\multicitedelim}
\DeclareAutoCiteCommand{rsa}{\rsacite}{\rsacites}
\ExecuteBibliographyOptions{autocite=rsa}
\DeclareFieldFormat{postnote}{\mknormrange{#1}}
\DeclareFieldFormat{volcitepages}{\mknormrange{#1}}
\DeclareFieldFormat{multipostnote}{\mknormrange{#1}}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Alpha:2002,
Author = {Beta Alpha},
Note = {(= optional note)},
Publisher = {Chicago},
Title = {Book title},
Year = {2002},
edition = {2}}
@book{Gamma:2015,
editor = {Delta Gamma and Zeta Epsilon},
Publisher = {Berlin},
Title = {Another book},
Year = {2015}}
@article{Iota:1998,
Author = {Kappa Iota},
Journal = {journal name},
Volume = {24},
Pages = {11--18},
Title = {article title},
Year = {1998}}
@incollection{Ny:2018,
Author = {Lambda Ny},
Booktitle = {book title},
Editor = {E. Ditor},
Pages = {93--129},
Publisher = {London},
Title = {article title},
Year = {2018}}
\end{filecontents}
\addbibresource{\jobname.bib}
\addbibresource{biblatex-examples.bib}
\begin{document}
Lorem\footnote{\autocite[Cf.][12]{Alpha:2002}.}
ipsum\footnote{\autocite[Cf.][]{Alpha:2002}.}
dolor\footnote{\autocites(Cf.)()[12]{Alpha:2002}[380]{sigfridsson}.}
sit\footnote{\autocite[Cf.][]{Alpha:2002,sigfridsson}.}
amet.
\autocite[12]{sigfridsson,worman}
\autocites[12]{sigfridsson}[13]{worman}
\autocite{Alpha:2002};
\autocite[13]{Gamma:2015}
\autocite[14]{Iota:1998};
\autocite[15]{Ny:2018}
\cite{sigfridsson}
\printbibliography
\end{document}

.bst
file to file pasting website such as pastebin.com or 0bin.net or gist.github.com. Please do not upload it to a file sharing website where the file has to be downloaded (additional minus points for packing it into a.zip
).biblatex
solution would also be possible but I serisously doubt that your prublisher can acceptbiblatex
submissions. See tex.stackexchange.com/q/12175/35864 and the recent tex.stackexchange.com/q/436554/35864, tex.stackexchange.com/q/435658/35864 for two examples of people who could not submitbiblatex
bibliographies.