5

It's easy with the caption package: \documentclass{article} \usepackage[T1]{fontenc} \usepackage{listings} \usepackage{caption} \DeclareCaptionLabelFormat{reversed}{#2.\bothIfSecond{~}{#1}} \captionsetup[lstlisting]{ labelformat = reversed , labelsep = period } \begin{document} \begin{lstlisting}[caption=Test] a b c \end{lstlisting} \end{document} ...


3

You just need to add mlunquotedstringdelim to the lstset declarations, providing two delimiters of your liking (I used §). \lstset{ style = Matlab-editor, basicstyle = \mlttfamily, escapechar = ", mlshowsectionrules = true, mlunquotedstringdelim={§}{§}, } To have the numbers inside the frame, as per your second ...


2

If you really want to have this done via the listings-package: I don't know what TeX-engine you use (whether it is based on traditional TeX with single-byte/8bit-ASCII as internal character-representation scheme or it is based on XeTeX/LuaTeX with multi-byte-utf8/unicode as internal character-representation scheme). Therefore in the example below the ...


1

I use this method: The 'listings' package and UTF-8 An MWE: \documentclass{article} \usepackage{fontspec} \usepackage{xcolor} \usepackage{listings} \makeatletter \lst@InputCatcodes \def\lst@DefEC{% \lst@CCECUse \lst@ProcessLetter ^^^^2192^^^^2193^^00} \lst@RestoreCatcodes \makeatother \lstset{ basicstyle=\ttfamily, keepspaces, commentstyle=\...


1

keywords={} delete (more exactly redefine) the all keywords from keyword list 1. The DATE keyword is in the keyword list 2. So you should delete the all keywords from keyword list 2 with keywords={[2]} or keywords={[2]{}}. If you want to delete only DATE keyword, then use deletekeywords={[2]DATE}.


1

With a list of markers as linerange multiple listings are constructed, and for each new listing firstnumber=0 is executed. According to the documentation consecutivenumbers can be used on individual listings only, so the bug would be that a list of ranges is not considered as an 'individual listing'. As a workaround you can disable the macro \lst@...


1

Update: Firstly, since \captionof is used before lstlisting environment, setting \captionsetup[lstlisting]{position=top, ...} is more appropriate. This way, the vertical space between \hrulefill and double-columned lstlisting environment comes from: the skip below caption, which is \abovecaptionskip (default value is 10pt), and the skip above multicols ...


Only top voted, non community-wiki answers of a minimum length are eligible