乳胶:内的美元符号 [英] latex: dollar $ sign within lstlising

查看:189
本文介绍了乳胶:内的美元符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将一些asm代码放入一个乳胶文档中,因此pdflatex将文档中的$符号视为数学环境(我不希望这样做).另一方面,我仍然想使用该奇特的换行箭头(使用数学env来显示它).

I am trying to put some asm code into a latex document, onfurtunatly pdflatex treats the $ signs within my document as math env (which I do not want). On the other side I'd still like to use that fancy linebreak arrow (which uses math env to display it).

\lstset{
texcl=false,
mathescape=false,
..,
prebreak = \raisebox{0ex}[0ex][0ex]{ensuremath{\hookleftarrow}}
}

示例快照:

CTRL_WD_12      equ     $303400
CTRL_WD_34      equ     $220000
CTRL_WD_56      equ     $000000
CTRL_WD_78      equ     $000000

感谢您的帮助.

推荐答案

您缺少反斜杠.试试:

prebreak = \raisebox{0ex}[0ex][0ex]{\ensuremath{\hookleftarrow}}

导致错误的原因是数学模式之外的\hookleftarrow.

It was the \hookleftarrow outside of math mode that was causing the error.

这篇关于乳胶:内的美元符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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