正如您在我的算法中所看到的,有些单词是用粗体突出显示的,但我不希望变量部分中的单词是粗体,因为它们只是注释。但是,如果我谈论的是代码,比如在upon标记中定义的代码,我希望这些单词要大胆。我的算法是用lstlisting编写的。
我用粗体表示,因为我在这里下了定义。
当我不想要粗体的时候,我是如何删除粗体的?

两个应该用黑体表示的词
\lstdefinelanguage{distributed}{
morekeywords={Implements,Uses,upon,event,procedure,returns,return,trigger,while,exists,such,that,do,for,forall,from,to,all,if,elif,then,else,end,endif,endwhile,and,or,break},
morekeywords={Require,Ensure,constants,variables,abort,note},
}发布于 2015-12-03 10:55:14
这是我的解决办法:
\lstdefinelanguage{distributed}{
morekeywords={Implements,Uses,upon,event,procedure,returns,return,trigger,while,exists,such,that,do,for,forall,from,to,all,if,elif,then,else,end,endif,endwhile,and,or,break},
morekeywords={Require,Ensure,constants,variables,abort,note},
morecomment=[l]{--},
morecomment=[l]{//}, % l is for line comment
morecomment=[n]{(*}{*)},
morecomment=[is]{/*}{*/}, % s is for start and end delimiter
morestring=[b]",
morestring=[d]'
}发布于 2015-12-01 09:24:59
我认为你应该在你的语言定义中定义“更多的注释”,以正确的方式打印评论。另请参阅
http://texdoc.net/texmf-dist/doc/latex/listings/listings.pdf
在第22页。
https://stackoverflow.com/questions/34007573
复制相似问题