同じ背景 (グレー)、フォントなどを使用して、LaTeX を使用して次のコードのような文字列を作成します。どうすればこれを実現できますか?
listings
パッケージを使用しましたが、内部に
\begin{lstlisting}...\end{lstlisting}
表形式の環境が使えませんでした。
答え1
すべて入力する必要がある場合は、tabular
typewriter(\ttfamily
)フォントを使用できます。次のコードでは、tcolorbox
色付きのボックス背景を提供します。
\documentclass[a4paper]{article}
\usepackage[skins]{tcolorbox}
\begin{document}
\begin{tcolorbox}[fontupper=\small\ttfamily, colback=gray!10, arc=0pt]
\begin{tabular}{llll}
byte\# & hexadecimal & text or \\
(hex) & & value & Meaning\\
0: & 47 49 46 \\
& 37 39 61 & GIF89a & Header\\
&&& Logical Screen Descriptor\\
6: & 03 00 & 3 & - logical screen width in pixels\\
\end{tabular}
\end{tcolorbox}
\end{document}