I'm writing a lecture with many source codes for example. The codes are stored in severus different files. I use listing and minted packages for formatting the sources.
I would like add character at the begin of every line of some codes like:
- Bash shell ($ or #)
- Python shell (>>>)
- Matlab (>>)
- Other shells (>)
I tried some solutions which have given on:
But both solutions have the same problem when I try:
\begin{foo_environment}
\input{bar.txt}
\end{foo_environment}
In both solutions the linebreaking are ingnored
I have tried executing a bash command:
sed 's/^/$ /' bar.sh > bar.txt
This works locally but I can't do the same in Overleaf and Sharelatex
This is a sample code bar.sh:
cd ..
mount /dev/sda3 /mnt/
cd ~/.ssh/
ll
cd ~
ls -al
The result must be:
$ cd ..
$ mount /dev/sda3 /mnt/
$ cd ~/.ssh/
$ ll
$ cd ~
$ ls -al
\documentclass
through\end{document}
? That gives us something to start from.