arXiv / arXiv/html_feedback

lstinputlisting line ranges not supported

Open
#6,950 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
42
Forks
40
PR merge metrics
No merged PRs in 30d

Description

Thanks for the fixes in #5567, I think the last thing related to this would be to handle a few remaining options for specifying line ranges in
`\lstinputlisting`. The code snippets appearing in the paper at https://arxiv.org/html/2601.09829 are now rendered much better, but in that work, the code of one of the source files was broken up into many separate figures in the paper, and the following variants for line ranges don't seem to be taken into account in the arXiv html port of the paper:

```
\lstinputlisting[linerange={2-34}]{listings/wirepair.pro}
\lstinputlisting[linerange={161-175,180-190,193-200,204-206}]{listings/wirepair.pro}
```

The above code excerpts from the paper's LaTeX file render figures 5 and 13 in the paper, and at those places (and some others) they unfortunately render the entire source file (`wirepair.pro`) instead of only the selected lines. The other syntax below is properly handled (figure 12 in the paper, for example, which renders correctly).
```
\lstinputlisting[firstline=146, lastline=159]{listings/wirepair.pro}
```

So if the `linerange={x-y}` or `linerange={x1-y1,x2-y2[,...]}` option format can be supported for `\lstinputlisting`, then I think the listings in the html version of the paper will be spot-on!

All the best,

Marc Boulé

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the issue with the two \lstinputlisting examples using linerange in the arXiv HTML rendering, comparing them with the working firstline/lastline example. Inspect the handling of \lstinputlisting options and verify that single and comma-separated ranges render only the selected lines from listings/wirepair.pro.

Written by the indexing model from the issue text.

Assessment

Tech stack
latex
Domain
tooling, web-dev
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.