1

I would like to switch between two styles in a simpler way, I have two sty files (say a.sty and b.sty) and a different bibstyles for each file (say a.bst and b.bst). In order to switch between two formats I rewrite \bibliographystyle{} and \usepackage each time, is there a simpler way to do this ? specially because a.sty has aditional instructions like \pdfpagewidth=8.5in and \pdfpageheight=11in

SagarM
  • 143
  • 3
    In principle you can set the \bibliographystyle in the .sty file. (The position of \bibliographystyle in your document is irrelevant. It is only important that you have exactly one such directive.) Whether or not that is sensible in your situation is of course a different question. – moewe Dec 23 '21 at 15:41
  • @moewe thanks alot this already makes it easier, but how can I do an "if-else" in the preamble ? that would be quite awsome – SagarM Dec 23 '21 at 15:45
  • 2
    There are several ways to introduce a switch. Have a look at https://tex.stackexchange.com/q/5894/35864. – moewe Dec 23 '21 at 15:45
  • 1
    Is there something stopping you from creating two driver style files, say, driverA.sty and driverB.sty, with the contents of driverA.sty being \usepackage{a} and \bibliographystyle{a}, and the contents of driverB.sty being \usepackage{b} and \bibliographystyle{b}?. And, in the \ifthenelse statement, you'd set the condition which, if true, tells LaTeX to load driverA and, if false, tells LaTeX to load driverB. Incidentally, when switching bibliography styles, it's crucial to run a full compile cycle -- LaTeX, BibTeX, and LaTeX twice more -- to fully propagate all changes. – Mico Dec 23 '21 at 15:45
  • @moewe that solves it thanks alot ! Mico nice solution but i would not like to touch my .sty files (I am newbe) – SagarM Dec 23 '21 at 15:55

0 Answers0