6
votes
1answer
64 views

Problem with listings when using line numbers, `name`, and `beamer` overlays

It's is well known that to ensure that a certain <counter> is automatically reset on subsequent slides of a same frame one has to use either \resetcounteronoverlays{<counter>} (for LaTeX ...
11
votes
1answer
120 views

How to make figure and listing share their counter

I'm using the "listings" package to write pieces of code (XML, RDF, Java, etc) and I want them to have the same counter of the Figure environment. For example, Listing 1: blablabla Listing 2: ...
2
votes
1answer
131 views

Adding caption and counter to source code environment

I have a source code listing with minted environment. How can I make a counter/caption to be shown as follows. I also need to make \tableofsourcecode to enlist all the source code references. The ...
0
votes
0answers
26 views

Listings: total line number count [duplicate]

Is there a way to determine how many lines a listings-environment has (included via \lstinputlisting) and display it in a text or caption? I found the counter \thelstnumber. But if it is used before a ...
8
votes
2answers
190 views

How to refer to the count value of number of lines in a lstlisting

I need to refer to to the count value of the number of lines in a listing. Is there a way to do that ? \lstinputlisting[caption={SPARQL query used...},label={lst:sqry}]{codes/sparql_query.sparql} ...
4
votes
2answers
2k views

How to get autoref working with different counters for different listing environments?

In my document I want several different custom listing environments. The solution from fraktalek works like a charm, except for one thing: \autoref doesn't work for me. I have tried the following: ...
3
votes
1answer
757 views

Custom numbering of listings

I have a number of listings in my document, numbered 1, 2, 3 and so on. I need a table with three listings (say, three different variants of the same algorithm), that will be numbered as 2a, 2b, 2c. ...
10
votes
2answers
2k views

Listings: different counters for different listing environments

How do I create two lstlisting environments that each have its own counter? If I use for example \lstnewenvironment{algorithm}[2]{ \renewcommand\lstlistingname{Algorithm} \lstset{ ... } } ...