summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/listings-ext/listings-ext.sty
blob: b0071f73f0b4fda8fa27fef236e00985b6ed60fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
%%
%% This is file `listings-ext.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% listings-ext.dtx  (with options: `extension')
%% 
%% Copyright (C) 2008-2010 Jobst Hoffmann, <j.hoffmann (at) fh-aachen.de>, all rights reserved
%% --------------------------------------------------------------------------------------
%% 
%% This file may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.2
%% of this license or (at your option) any later version.
%% The latest version of this license is in:
%% 
%%     http://www.latex-project.org/lppl.txt
%% 
%% and version 1.2 or later is part of all distributions of LaTeX
%% version 1999/12/01 or later.
%% 
%% Please address error reports and any problems in case of UNCHANGED versions
%% to
%%         j.hoffmann (at) fh-aachen.de
\NeedsTeXFormat{LaTeX2e}[1995/12/01]
{%
  \def\@svn@ $#1Date: #2-#3-#4 #5$$#6Revision: #7$ {%
    \ProvidesPackage{listings-ext}[#2/#3/#4 v#7 an extension for the listings package (JHf)]}
  \@svn@ $Date: 2010-06-29 18:38:12 +0200 (Di, 29 Jun 2010) $$Revision: 67 $ %
}
\RequirePackage{listings}
\RequirePackage{xkeyval}
\DeclareOptionX{style}[]{\lstset{style=#1}}
\ProcessOptionsX*
\newcommand{\lstdef}[3]{%
  \@namedef{lst@l@#1}##1{%
  \lstinputlisting[##1, linerange={#3}]{#2}}%
}
\newcommand{\lstcheck}[2]{%
  \expandafter\ifx\csname lst@l@#1\endcsname\relax%
  \input{#2}\fi%
  \expandafter\ifx\csname lst@l@#1\endcsname\relax%
  \PackageError{listings-ext}{undefined identifier}{%
  You may have mispelled the identifier, check the file%
  \MessageBreak\space\space\space#2\MessageBreak%
  for the correct spelling.}\fi%
}
\newcommand{\lstuse}[2][]{%
  \expandafter\ifx\csname lst@l@#2\endcsname\relax%
  \PackageError{listings-ext}{undefined identifier}{%
  You may have mispelled the identifier.\MessageBreak%
  If you go on without any change, no source code will be %
  included,\MessageBreak but your options will be written %
  into your formatted document.}\fi%
  \@nameuse{lst@l@#2}{#1}%
}
\endinput
%%
%% End of file `listings-ext.sty'.