Android Question B4A Code in LaTex-written thesis

Oddjob

New Member
Licensed User
Hello everyone,

I am currently working on my bachelors thesis. I programmed a little app for my professor and i want to include some of my code in my thesis in order to explain certain functions and how i solved problems that came up.
It is pretty easy to include code in LaTex. For that i use the listings-package and include my files like so:

\lstinputlisting[language={[Visual]Basic}]{code.b4a}

As you can see, Visual basic is as close as it gets to the b4a programming language.
Using the colors package you can create your own colors and try to get close to the look of the b4a ide but there is a problem:
\lstset{ %
basicstyle=\footnotesize,
backgroundcolor=\color{white},
numberstyle=\color{B4Apurple2},
commentstyle=\color{B4Agreen},
keywordstyle=\color{B4Ablue},
stringstyle=\color{B4Ared},
identifierstyle=\color{B4Apurple},
captionpos=b,
frame=single,
label=Skript23,
breaklines=true,
}
this is how the code is formatted and there are simply not enough differentiations that i could use all the colors that b4a uses. Does anyone of you have a better idea? Would it make sense to take screenshots of the code in order to keep the same layout and format? I appreciate your help. :)
Oddjob
PS: This is how it looks like. Its close, but not perfect.
screenshot.png
 

mc73

Well-Known Member
Licensed User
Longtime User
Since your final export will be in pdf format, I think you could just take screenshots of your code.
Still, I wouldn't worry about the colors, as long as your code is ok :)
 
Upvote 0

Oddjob

New Member
Licensed User
Dear mc73,
Thank you for your quick reply :). I think i will use screenshots then. I still might have to figure out how to attach the entire code in the appendix, but thats a problem for another day. Maybe i'll just do that without any color-coding. :D
Cheers
 
Upvote 0
Top