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

  • SEARCH
  • Home
  • 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 528511
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:59:39+00:00 2026-05-13T08:59:39+00:00

As a programmer, I wonder if I could create my own package for LaTeX.

  • 0

As a programmer, I wonder if I could create my own package for LaTeX. I need something like that famous “listings” package, but something that is much more capable for my needs. I look for a listings solution that would watch out for a comment line like

// BEGIN LISTING 3122

// END LISTING 3122

No syntax highlighting, but intelligent support for tab indents. That package then would be used with a file name or path, walk through the lines and copy out just the snippets of interest.

I am 100% sure there is absolutely nothing like this on the market. So I want to program it for LaTeX. If that’s possible. I have no idea how and what programming language / IDE. Where would I start looking?

  • 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-13T08:59:40+00:00Added an answer on May 13, 2026 at 8:59 am

    This is certainly possible, but it is non-trivial in the TeX programming language. I don’t have time to code it up at the moment but here’s an algorithm; I suggest asking on comp.text.tex for more specific LaTeX programming advice.

    • Locally set all catcodes of special chars to “other” (\dospecials) and start reading in the input file line by line (\read)
    • for each line compare the first however many tokens of the line (some iterative use of \if or \ifx; there might be a package to make this easier such as stringstrings or xstring)
      • in the default state throw away the input line and read the next
      • unless it’s // BEGIN LISTING, in which case save each line into a macro (something like \g@addto@macro)
      • until it’s // END LISTING, obviously
    • keep going until the end of the file (\ifeof)

    TeX by Topic is a good reference guide for this sort of work.

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

Sidebar

Related Questions

A programmer I know has a website that is fully Standards Compliant. It uses
What is a programmer’s life like?
As a programmer I need a place to store my stuff. I've been running
We have a junior programmer that simply doesn't write enough tests. I have to
I'm a Java programmer, and I like my compiler, static analysis tools and unit
As almost every programmer, I'm writing my own PHP framework for educational purposes. And
I know there are other applications also, but considering yum/apt-get/aptitude/pacman are you core package
As a programmer I have no idea how one would go about programming menus
I am a novice programmer who is trying to teach myself to code, specifically
I am a programmer at a financial institute. I have recently been told to

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.