I am trying to put a Verilog code listing in my document, but it returns a Latex error when processing the comment lines, here is the MWE:
\documentclass[12pt,letterpaper,twoside]{book}
\usepackage[spanish]{babel}
\usepackage{listings}
\renewcommand{\lstlistingname}{Listado}
\begin{lstlisting}[language=Verilog]
/*Descripción estructural de un multiplexor 2 a 1*/
//interfaz I/O del módulo
module mux(f,a,b,sel);
\end{lstlisting}
These are the compiling errors I get:
! LaTeX Error Invalid UTF-8 byte "B3. ! LaTeX Error
! LaTeX Error Invalid UTF-8 byte sequence (�\expandafter)
If I erase the lines of comments the document compiles fine. After some research, I have used \UseRawInputEncoding command as suggested here: Package inputenc Error: Invalid UTF-8 byte 147 but when I do it my environment does not process the accented letters, so I need to put the literal command \'{a}. Given that I have 50+ pages in the document, seems like a chore to hunt down every accent in it, is there a more efficient way to do this? (addendum: the encoding command \usepackage[utf8]{inputenc} doesn't work either)