This answer shows how one line inside of lstlisting
can be set
in bold face. However, in this solution, you need to put the
material in a lstlisting
environment.
But what if I need to input the line using \lstinputlisting
? What
should I do in this case?
Editing the input file is not an option. This file is machine generated and is likely to change from time-to-time. But the line number of the line to be bolded does not change.
Though we don't need an MWE, I am providing one so that you can provide a solution with minimum hassle.
\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.txt}
First
Second
Third line to be bolded.
Fourth
\end{filecontents*}
\usepackage{listings}
\begin{document}
\lstinputlisting{\jobname.txt}
\end{document}