Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 732087
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:06:05+00:00 2026-05-14T07:06:05+00:00

At the top of my tex document, I set my sourcecode listing format by

  • 0

At the top of my tex document, I set my sourcecode listing format by

\lstset{language=java}  
\lstset{numbers=left, numberstyle=\tiny, numbersep=5pt, breaklines=true}  
\lstset{emph={square}, emphstyle=\color{red}, emph={[2]root,base}, emphstyle {[2]\color{blue}}}

because I merely list Java source code.
At one point in my document, I had to reformat for a single listing by

\lstset{commentstyle=\footnotesize\textit}  
\lstset{basicstyle=\ttfamily\fontsize{11}{12}\selectfont}  
\lstset{literate={!=} {$\neq$}{2}}

Now I have the problem that my previous Java formatting for listings is destroyed, and I dont know how to reset the lst settings to default.
How can this be avoided?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:06:05+00:00Added an answer on May 14, 2026 at 7:06 am

    If you need to modify only one listing, you can pass the options as an optional argument:

    \begin{lstlisting}[commentstyle=\footnotesize\textit]
    ...
    \end{lstlisting}
    

    will only affect that particular listing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following tex document: \documentclass[a4paper,11pt,oneside]{book} \usepackage[usenames,dvipsnames]{color} \usepackage[T1]{fontenc} \usepackage[utf8x]{inputenc} \usepackage{lipsum} \usepackage[left=2cm,top=3cm,right=1.5cm,bottom=2cm]{geometry} \renewcommand{\chaptermark}[1]{\markboth{#1}{}} \renewcommand{\sectionmark}[1]{\markright{#1}{}}
So basically I've got something like this at the top of my tex file:
SELECT TOP (100) PERCENT dbo.EmployeeInfo.id, MIN(dbo.EmployeeInfo.EmpNo) AS EmpNo, SUM(dbo.LeaveApplications.DaysAuthorised) AS DaysTaken FROM dbo.EmployeeInfo LEFT
$(top.document).ready(function () { $(document).not('#mymenu *').click(processAction); }); function processAction(); this doesn't seem to be working.
declare @top int set @top = 5 select top @top * from tablename Is
This is in my top 10 list of tiny annoying things in Linux. I
Top border is 6px and green. Left, right and bottom 1px #ccc. The 1px
The top of my web.xml file looks like this: <?xml version=1.0 encoding=UTF-8?> <web-app xmlns=http://java.sun.com/xml/ns/j2ee
.top_line { background:#003466; float:left; height:107px; width:100%; } .header_logo { background:url(../images/header.png) top no-repeat; position: absolute;
Dim top = RandomPosition() Dim left = RandomPosition() End Sub Function RandomPosition() Dim rand

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.