[Tex/LaTex] Changing the directory that BibTeX searches in for .bst files

bibliographiesbibtexnatbib

In a prvious question (How to change 'et al' to italic font in citation call-outs, with 'agsm' bibliography style), the answer by Mico tells us to place the modified .bst file in the "directory that's searched by BibTeX." However, the answer does not exactly specify what that directory is and how to change it. (of course I know that this varies depending on the version of the LaTeX distribution, the username and the operating system, but I still want to get a rough idea as to where I it is when using MiKTeX and Windows).

Further, I tried to rename IEEEtranN.bst to IEEEtranN-mod.bst while leaving both files in the original directory of IEEE bst files. Then I used \bibliographystyle{IEEEtranN-mod}, but it does not seem that BibTeX was able to find that file. Why can BibTeX use the original IEEEtranN but not the modified one when both of them are in the same directory?

Here is a sample of my code for testing

\begin{filecontents*}{sample.bib}
@article{aldaoudeyeh2016,
    title={{Photovoltaic-battery scheme to enhance PV array characteristics in partial shading conditions}},
    author={Aldaoudeyeh, Al-Motasem I},
    journal={IET Renewable Power Generation},
    volume={10},
    number={1},
    pages={108--115},
    year={2016},
    publisher={IET}
}
@ARTICLE{wu2017,
    title={{Assessing Impact of Renewable Energy Integration on System Strength Using Site-Dependent Short Circuit Ratio}},
    author={Wu, Di and Li, Gangan and Javadi, Milad and Malyscheff, Alexander M and Hong, Mingguo and Jiang, John Ning},
    journal={IEEE Transactions on Sustainable Energy},
    year={2017},
    publisher={IEEE}
}
@article{wu2019,
    title={A method to identify weak points of interconnection of renewable energy resources},
    author={Wu, Di and Aldaoudeyeh, Al Motasem and Javadi, Milad and Ma, Feng and Tan, Jin and Jiang, John N and others},
    journal={International Journal of Electrical Power \& Energy Systems},
    volume={110},
    pages={72--82},
    year={2019},
    publisher={Elsevier}
}
\end{filecontents*}

\documentclass[]{book}

\usepackage[x11names, svgnames]{xcolor}


%\usepackage[square, nonamebreak, sort&compress, comma]{natbib} % For IEEE
\usepackage[round]{natbib}
\newcommand{\citeauyear}[1]{%
    \citeauthor{#1}~[\citeyear{#1}] [Ref. \citenum{#1}]}


% C:\Users\almot\AppData\Local\Programs\MiKTeX 2.9\bibtex\bst\ieeetran


\usepackage{hyperref}
\hypersetup{citecolor=SlateBlue2, citebordercolor=SlateBlue2, 
    linkbordercolor=DodgerBlue3, linkcolor=DodgerBlue3, urlcolor=Blue1, colorlinks=true}


\begin{document}

\citeauyear{wu2017}, \cite{aldaoudeyeh2016,wu2019,wu2017}

\newpage
\bibliographystyle{IEEEtranN}
\bibliography{sample}

\end{document}

Best Answer

Place your files in your texmf folder. Where this folder is depends on the OS

(if these folder structure does not yet exist, create the necessary folders)

If the file is still not found after placing it there, run texhash from the command line