diff options
author | Prof. Dr. Jobst Hoffmann <ax006ho@doityourselfIV.athome> | 2020-01-30 13:33:02 +0100 |
---|---|---|
committer | Prof. Dr. Jobst Hoffmann <ax006ho@doityourselfIV.athome> | 2020-01-30 13:33:02 +0100 |
commit | 58e9144351caa512241d0fac2a48836d0d303e3e (patch) | |
tree | 4aef0b4c577e1f7bcae9033d9d339b659463dffe | |
parent | 2cfc08d3da837f44670893c4b58c2f2cf418b39a (diff) | |
download | listings-58e9144351caa512241d0fac2a48836d0d303e3e.tar.gz listings-58e9144351caa512241d0fac2a48836d0d303e3e.tar.bz2 |
description of (non-)consecutive numbering of ranges
-rw-r--r-- | testing/issues/larsson/README.md | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/testing/issues/larsson/README.md b/testing/issues/larsson/README.md new file mode 100644 index 0000000..1e51f22 --- /dev/null +++ b/testing/issues/larsson/README.md @@ -0,0 +1,49 @@ +# Line numbers that match the linerange specification # + +<file:///home/ax006ho/TeX/texmf/source/latex/listings/issues/larsson/linerange_specification_00a.tex> +shows the standard behaviour of the linerange option: line numbering +happens to start at 1, lines omitted by the use of linerange aren't counted +at all. + +The user Werner asked for a method to synchronize linerange and printed +line numbers. + +The question put in [Line numbers that match the linerange +specification](https://tex.stackexchange.com/questions/110187/listings-line-numbers-that-match-the-linerange-specification +"linerange specifications") got several answers: + + * patch the \lst@GLI@ command by using the etoolbox package: + <file:///home/ax006ho/TeX/texmf/source/latex/listings/issues/larsson/linerange_specification_00b.tex> + * introduce a new option "matchrangestart": + <file:///home/ax006ho/TeX/texmf/source/latex/listings/issues/larsson/linerange_specification_01.tex> + * enhance the keyword numbers by the value leftliteral: + <file:///home/ax006ho/TeX/texmf/source/latex/listings/issues/larsson/linerange_specification_02.tex> + * redefine the macro \lst@MSkipToFirst: + <file:///home/ax006ho/TeX/texmf/source/latex/listings/issues/larsson/linerange_specification_03.tex> + +None of these solutions is perfect. + +Here's a solution which comprises both of the aspects of the last example. + +There are two new options: + * consecutivenumbering (true, false) -> true + + this describes how ranges are numbered + * consecutivenumbering=true stands for the standard numbering, that is + the numbering of different ranges is consecutive. It can be used + for documenting code: + + comment + declaration + comment + code + + + + + + + + + + * rangegap (dimension) -> 0pt |