
たとえば、次のように書きたい場合:
\usepackage{minted}
両親が私にお金をくれました。私はお店に入って、found some sweets
気に入ったものを買いました。
上記のテキストで、mintedパッケージを使用して上記のように強調表示するにはどうすればよいでしょうか
答え1
ライトグレーの背景にも興味がある場合は、次の 2 つの方法のいずれかが役立つかもしれません。
\documentclass{article}
\usepackage{geometry}
\usepackage{xcolor} % For the first and second example
\definecolor{mylightgray}{RGB}{239,240,241}
\usepackage{soul} % For the second example
\sethlcolor{mylightgray}
\begin{document}
My parents gave me some money. I walked in the shop and \colorbox{mylightgray}{\texttt{found some sweets}} that I liked. I decided to buy them.
My parents gave me some money. I walked in the shop and \hl{\texttt{found some sweets}} that I liked. I decided to buy them.
\end{document}
最初の例では、灰色のボックス内では改行が許可されないことに注意してください。