Tagged Questions
3
votes
1answer
60 views
verbments (listings alternative) and UTF-8
This is a follow-up question to UTF8 for listings
With these MWE I will not see the german umlauts in the resulted pdf (XeLaTeX was used):
\documentclass{article}
\usepackage{verbments}
...
6
votes
0answers
123 views
UTF8 for listings
With German umlauts I have to define these characters (Typesetting UTF8 listings with German Umlaute) and the following MWE is working:
\documentclass{article}
\usepackage[utf8]{inputenc}
...
4
votes
2answers
98 views
Listing with mixed english and russian symbols in comments
I'm using the listings package for formatting .cpp code in LaTeX. My code needs to have mixed English and Russian words in comments. The font must be monospaced (preffered Courier family).
/* Prints ...
2
votes
1answer
50 views
Use pxfonts in listings only
I really like the pxfont package for displaying code in listings. I would usually just do this to load pxfont for the entire document;
\usepackage{pxfonts}.
However, this time I am required to use a ...
1
vote
1answer
64 views
lstlisting: how to align highlighted code
I want to define a couple of new commands in order to highlight parts of my code (this is actually for a trace dump, not for a programming language).
My problem is that I can't seem to make the ...
2
votes
0answers
59 views
Default value for basicstyle in lstlisting
I have most of the code in Python, which renders very nice with this simple configuration of lstlisting
At a certain point I have to include an XML file, so I switched to language=XML but it renders ...
2
votes
2answers
269 views
\ttfamily is too bold for me
I use the following settings for my listings:
\lstset{
%basicstyle=\ttfamily\tiny, % small
basicstyle=\ttfamily\scriptsize, % middle
}
But the font in the listings is too bold for me. I tried a ...
2
votes
1answer
77 views
Moving from fancyvrb to listing – need to reconstruct my font settings
I have happily used the fancyvrb package with the Verbatim environment so far, but I want to change my figures to use the listing package with the lstlisting environment in order to have bold-faced ...
6
votes
2answers
178 views
change code font using mcode package
I'm using mcode package to insert into my document matlab code. I would change the default font. what command I should use to get this font?
4
votes
1answer
88 views
Getting incorrect underscores from macro in an lstlisting
I have a macro that I define as
\newcommand{\versionPath}{5\textunderscore0\textunderscore7}
to denote the word *5_0_7*, which I use in lstlisting's like this:
\begin{lstlisting}
...
4
votes
1answer
344 views
Change in \lstdefinelanguage the font?
Im using \lstdefinelanguage to add some new languages. Now everything is fine, I just would like to add another font to my language. I would like to use inconsolata.
I have now this:
%...
...
5
votes
1answer
93 views
Is it possible to change the font of line numbers in a code listing?
Using LyX I can add line numbers to my code listing. However, these are in the document (serif/Roman) font and look strange next to code blocks (Typewriter font). Is it possible to change the font of ...
4
votes
1answer
810 views
Set font in listings in XeLaTeX
I want to set specific font just for listings in XeLaTeX.
\newfontfamily\consolas{Consolas}
\lstdefinelanguage{MyLanguage}{
basicstyle=\ttfamily,
.... % my language definition
}
...
3
votes
2answers
1k views
Lyx is ignoring typewriter font setting for program listings
I'm using Lyx's Insert|Program Listing to insert a code listing into my document. Unfortunately, Lyx seems to ignore the Typewriter font selection I made in DocumentOptions under Fonts ⇒ ...
2
votes
2answers
98 views
A macro that behaves like a font-changing command (affects the rest of the current group)
Many LaTeX packages provide an interface to modify the typesetting of certain elements with the standard "parameterless" font commands, such as \bfseries, \sffamily or \color{red}. All of these ...
7
votes
3answers
497 views
Best way to write an xml tag
I'm writing a document about an XML schema, and I will be talking a lot of times about that <tag1> or that other <tag2>. Since I'm only mentioning them and not printing a whole XML file, ...
6
votes
2answers
2k views
Setting up specific font for use in listings
I'm writing my dissertion using TeX. I would like to use a specific font in my lstlisting source code. How can I use a specific font like Monaco or Arial? I usually found solutions with basicstyle ...
6
votes
2answers
8k views
set the font family for lstlisting
I have the following set up for my listings :
\lstset{basicstyle=\footnotesize,breaklines=true}
\lstset{framextopmargin=50pt,frame=bottomline}
I would like to change the font family to Courier. ...
5
votes
2answers
520 views
How can I tell lstlisting to use sans-serif when escaping to math mode?
Title says it all, an example follows:
\lstset{
mathescape=true,
basicstyle = \sffamily
}
\begin{lstlisting}
func($x_0$)
\end{lstlisting}
Where and how can I set the math font used ...
2
votes
1answer
3k views
Adding C++ code in Latex
So I am adding some C++ code snippets in my document using
\lstset {language=C++}
\begin{lstlisting}
for (int i=0; i<iterations;i++)
{
do something
}
\end{lstlisting}
My issue is that the font ...
2
votes
2answers
4k views
How to change the font style and size for the \lstinputlisting
I am trying to insert some piece of code into my document, using the \lstinputlisting command. However the fonts displayed do not look too good. Is it possible to change the font size and style?
4
votes
2answers
831 views
Fixed Width Font with LTXexample environment
Not sure why this problem has eluded me but I can't seem to get fixed width font in the code portion. I thought that this question on how to change code font would do the trick but it doesn't for me. ...
7
votes
1answer
4k views
How to change code example font in listings?
Does anyone know how to change the font for code snippets in the listings package? I'd like to have a constant width font, rather the fancy variable-width looking font that it has by default.
4
votes
1answer
811 views
lstlistoflistings font
I'd like to change my list of listings to match my list of figures, which I have changed using tocloft:
\renewcommand{\cftfigfont}{\sffamily\mdseries\upshape}
Is there a way to do the same with my ...
1
vote
1answer
2k views
change font color in a lstset
Hi I need put java code to latex. I use \lstset and \begin{lstlisting}. I need change color of font in SOME part of code. How I can do this? Help pls