开发者

latex: dollar $ sign within lstlising

开发者 https://www.devze.com 2023-01-30 10:55 出处:网络
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 fan

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,
mathescap开发者_如何学Pythone=false,
..,
prebreak = \raisebox{0ex}[0ex][0ex]{ensuremath{\hookleftarrow}}
}

example snap:

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

thanks for any help.


You have a missing backslash. Try:

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

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


Use this:

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

The rule is: if something is a special character, like $ is, a backslash \ usually escapes it without problems.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号