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 on your team is great at maintaining the old legacy system. But
Scala programmer should have known that this sort of writing : class Person{ var
I'm not a programmer, but I've done all the customizations for my web shop
I'm a C++ programmer trying to wrap my head around C# and found something
I'm a newbie programmer working with jQuery and wonder if anyone can help me
I am working with a programmer who is using Java to create an interface
I'm mainly a java programmer and I'm getting started with C++. I wonder if
I'm a backend programmer and I wonder about one thing. I know just a
I wonder if it is possible to show a library user that a function
Here's a real life example I had experienced before, and this is something that

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.