LaTeX,波浪号和逐字模式 [英] LaTeX, tildes and verbatim mode

查看:620
本文介绍了LaTeX,波浪号和逐字模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

接着是此问题,当我处于逐字模式时,我完全无法让LaTeX产生波浪号.它必须是波浪号,因为它是函数的类型!

Following on from this question, I'm totally stumped on getting LaTeX to give me a tilde when I'm in verbatim mode. It has to be a tilde because it's the type of a function!

sig symm : (Board, [(Int, Int)]) ~> Bool

显示波浪号的标准方法是逐字打印的.

Standard methods for displaying a tilde are printed verbatim, of course..

有什么建议吗?

需要澄清的修改:在逐字模式下键入〜会在空格上方加重音.我在这句开头出现的波浪号之后.

An edit to clarify: Typing a ~ in verbatim mode gives an accent above a blank space. I'm after a tilde as it appears at the beginning of this sentence.

推荐答案

如果输入中没有出现某些字符,则可以使用fancyvrb及其commandchars选项在逐字文本中插入TeX命令:

If there are some characters that do not occur in your input, you can use fancyvrb and its commandchars option to insert TeX commands within verbatim text:

\documentclass{article}
\usepackage{fancyvrb}
\begin{document}
\newcommand{\mytilde}{$\sim$}
\begin{Verbatim}[commandchars=\\\{\}]
sig symm : (Board, [(Int, Int)]) \mytilde> Bool
\end{Verbatim}
\end{document}

有关更多信息,请参见 fancyvrb 的文档.

See the documentation of fancyvrb for more.

这篇关于LaTeX,波浪号和逐字模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆