
最近はマークダウンをよく使っているので、Latexでも同じようにバックティック/バッククォートを使いたいと考えています。
Using a `tt-font`
同じ結果になる
Using a {\tt tt-font}
2つの$
sを有効にするのと同様に数学モード。
私は承知していますこのような変化は問題であるとしてテックスコア文字コードにはバックティックを使用しますが、ファイル内では直接使用しません。
答え1
まず、\tt
(すべての 2 文字のフォント変更コマンドとともに) は約 30 年間廃止されていることに注意してください。
さて、あなたの問題です。
\documentclass{article}
\AtBeginDocument{%
\begingroup\lccode`~=``\lowercase{\endgroup\let~}\markdownbackquote
\catcode``=\active
}
\begingroup
\catcode``=\active
\protected\gdef\markdownbackquote#1`{\texttt{#1}}
\endgroup
\begin{document}
This is `typewriter` type.
\end{document}
プリアンブルコードも
\begingroup
\catcode``=\active
\AtBeginDocument{%
\let`\markdownbackquote
\expandafter\catcode\string``=\active
}
\protected\gdef\markdownbackquote#1`{\texttt{#1}}
\endgroup