Skip to content
TheChatArchiveThe Chat Archive
Unspecified model (huggingface.xxx)Hugging Face ShareLM (browser-extension contributions)

In .bst, how to make it output pretitle field before everything else in the following:…

  1. User

    In .bst, how to make it output pretitle field before everything else in the following: FUNCTION {output.bibitem} { newline"\bibitem["write "\bibitem[" write label write")"make.full.namesduplicate ")" make.full.names duplicate short.list = { pop } { * } if "]{" * writecite cite write "}" write newline$ "" before.all 'output.state := }

  2. Assistant

    To output the pretitle field before everything else in the output.bibitem function in a .bst file, you need to add the necessary code to process and print the pretitle field if it exists. The pretitle field is often used for things like "Volume" or other introductory text that precedes the title in a citation or bibliography entry. Here is how you can modify your output.bibitem function to include the pretitle field: FUNCTION {output.bibitem} { newline"\bibitem["write "\bibitem[" write label write")"make.full.namesduplicate ")" make.full.names duplicate short.list = { pop } { * } if "]{" * writecite cite write "}" write newline""pretitleempty "" pretitle empty 'skip { pretitle " " * write } if before.all 'output.state := } CopiedHowever, the above modification doesn't quite fit your requirement to output the pretitle field before everything else. The correct modification to output the pretitle before the bibitem and label would be: FUNCTION {output.bibitem} { newline pretitle empty′skip 'skip { pretitle " " * write } if "\bibitem[" writelabelwrite label write ")" make.full.names duplicate short.list = { pop } { * } if "]{" * write citewrite write "}" writenewline newline "" before.all 'output.state := } CopiedIn this modified version, the pretitle field is checked first, and if it's not empty, it is output followed by a space before the rest of the bibitem information is processed and output.

  3. User

    Good, it worked, but ended up even before the number. Put it after the [1]

  4. Assistant

    In that case, you can modify the output.bibitem function to output the pretitle field after the bibitem label, like this: FUNCTION {output.bibitem} { newline"\bibitem["write "\bibitem[" write label write")"make.full.namesduplicate ")" make.full.names duplicate short.list = { pop } { * } if "]{" * writecite cite write "}" write newlinepretitleempty pretitle empty 'skip { " " * pretitle " " * write } if "" before.all 'output.state := } CopiedHowever, this will still output the pretitle on a new line. If you want it to be on the same line as the citation number, you can remove the newline before the pretitle check: FUNCTION {output.bibitem} { newline"\bibitem["write "\bibitem[" write label write")"make.full.namesduplicate ")" make.full.names duplicate short.list = { pop } { * } if "]{" * writecite cite write "}" write pretitle empty′skip 'skip { " " * pretitle * write } if newline$ "" before.all 'output.state := } CopiedThis way, the pretitle will be output immediately after the citation number, without starting a new line.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.