Apologize if the title is not as clear. I have an org file, it includes the `listing` package, and setup its own `lstlisting`:
#+LATEX_HEADER: \usepackage{listings}
#+LATEX_HEADER: \lstdefinestyle{BashInputStyle}{language=bash,basicstyle=\large\ttfamily, numbers=left,numberstyle=\tiny,numbersep=3pt,frame=tb}
Normal include code from outside
#+BEGIN_EXPORT latex
\lstinputlisting[language=Python,style=BashInputstyle]{hello.py}
#+END_EXPORT
which renders like this:
​
https://preview.redd.it/csk8azf2eip81.png?width=806&format=png&auto=webp&s=555cd95538074f5ad7316b5446e89901f3342a3c
I use this to include long code block, it has its own file outside of org mode. For short codes, I tried to use org babel. I want this org babel, when exported, to have the same listing style as above, when you include from outside. [This](https://emacs.stackexchange.com/questions/36715/orgmode-is-it-possible-to-group-options-and-pass-them-to-latex-listings) answer suggests doing:
#+LATEX_HEADER: \usepackage{listings}
#+LATEX_HEADER: \lstdefinestyle{BashInputStyle}{language=bash,basicstyle=\large\ttfamily, numbers=left,numberstyle=\tiny,numbersep=3pt,frame=tb}
Normal include code from outside
#+BEGIN_EXPORT latex
\lstinputlisting[language=Python,style=BashInputstyle]{hello.py}
#+END_EXPORT
Now org babel block
#+ATTR_LATEX: :options style=BashInputStyle
#+BEGIN_SRC bash
echo "hello world"
#+END_SRC
I tried and got error, in fact it rendered incorrectly. This is my [log](https://pastebin.com/Er1vfpLG) and resulting [tex](https://pastebin.com/V4YfVU5z) file.
​
https://preview.redd.it/f4tymzymeip81.png?width=787&format=png&auto=webp&s=d8955e95c2a5b4eed7ba1805868934380c414136
Is it possible to have the include code and the org babel code to have consistent style?