Modify bst file so that 2 authors are separated by “and” in the text
I have to work with a custom .bst file for a paper. When I have exactly two authors for a reference, these authors are separated in text with " , ".
So e.g. (Simonyan , Zisserman, 2014). I want it to be (Simonyan and Zisserman, 2014).
In my bibliography the style is correct.
So, is it necessary to change the .bst file?
I think here are the relevant lines:
INTEGERS { nameptr namesleft numnames }
FUNCTION {format.names}
{ 's :=
'f :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ s nameptr f format.name$ 't :=
nameptr #1 >
{ namesleft #1 >
{ ", " * t * }
{ t "others" =
{ " et~al." * }
{ ", " * t * }
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
}
FUNCTION {format.authors}
{ author empty$
{ "" }
{ "{vv~}{ll}{, jj}{, f.}" author format.names }
if$
}
citing custom-bib
add a comment |
I have to work with a custom .bst file for a paper. When I have exactly two authors for a reference, these authors are separated in text with " , ".
So e.g. (Simonyan , Zisserman, 2014). I want it to be (Simonyan and Zisserman, 2014).
In my bibliography the style is correct.
So, is it necessary to change the .bst file?
I think here are the relevant lines:
INTEGERS { nameptr namesleft numnames }
FUNCTION {format.names}
{ 's :=
'f :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ s nameptr f format.name$ 't :=
nameptr #1 >
{ namesleft #1 >
{ ", " * t * }
{ t "others" =
{ " et~al." * }
{ ", " * t * }
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
}
FUNCTION {format.authors}
{ author empty$
{ "" }
{ "{vv~}{ll}{, jj}{, f.}" author format.names }
if$
}
citing custom-bib
It is quite likely that you would have to change the.bststyle, yes (though I think there are some styles that use user-definable macros that could be changed in the.texfile directly, I don't think this style is one of them). I must admit that I rarely get things right the first time when I play around with.bstfiles and so it would help me greatly if you could provide the entire.bstfile (it is probably too large to fit here, so upload it to a text sharing site like pastebin.com or gist.github.com) and a short test file (.texand.bib).
– moewe
Feb 21 at 9:08
It is the recent ISPRS template. All files can be found on: isprs.org/documents/orangebook/app5.aspx The template has been modified recently and is now inconsistent (the point I mentioned can be seen in 3.5.8) with the MS Word template. The deadline of my paper is quite soon and I cannot wait until there is an update. Nonetheless, I don't want to switch to Word ;). The function format.names begins at line 158.
– Grillteller
Feb 21 at 9:18
FWIW I think it should help to turn the second occurrence of{ ", " * t * }into{ " and " * t * }but I could be wrong.
– moewe
Feb 21 at 9:19
Nope, just looked at the.bstit should be a different place. Hang on a sec...
– moewe
Feb 21 at 9:23
Tested it. That changed the last author of a reference in the bibliography to be separated with an "and" and not a comma. Nice to know :)
– Grillteller
Feb 21 at 9:23
add a comment |
I have to work with a custom .bst file for a paper. When I have exactly two authors for a reference, these authors are separated in text with " , ".
So e.g. (Simonyan , Zisserman, 2014). I want it to be (Simonyan and Zisserman, 2014).
In my bibliography the style is correct.
So, is it necessary to change the .bst file?
I think here are the relevant lines:
INTEGERS { nameptr namesleft numnames }
FUNCTION {format.names}
{ 's :=
'f :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ s nameptr f format.name$ 't :=
nameptr #1 >
{ namesleft #1 >
{ ", " * t * }
{ t "others" =
{ " et~al." * }
{ ", " * t * }
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
}
FUNCTION {format.authors}
{ author empty$
{ "" }
{ "{vv~}{ll}{, jj}{, f.}" author format.names }
if$
}
citing custom-bib
I have to work with a custom .bst file for a paper. When I have exactly two authors for a reference, these authors are separated in text with " , ".
So e.g. (Simonyan , Zisserman, 2014). I want it to be (Simonyan and Zisserman, 2014).
In my bibliography the style is correct.
So, is it necessary to change the .bst file?
I think here are the relevant lines:
INTEGERS { nameptr namesleft numnames }
FUNCTION {format.names}
{ 's :=
'f :=
#1 'nameptr :=
s num.names$ 'numnames :=
numnames 'namesleft :=
{ namesleft #0 > }
{ s nameptr f format.name$ 't :=
nameptr #1 >
{ namesleft #1 >
{ ", " * t * }
{ t "others" =
{ " et~al." * }
{ ", " * t * }
if$
}
if$
}
't
if$
nameptr #1 + 'nameptr :=
namesleft #1 - 'namesleft :=
}
while$
}
FUNCTION {format.authors}
{ author empty$
{ "" }
{ "{vv~}{ll}{, jj}{, f.}" author format.names }
if$
}
citing custom-bib
citing custom-bib
asked Feb 21 at 9:00
GrilltellerGrillteller
32
32
It is quite likely that you would have to change the.bststyle, yes (though I think there are some styles that use user-definable macros that could be changed in the.texfile directly, I don't think this style is one of them). I must admit that I rarely get things right the first time when I play around with.bstfiles and so it would help me greatly if you could provide the entire.bstfile (it is probably too large to fit here, so upload it to a text sharing site like pastebin.com or gist.github.com) and a short test file (.texand.bib).
– moewe
Feb 21 at 9:08
It is the recent ISPRS template. All files can be found on: isprs.org/documents/orangebook/app5.aspx The template has been modified recently and is now inconsistent (the point I mentioned can be seen in 3.5.8) with the MS Word template. The deadline of my paper is quite soon and I cannot wait until there is an update. Nonetheless, I don't want to switch to Word ;). The function format.names begins at line 158.
– Grillteller
Feb 21 at 9:18
FWIW I think it should help to turn the second occurrence of{ ", " * t * }into{ " and " * t * }but I could be wrong.
– moewe
Feb 21 at 9:19
Nope, just looked at the.bstit should be a different place. Hang on a sec...
– moewe
Feb 21 at 9:23
Tested it. That changed the last author of a reference in the bibliography to be separated with an "and" and not a comma. Nice to know :)
– Grillteller
Feb 21 at 9:23
add a comment |
It is quite likely that you would have to change the.bststyle, yes (though I think there are some styles that use user-definable macros that could be changed in the.texfile directly, I don't think this style is one of them). I must admit that I rarely get things right the first time when I play around with.bstfiles and so it would help me greatly if you could provide the entire.bstfile (it is probably too large to fit here, so upload it to a text sharing site like pastebin.com or gist.github.com) and a short test file (.texand.bib).
– moewe
Feb 21 at 9:08
It is the recent ISPRS template. All files can be found on: isprs.org/documents/orangebook/app5.aspx The template has been modified recently and is now inconsistent (the point I mentioned can be seen in 3.5.8) with the MS Word template. The deadline of my paper is quite soon and I cannot wait until there is an update. Nonetheless, I don't want to switch to Word ;). The function format.names begins at line 158.
– Grillteller
Feb 21 at 9:18
FWIW I think it should help to turn the second occurrence of{ ", " * t * }into{ " and " * t * }but I could be wrong.
– moewe
Feb 21 at 9:19
Nope, just looked at the.bstit should be a different place. Hang on a sec...
– moewe
Feb 21 at 9:23
Tested it. That changed the last author of a reference in the bibliography to be separated with an "and" and not a comma. Nice to know :)
– Grillteller
Feb 21 at 9:23
It is quite likely that you would have to change the
.bst style, yes (though I think there are some styles that use user-definable macros that could be changed in the .tex file directly, I don't think this style is one of them). I must admit that I rarely get things right the first time when I play around with .bst files and so it would help me greatly if you could provide the entire .bst file (it is probably too large to fit here, so upload it to a text sharing site like pastebin.com or gist.github.com) and a short test file (.tex and .bib).– moewe
Feb 21 at 9:08
It is quite likely that you would have to change the
.bst style, yes (though I think there are some styles that use user-definable macros that could be changed in the .tex file directly, I don't think this style is one of them). I must admit that I rarely get things right the first time when I play around with .bst files and so it would help me greatly if you could provide the entire .bst file (it is probably too large to fit here, so upload it to a text sharing site like pastebin.com or gist.github.com) and a short test file (.tex and .bib).– moewe
Feb 21 at 9:08
It is the recent ISPRS template. All files can be found on: isprs.org/documents/orangebook/app5.aspx The template has been modified recently and is now inconsistent (the point I mentioned can be seen in 3.5.8) with the MS Word template. The deadline of my paper is quite soon and I cannot wait until there is an update. Nonetheless, I don't want to switch to Word ;). The function format.names begins at line 158.
– Grillteller
Feb 21 at 9:18
It is the recent ISPRS template. All files can be found on: isprs.org/documents/orangebook/app5.aspx The template has been modified recently and is now inconsistent (the point I mentioned can be seen in 3.5.8) with the MS Word template. The deadline of my paper is quite soon and I cannot wait until there is an update. Nonetheless, I don't want to switch to Word ;). The function format.names begins at line 158.
– Grillteller
Feb 21 at 9:18
FWIW I think it should help to turn the second occurrence of
{ ", " * t * } into { " and " * t * } but I could be wrong.– moewe
Feb 21 at 9:19
FWIW I think it should help to turn the second occurrence of
{ ", " * t * } into { " and " * t * } but I could be wrong.– moewe
Feb 21 at 9:19
Nope, just looked at the
.bst it should be a different place. Hang on a sec...– moewe
Feb 21 at 9:23
Nope, just looked at the
.bst it should be a different place. Hang on a sec...– moewe
Feb 21 at 9:23
Tested it. That changed the last author of a reference in the bibliography to be separated with an "and" and not a comma. Nice to know :)
– Grillteller
Feb 21 at 9:23
Tested it. That changed the last author of a reference in the bibliography to be separated with an "and" and not a comma. Nice to know :)
– Grillteller
Feb 21 at 9:23
add a comment |
1 Answer
1
active
oldest
votes
The relevant macro is format.lab.names.abbr. For the "and" it has to read
FUNCTION {format.lab.names.abbr}
{ 's :=
s num.names$ 'numnames :=
numnames #1 >
{ numnames #2 >
{ s #1 "{vv~}{ll}" format.name$ " et al." * }
{ s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
{ s #1 "{vv~}{ll}" format.name$ " et al." * }
{ s #1 "{vv~}{ll}" format.name$ " and " *
s #2 "{vv~}{ll}" format.name$ *
}
if$
}
if$
}
{ s #1 "{vv~}{ll}" format.name$ }
if$
}
the change is in the second branch of the innermost conditional. The version of isprs.bst currently available at http://www.isprs.org/documents/orangebook/app5.aspx has
s #1 "{vv~}{ll}" format.name$ " , " * % replaced and with ,
there and we make it read
s #1 "{vv~}{ll}" format.name$ " and " *
again. Note their comment and the spurious whitespace before the comma.
Of course you should still report this issue to the maintainer of the template and you should not modify the .bst file directly. Only modify and renamed copy, isprs-and.bst say, and document the changes.
Yeah, I am already in contact with the new maintainer. Weird that there is that comment.... Thank you for helping this fast.
– Grillteller
Feb 21 at 9:36
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "85"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f475961%2fmodify-bst-file-so-that-2-authors-are-separated-by-and-in-the-text%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The relevant macro is format.lab.names.abbr. For the "and" it has to read
FUNCTION {format.lab.names.abbr}
{ 's :=
s num.names$ 'numnames :=
numnames #1 >
{ numnames #2 >
{ s #1 "{vv~}{ll}" format.name$ " et al." * }
{ s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
{ s #1 "{vv~}{ll}" format.name$ " et al." * }
{ s #1 "{vv~}{ll}" format.name$ " and " *
s #2 "{vv~}{ll}" format.name$ *
}
if$
}
if$
}
{ s #1 "{vv~}{ll}" format.name$ }
if$
}
the change is in the second branch of the innermost conditional. The version of isprs.bst currently available at http://www.isprs.org/documents/orangebook/app5.aspx has
s #1 "{vv~}{ll}" format.name$ " , " * % replaced and with ,
there and we make it read
s #1 "{vv~}{ll}" format.name$ " and " *
again. Note their comment and the spurious whitespace before the comma.
Of course you should still report this issue to the maintainer of the template and you should not modify the .bst file directly. Only modify and renamed copy, isprs-and.bst say, and document the changes.
Yeah, I am already in contact with the new maintainer. Weird that there is that comment.... Thank you for helping this fast.
– Grillteller
Feb 21 at 9:36
add a comment |
The relevant macro is format.lab.names.abbr. For the "and" it has to read
FUNCTION {format.lab.names.abbr}
{ 's :=
s num.names$ 'numnames :=
numnames #1 >
{ numnames #2 >
{ s #1 "{vv~}{ll}" format.name$ " et al." * }
{ s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
{ s #1 "{vv~}{ll}" format.name$ " et al." * }
{ s #1 "{vv~}{ll}" format.name$ " and " *
s #2 "{vv~}{ll}" format.name$ *
}
if$
}
if$
}
{ s #1 "{vv~}{ll}" format.name$ }
if$
}
the change is in the second branch of the innermost conditional. The version of isprs.bst currently available at http://www.isprs.org/documents/orangebook/app5.aspx has
s #1 "{vv~}{ll}" format.name$ " , " * % replaced and with ,
there and we make it read
s #1 "{vv~}{ll}" format.name$ " and " *
again. Note their comment and the spurious whitespace before the comma.
Of course you should still report this issue to the maintainer of the template and you should not modify the .bst file directly. Only modify and renamed copy, isprs-and.bst say, and document the changes.
Yeah, I am already in contact with the new maintainer. Weird that there is that comment.... Thank you for helping this fast.
– Grillteller
Feb 21 at 9:36
add a comment |
The relevant macro is format.lab.names.abbr. For the "and" it has to read
FUNCTION {format.lab.names.abbr}
{ 's :=
s num.names$ 'numnames :=
numnames #1 >
{ numnames #2 >
{ s #1 "{vv~}{ll}" format.name$ " et al." * }
{ s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
{ s #1 "{vv~}{ll}" format.name$ " et al." * }
{ s #1 "{vv~}{ll}" format.name$ " and " *
s #2 "{vv~}{ll}" format.name$ *
}
if$
}
if$
}
{ s #1 "{vv~}{ll}" format.name$ }
if$
}
the change is in the second branch of the innermost conditional. The version of isprs.bst currently available at http://www.isprs.org/documents/orangebook/app5.aspx has
s #1 "{vv~}{ll}" format.name$ " , " * % replaced and with ,
there and we make it read
s #1 "{vv~}{ll}" format.name$ " and " *
again. Note their comment and the spurious whitespace before the comma.
Of course you should still report this issue to the maintainer of the template and you should not modify the .bst file directly. Only modify and renamed copy, isprs-and.bst say, and document the changes.
The relevant macro is format.lab.names.abbr. For the "and" it has to read
FUNCTION {format.lab.names.abbr}
{ 's :=
s num.names$ 'numnames :=
numnames #1 >
{ numnames #2 >
{ s #1 "{vv~}{ll}" format.name$ " et al." * }
{ s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
{ s #1 "{vv~}{ll}" format.name$ " et al." * }
{ s #1 "{vv~}{ll}" format.name$ " and " *
s #2 "{vv~}{ll}" format.name$ *
}
if$
}
if$
}
{ s #1 "{vv~}{ll}" format.name$ }
if$
}
the change is in the second branch of the innermost conditional. The version of isprs.bst currently available at http://www.isprs.org/documents/orangebook/app5.aspx has
s #1 "{vv~}{ll}" format.name$ " , " * % replaced and with ,
there and we make it read
s #1 "{vv~}{ll}" format.name$ " and " *
again. Note their comment and the spurious whitespace before the comma.
Of course you should still report this issue to the maintainer of the template and you should not modify the .bst file directly. Only modify and renamed copy, isprs-and.bst say, and document the changes.
answered Feb 21 at 9:26
moewemoewe
92.2k10115348
92.2k10115348
Yeah, I am already in contact with the new maintainer. Weird that there is that comment.... Thank you for helping this fast.
– Grillteller
Feb 21 at 9:36
add a comment |
Yeah, I am already in contact with the new maintainer. Weird that there is that comment.... Thank you for helping this fast.
– Grillteller
Feb 21 at 9:36
Yeah, I am already in contact with the new maintainer. Weird that there is that comment.... Thank you for helping this fast.
– Grillteller
Feb 21 at 9:36
Yeah, I am already in contact with the new maintainer. Weird that there is that comment.... Thank you for helping this fast.
– Grillteller
Feb 21 at 9:36
add a comment |
Thanks for contributing an answer to TeX - LaTeX Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f475961%2fmodify-bst-file-so-that-2-authors-are-separated-by-and-in-the-text%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
It is quite likely that you would have to change the
.bststyle, yes (though I think there are some styles that use user-definable macros that could be changed in the.texfile directly, I don't think this style is one of them). I must admit that I rarely get things right the first time when I play around with.bstfiles and so it would help me greatly if you could provide the entire.bstfile (it is probably too large to fit here, so upload it to a text sharing site like pastebin.com or gist.github.com) and a short test file (.texand.bib).– moewe
Feb 21 at 9:08
It is the recent ISPRS template. All files can be found on: isprs.org/documents/orangebook/app5.aspx The template has been modified recently and is now inconsistent (the point I mentioned can be seen in 3.5.8) with the MS Word template. The deadline of my paper is quite soon and I cannot wait until there is an update. Nonetheless, I don't want to switch to Word ;). The function format.names begins at line 158.
– Grillteller
Feb 21 at 9:18
FWIW I think it should help to turn the second occurrence of
{ ", " * t * }into{ " and " * t * }but I could be wrong.– moewe
Feb 21 at 9:19
Nope, just looked at the
.bstit should be a different place. Hang on a sec...– moewe
Feb 21 at 9:23
Tested it. That changed the last author of a reference in the bibliography to be separated with an "and" and not a comma. Nice to know :)
– Grillteller
Feb 21 at 9:23