I need to write an example of a file format. I want to do something like this: enter image description here

The text inside the square is something I'll write inside latex and represents how a certain kind of file is made, it's not the content of a real file on my file system. I tried looking up online but I only came across results showing how to import verbatim the content of a file.

I'm also interested in putting the caption after the image.

The text I'll write will be made of file formats and algorithms.


With the help of the listings package:

enter image description here

\lstset{numbers=left, numberstyle=\tiny,frame=single}
\begin{lstlisting}[caption={Your caption text}, label=labeltext, captionpos=b]
.i 4
.o 1
-10- 1
|improve this answer|||||
  • Do you know how can I replace the word "Listing" under the figure with another word, like "Figure"? – Gerardo Zinno Sep 1 '19 at 20:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.