New answers tagged listings
3
votes
Removing extra characters from code environment in beamer
The mysterious ^^I in the output mean two things:
you're using TAB for indenting the code;
you're using XeLaTeX to process your beamer document.
I learned several years ago that TABs in TeX files ...
5
votes
Accepted
Removing extra characters from code environment in beamer
In TeX the notation ^^<char> means use the character at ASCII-code of <char>-64 (for <char> having an ASCII-code >= 64 that is). For ^^I you end at ASCII-code 73-64=9 which is Tab....
2
votes
Accepted
How to include Latex listing in a command using minipage?
You can avoid such problems by using a custom environment instead of a command:
\documentclass{article}
\usepackage{xcolor}
\usepackage{fancyvrb}
\usepackage{listings}
\lstset{%
language=[LaTeX]{...
2
votes
How to include Latex listing in a command using minipage?
The following uses a verbatim argument to grab your fourth argument and then uses \scantokens to allow the code to be interpreted. Please note that this way the macro \foocmd is not allowed to be used ...
1
vote
Accepted
listings not cover the whole minipage area
You can adjust the belowskip:
\documentclass[border=2pt]{standalone}
\usepackage{listings}
\usepackage{xcolor}
\begin{document}
\begin{minipage}{\linewidth}
\pagecolor[RGB]{128,128,128}%
\begin{...
3
votes
Accepted
below part not show up with standalone and listings
Only the edges need to be overlayed.
Instead of overlaying the whole diagram, we'll just let PGF/TikZ find the right horizontal position itself by setting trim left = 0pt. On the second compilation ...
1
vote
below part not show up with standalone and listings
overlay TikZ pictures does not take up space. Here is a solution where vertical space is added manually at the end.
\documentclass[border=2pt, preview]{standalone}
\usepackage{tikz}
\usetikzlibrary{...
1
vote
Accepted
You can't use `macro parameter character #' in horizontal mode. I can't print a code .py with special characters
From the manual of listings:
When the language is Python, # is the comment character and therefore everything that follows the first one (on the same line) is treated as LaTeX code. The second # ...
1
vote
two symbols in escapechar in lstset (listings package) doesn't work
escapeinside cancels the escapechar feature: you can only have one of them.
\documentclass{article}
\usepackage{listings}
\begin{document}
\lstset{escapechar=\%}
\begin{lstlisting}
Listing 1: %\...
1
vote
Accepted
Error when using mcode.sty package - Inserts "2D at first page
Never use
\usepackage[utf8x]{inputenc}
it does nothing other than issue a warning
Package ucs Info: utf8x disabled, assuming standard utf8 processing
(ucs) load ucs package to force utf8x ...
Top 50 recent answers are included
Related Tags
listings × 3738code × 239
color × 184
captions × 162
beamer × 159
minted × 152
verbatim × 141
highlighting × 133
tcolorbox × 121
spacing × 114
table-of-contents × 105
line-breaking × 104
formatting × 96
environments × 92
floats × 91
fonts × 89
macros × 87
sourcecode × 84
cross-referencing × 76
page-breaking × 68
tikz-pgf × 67
tables × 66
line-numbering × 58
unicode × 55
xetex × 52