Questions tagged [lstdefinestyle]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
1answer
63 views

How to create an lstdefinestyle similar to this?

I am trying to create an lstdefinestyle similar to the one in the image below, but for no reason the settings are not working. Result of my lstdefinestyle: \documentclass{article} \usepackage{...
0
votes
1answer
66 views

lstlistings with with different languages and diffrent keywords

\lstdefinelanguage{RIPE} {% sensitive=t,% morekeywords={inetnum, netname,descr, country, admin-c, tech-c, status, mnt-by, notify, created, % last-modified, source, person, address, phone, e-...
2
votes
1answer
49 views

How do I keep morekeywords from being highlighted in a comment?

Say I have the following listing style: \lstdefinestyle{custCpp}{ language=c++, keywordstyle={\bfseries}, % keyword color keywordstyle = [2]{\color{blue}\bfseries}, otherkeywords = {...
0
votes
0answers
48 views

Get .prf file from Jetbrains Webstorm and apply it to listings configuration

From the listings doc it is mentioned that I basically can retrieve a Configuration file for the styling of a language from the IDE and apply it as lstset setting: ...settings in an IDE and can be ...
4
votes
1answer
3k views

Formatting SQL code

I try to format SQL code to achieve at least similar result to this picture : My result: But I can not do that. I struggle with margins, paddings, and numbering for a long time and I already feel ...
0
votes
1answer
52 views

Listings all in the same style although different languages are defined and used

So I want to show some python, bash and terminal output using the listing package. I searched for some language definitions for bash and python for the listing package and in the beginning it worked ...
1
vote
1answer
830 views

Code style using package listings not working

In this document I want to use two code styles, DOS and R. I have defined each using the package listings. The DOS style works great but the R style does not color the lines appropriately. Code (have ...
1
vote
1answer
244 views

Prevent LaTeX listings from highlighting part of word

I'm defining my own listings and have run into an issue whereby LaTeX highlights words within words - e.g. if OR is a keyword, it highlights the OR in ANIMATOR - even if ANIMATOR itself is a keyword (...
6
votes
2answers
380 views

Can one customize lstlisting environment?

I want to add some Python source code to my LaTeX document, but I want to apply some customization. Currently, I have something like this: \documentclass{article} \usepackage[utf8]{inputenc} \...
0
votes
0answers
46 views

lstlisting numbers ignores sideline [duplicate]

I am writing a paper with ieeeconf style. Now I added an lstlisting but the numbering is slighty off the normal text-region. You can see it here: Can someone help me to fix this? Code: https://www....
2
votes
1answer
343 views

Reduce the height of empty lines in \lstinputlisting

I am using \lstinputlisting to present some of my code in a paper. As shown in this image: I intend to add empty lines between different parts of codes. However, I somehow want to reduce the height ...
1
vote
0answers
133 views

Problem with lstlisting in beamer [duplicate]

\documentclass[10pt]{beamer} \usepackage[utf8]{inputenc} \usepackage{multicol} \usepackage{lipsum}% Just for this example \usepackage{graphicx} \raggedcolumns % for NOT stretching the columns with ...
3
votes
1answer
257 views

linebackgroundcolor overwriting backgroundcolor in \lstinputlisting

I am trying to highlight a specific line in a \lstinputlisting environment that already has a background color. The approach that I tried removes my original background color and just highlights the ...
1
vote
1answer
264 views

Italicize and Underline Keywords in lstdefinestyle

The documentation shows the following: keywordstyle=\color{black}\bfseries\underbar For my 3rd set of keywords I have tried: keywordstyle = [3]\textit\underbar However, this doesn't work and ...
1
vote
0answers
165 views

lstlisting - bold numbers, remove gaps between lines [closed]

I am trying to make a coloured source code box with lstlisting. Nearly everything works fine except two things: I gave up after 2 hours of searching the web on how to make the little numbers in front ...
4
votes
1answer
441 views

Change size of listing box locally

In the code given below, I get the output: How to go about changing the size of the box locally, so that the heading " "cubemaster" Usage" appears on one line instead of two lines? Thanks. Here is ...
0
votes
1answer
196 views

LstListing keeps adding whitespaces when a - is used

So I want to have some nice listings for a manual I'm writing. The instructions should be copied to the ubuntu terminal in which a bunch of them can be ran after each other. I fixed that, but now I'...
2
votes
1answer
483 views

Circled references within code lstlisting

So I just want to create some circled numbers within my code lstlisting, which I could easily reference within a nearby description text. This is my description text and I want to refer to [1] in \...
7
votes
1answer
5k views

advanced string highlighting in listings

I'm using listings to display ruby code with highlighting. I have the following test document: \documentclass{article} \usepackage{xcolor} \usepackage{listings} \definecolor{dkgreen}{rgb}{0,0.6,0} \...
1
vote
1answer
648 views

Change caption name of multiple listings

Can you please help me modify the listing names as shown in the image attached. I currently have 4 different \lstdefinestyle and would like to then have 4 different listing names. I was trying to ...
0
votes
1answer
364 views

How to write definition in box and remark in sidebar

I've to write definition, lemma in box and remark in sidebar like this photo.
2
votes
1answer
315 views

Input file path in modified listing environment

I have a modified environment for a listing called mylisting. I wanted to know how to include the path to the file to be used in the mylisting environment? Here is the code that I have so far: \...
2
votes
1answer
628 views

Different Matlab code listings environment in same document with Matlab-prettifier

I wanted to be able to have different Matlab code listings in the same document. The first three listings are from the solution found here. How do I get rid of the thin lined boxes in the first 3 ...
2
votes
1answer
169 views

Unexpected behavior when using words as delimiters in listings

I am trying to customize a listings style to automatically highlight my code exactly (or sufficiently close to) how my installation of Eclipse/PyDev does. I would like to be able to use "class" and ":"...
2
votes
0answers
383 views

Lstlisting line color between code lines [duplicate]

I have the following Latex code for VHDL code listing: \documentclass[english]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{babel} \usepackage{graphicx} \usepackage{...
2
votes
1answer
95 views

Define a command based on lstlisting usable in the normal line of the text.

Is there a way in order to define a command of 1 argument (that we can call '\likelisting') that allow us to inherits some defined things with lstlisting. For istance with the code \begin{...
2
votes
1answer
164 views

Set format of the document as the format for the listing

I would like to set the text format of the document as the format for the listing. The words in the listing accross my tex document have a bigger space between the characters. I want them to the have ...
1
vote
0answers
462 views

Adjusting the text width of R listings in LaTex [closed]

Hi I have R codes that I am listing in my LaTex file with \begin{lstlisting}[language=R] R code \end{lstlisting} I have no specific listing setting in my preamble. My R code is very wide and ...
6
votes
1answer
5k views

Colorize symbols with lstdefinelanguage in latex

I want to put some symbols in green color with lstdefinelanguage in latex, but it seems that symbols are not recognized. The symbols I need to be colored are =, > and <. Is it possible? How can I ...
0
votes
1answer
421 views

How to format an algorithm using lstlisting

I'm writing an algorithm using lstlisting : \lstset{language=C++} \begin{lstlisting}[frame=single,caption=Algorithme de la méthode "HOG+SVM"] HOGDescriptor hog;\\ hog.setSVMDetector(...
2
votes
1answer
929 views

How to insert code from a Router or a Switch

At the current time I have inserted the configuration of a couple of routers and switches using the following method: \lstset{breaklines=true} \begin{lstlisting}[frame=single] [Config here] \end{...
3
votes
1answer
280 views

listings package: last whitespace removed before the newline character. How to keep it?

I've some sort of template/examples of bash scripts on my computer (.sh files on my hd) in which I put commands and commented outputs. This is my example.sh file: echo this is wide ...