tex

tex で入力した文字をそのまま表示する

投稿日:2020年11月7日 更新日:

tex で、入力された文字を「そのまま表示」するにはtex ソースの最初に\usepackage{verbatim}
と書いておいてから、\verb| | コマンドを使う。

\usepackage{verbatim}
\begin{document}
\verb| #@$!%^& |
\end{document}

結果

長い文章をそのまま表示

それなりに長い文章を、入力した「そのまま表示」するには、
tex ソースの最初に\usepackage{verbatim}と書いておいてから、\begin{verbatim}

\end{verbatim}
で目的のテキストを囲む。

\usepackage{verbatim}
\begin{document}
\begin{verbatim}
text1 text2
text3 text4
\end{verbatim}
\end{document}

結果

補足

英語「verbatim」の意味は、「正確に言葉どおりに」である。


-tex
-

執筆者:


comment

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です

関連記事

no image

tex で集合の内部集合(上に丸)を書く方法

集合の「内部」を表す記号を入力するには、\mathring{} を使う。 例 $\mathring{S}$ 結果

no image

tex でπ積(総乗、乗積)を表示する方法

tex で大文字のπ(Π)を使って乗積を表示する方法 例 $\displaystyle \prod_{i=0}^{N} a_i$または$\prod_{i=0}^{N} a_i$ 結果 このお姉さんはフ …

no image

tex で表の縦横軸を調整する方法

例 \begin{center} \begin{table}[] \begin{tabular}{|c|c|c|c|} \hline 氏名 & 生年 & 没年 & 著書 …

no image

tex で、集合の元でないことを表現する方法

\not \in を使う。 例 x \not \in A 結果

no image

tex で箇条書きをする方法

箇条書きをしたい部分を\begin{\itemize} と\end{itemize} で囲い、項目ごとに \item で箇条書きをすることができる。 例 \begin{itemize}     \it …