TransWikia.com

Having asterisk above and not inline in code listings

TeX - LaTeX Asked by Maha on January 1, 2021

I want to writing code listings with asterisk in-line not above line.

That is something like this:

enter image description here

But when I tried this:

documentclass{article}
usepackage{listings}
begin{document}
begin{lstlisting}
*i
end{lstlisting}
end{document}

I ended up getting this:

enter image description here

How do I fix this?

One Answer

Try to make it in math mode ${}^{*}$ i. If you also need the asterisk to be tight to the letter i consider negative spaces.

Answered by Michael Solotky on January 1, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP