The issue you're experiencing stems from the fact that the pretitle field in your .bib entry is not being recognized or processed by your current .bst file. In standard BibTeX styles, only specific fields are recognized (like author, title, year, etc.), and any custom fields (like pretitle) are ignored unless the .bst file is modified to handle them.
Here's how you can fix this:
Option 1: Modify the .bst File to Include the pretitle Field
To include the pretitle field in your bibliography entries, you need to edit your .bst file so that it recognizes and processes the pretitle field. Here's how you can do it:
Make a Backup: Before making any changes, back up your original .bst file.
Add pretitle to the ENTRY List:
Open the .bst file in a text editor and locate the ENTRY function, which lists all the fields recognized by the style. Add pretitle to this list.
ENTRY
{ address
author
...
pretitle
...
year
}
{}
{ label extra.label sort.label } % or similar line
Define How pretitle Should Be Formatted:
Find the function that formats book entries, usually named FUNCTION {book}. Within this function, you'll need to add code to process the pretitle field.
Locate the section where the title is formatted and add the following code before it:
pretitle
" " *
Here's an example of how the modified FUNCTION {book} might look:
FUNCTION {book}
{ output.bibitem
format.authors "author" output.check
new.block
pretitle
" " *
title emphasize "title" output.check
...
}
This code retrieves the pretitle field from your .bib entry and inserts it before the title.
Recompile Your Document:
After saving the modified .bst file, recompile your LaTeX document. Remember that you might need to run BibTeX again to regenerate the bibliography with the new style.
Option 2: Use an Existing Field Like note
If modifying the .bst file seems complex or you prefer not to alter it, you can use an existing field that is already processed by your bibliography style. The note field is often included in many .bst files.
Update Your .bib Entry:
Replace the pretitle field with the note field in your .bib entry:
@book{goodfellow2016deep,
title={Deep Learning},
author={Goodfellow, Ian and Bengio, Yoshua and Courville, Aaron},
year={2016},
publisher={MIT press},
note={\MLtag\AItag}
}
Check If note Is Displayed:
Recompile your document and see if the tags appear in the bibliography. If they don't, it means your .bst file doesn't output the note field, and you'll need to modify the .bst file to include it.
Option 3: Use biblatex Instead of BibTeX
biblatex is a modern bibliography package that offers much more flexibility than traditional BibTeX styles. It allows custom fields and provides straightforward ways to modify bibliography formatting.
Switch to biblatex:
Add the following to your preamble:
\usepackage[backend=biber,style=numeric]{biblatex}
\addbibresource{yourbibliography.bib} % Replace with your .bib file name
Define a New Bibliography Driver:
Use \AtEveryBibitem or define a custom bibliography driver to include the pretitle field.
\AtEveryBibitem{%
\ifboolexpr{test {\ifentrytype{book}}}
{%
\iffieldundef{pretitle}{}{\printfield{pretitle}}%
}{}%
}
Compile with biber:
When using biblatex, you need to compile your document with biber instead of bibtex.
Summary
Modify the .bst file to process and include the pretitle field in your bibliography entries.
Use an existing field like note if your .bst file already outputs it.
Switch to biblatex for greater flexibility in handling custom fields and formatting.
Note: Modifying .bst files requires careful editing, as the syntax can be non-intuitive. If you're not comfortable with this, using biblatex is a more user-friendly alternative that provides robust features for bibliography management.