
文書にverbatim
フォントを libertine に変更したいのですが、これにより逐語的な部分も変更されてしまいます。verbatim
テキストを libertine フォントに変更しながら、コンピューター フォントの部分はそのままにする方法はありますか?
\documentclass[25pt]{article}
\usepackage{libertine, verbatim}
\begin{document}
\verb|looks odd|
\end{document}
答え1
衝突ではありません! パッケージは、libertine
ローマン (Libertine)、サンセリフ (Biolinum)、モノ (Libertine Mono) の 3 つのフォント ファミリをすべて定義します。必要ない場合は、Libertine mono フォントをロードしないでください。
\documentclass[12pt]{article}
\usepackage[mono=false]{libertine}
\usepackage{verbatim}
\begin{document}
\verb|looks good|
\end{document}
ただし、タイプライター フォントとして Bera Mono を使用すると見栄えが良くなります。太字のバリエーションもあります。
\documentclass[12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[mono=false]{libertine}
\usepackage[scaled=0.85]{beramono}%% or 0.82
\usepackage{verbatim}
\begin{document}
Normal text \textsf{Biolinum} \verb|looks good| \texttt{bera mono}
Also available in bold \textbf{\texttt{bera mono bold}}
\end{document}
答え2
以下についてはどうでしょうか:
\documentclass[25pt]{article}
\usepackage{libertine, verbatim}
\makeatletter
\g@addto@macro\verbatim\sffamily{}
\makeatother
\begin{document}
\verb|looks odd|
\end{document}
答え3
調整し\verbatim@font
て選択しますcmtt
- コンピューター風の Computer Modern Typerwriter フォント:
\documentclass{article}
\usepackage{libertine}
\begin{document}
looks good \verb|looks odd| looks good
\makeatletter
\renewcommand{\verbatim@font}{\fontfamily{cmtt}\selectfont}
\makeatother
looks good \verb|looks odd| looks good
\end{document}