Home
Blogs
Questions
Jobs
Monetize

Home

About Us

Blogs

Questions

Jobs

Monetize

Post Job

banner

Questions about listings

Read more about listings

python (12.9k questions)

javascript (9.2k questions)

reactjs (4.7k questions)

java (4.2k questions)

java (4.2k questions)

c# (3.5k questions)

c# (3.5k questions)

html (3.3k questions)

Questions - listings

Different colors for different keywords in listing environment doesn't work

I've read in several answers that I can use [number] to set different colors for different keywords in a listings environment. However, when I try it this way it doesn't work. These are my preamble an...
test-img

Gabriele Troviso

latex

listings

Votes: 0

Answers: 1

Latest Answer

A very good answer was already given by user Symbol 1. Example language is in C++, but the way to style your code is the same: Other keywords and symbols highlighting with lstlisting \documentclass[10...
test-img

ktw

Comment in listings environment

When I write my code in listings environment and try writing "comment" as comment, I see this in my pdf: breaking#breakingcomment I want to have a simple comment as "#comment" I ...
test-img

Gabriele Troviso

latex

listings

Votes: 0

Answers: 1

Latest Answer

You are missing the , after the commentstyle key: \documentclass{article} \usepackage{listings} \usepackage{xcolor} \lstdefinelanguage{Python} { morekeywords={from, import, def, return}, comment...
test-img

samcarter_is_at_topanswers.xyz

Posts

Questions

Blogs

Jobs

The ultimate platform for coders and IT specialists

About

  • Company
  • Support

  • Platform

  • Terms & Conditions
  • Privacy statement
  • Cookie policy
  • Cookie option
  • OnlyCoders © 2025  |  All rights reserved