pdftex

How to include image files in Sphinx + Latex Pdf files

风流意气都作罢 提交于 2020-08-20 12:07:39
问题 I am using Sphinx Documentation tool alongwith LaTeX to generate pdf files. While trying to include images in the pdf file, I am coming up with the following error during compile: LaTeX Warning: File `{img_file}.jpg' not found on input line 920. ! Package pdftex.def Error: File `"""{img_file}".jpg' not found: using dra ft setting. See the pdftex.def package documentation for explanation. Type H <return> for immediate help. ... l.920 ...phinxincludegraphics{{img_file}.jpg} } ? These are some

Highlighting a Chunk of Code within a lstlisting

二次信任 提交于 2019-12-20 09:48:31
问题 I have a bunch of code in a lstlisting environment. How can I highlight (color background) just a particular chunk of code within the environment? 回答1: You can use \colorbox and an escape character inside your listing: Add to your preamble \usepackage{color} \definecolor{light-gray}{gray}{0.80} then use it like this in your document: \begin{lstlisting}[escapechar=!] def mult(m: Matrix[Int], n: Matrix[Int]) { val p = !\colorbox{light-gray}{new MatrixInt}!(m.rows, n.cols) } \end{lstlisting} 回答2

Highlighting a Chunk of Code within a lstlisting

和自甴很熟 提交于 2019-12-02 21:09:55
I have a bunch of code in a lstlisting environment. How can I highlight (color background) just a particular chunk of code within the environment? You can use \colorbox and an escape character inside your listing: Add to your preamble \usepackage{color} \definecolor{light-gray}{gray}{0.80} then use it like this in your document: \begin{lstlisting}[escapechar=!] def mult(m: Matrix[Int], n: Matrix[Int]) { val p = !\colorbox{light-gray}{new MatrixInt}!(m.rows, n.cols) } \end{lstlisting} Anton Geraschenko It's a bit cumbersome, but you can break the code into several lstlisting environments.