texlive[51944] trunk: clojure-pamphlet (24aug19)

commits+karl at tug.org commits+karl at tug.org
Sat Aug 24 00:51:26 CEST 2019


Revision: 51944
          http://tug.org/svn/texlive?view=revision&revision=51944
Author:   karl
Date:     2019-08-24 00:51:26 +0200 (Sat, 24 Aug 2019)
Log Message:
-----------
clojure-pamphlet (24aug19)

Modified Paths:
--------------
    trunk/Build/source/texk/texlive/linked_scripts/Makefile.am
    trunk/Build/source/texk/texlive/linked_scripts/Makefile.in
    trunk/Build/source/texk/texlive/linked_scripts/scripts.lst
    trunk/Master/tlpkg/bin/tlpkg-ctan-check
    trunk/Master/tlpkg/libexec/ctan2tds
    trunk/Master/tlpkg/tlpsrc/collection-binextra.tlpsrc

Added Paths:
-----------
    trunk/Build/source/texk/texlive/linked_scripts/clojure-pamphlet/
    trunk/Build/source/texk/texlive/linked_scripts/clojure-pamphlet/pamphletangler
    trunk/Master/bin/aarch64-linux/pamphletangler
    trunk/Master/bin/amd64-freebsd/pamphletangler
    trunk/Master/bin/amd64-netbsd/pamphletangler
    trunk/Master/bin/armhf-linux/pamphletangler
    trunk/Master/bin/i386-cygwin/pamphletangler
    trunk/Master/bin/i386-freebsd/pamphletangler
    trunk/Master/bin/i386-linux/pamphletangler
    trunk/Master/bin/i386-netbsd/pamphletangler
    trunk/Master/bin/i386-solaris/pamphletangler
    trunk/Master/bin/win32/pamphletangler.exe
    trunk/Master/bin/x86_64-cygwin/pamphletangler
    trunk/Master/bin/x86_64-darwin/pamphletangler
    trunk/Master/bin/x86_64-darwinlegacy/pamphletangler
    trunk/Master/bin/x86_64-linux/pamphletangler
    trunk/Master/bin/x86_64-linuxmusl/pamphletangler
    trunk/Master/bin/x86_64-solaris/pamphletangler
    trunk/Master/texmf-dist/doc/support/clojure-pamphlet/
    trunk/Master/texmf-dist/doc/support/clojure-pamphlet/README
    trunk/Master/texmf-dist/doc/support/clojure-pamphlet/clojure-pamphlet_guide.pdf
    trunk/Master/texmf-dist/doc/support/clojure-pamphlet/pamphletangler.1
    trunk/Master/texmf-dist/scripts/clojure-pamphlet/
    trunk/Master/texmf-dist/scripts/clojure-pamphlet/pamphletangler
    trunk/Master/texmf-dist/source/support/clojure-pamphlet/
    trunk/Master/texmf-dist/source/support/clojure-pamphlet/clojure-pamphlet.dtx
    trunk/Master/texmf-dist/source/support/clojure-pamphlet/clojure-pamphlet.ins
    trunk/Master/texmf-dist/tex/latex/clojure-pamphlet/
    trunk/Master/texmf-dist/tex/latex/clojure-pamphlet/clojure-pamphlet.sty
    trunk/Master/tlpkg/tlpsrc/clojure-pamphlet.tlpsrc

Property Changed:
----------------
    trunk/Build/source/texk/texlive/linked_scripts/Makefile.am

Modified: trunk/Build/source/texk/texlive/linked_scripts/Makefile.am
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/Makefile.am	2019-08-23 21:14:18 UTC (rev 51943)
+++ trunk/Build/source/texk/texlive/linked_scripts/Makefile.am	2019-08-23 22:51:26 UTC (rev 51944)
@@ -1,6 +1,7 @@
+## $Id$
 ## Makefile.am for the TeX Live subdirectory texk/texlive/linked_scripts/
 ##
-## Copyright 2016-2017 Karl Berry <tex-live at tug.org>
+## Copyright 2016-2019 Karl Berry <tex-live at tug.org>
 ## Copyright 2009-2015 Peter Breitenlohner <tex-live at tug.org>
 ## You may freely use, modify and/or distribute this file.
 ##
@@ -101,6 +102,7 @@
 	cachepic/cachepic.tlu \
 	checkcites/checkcites.lua \
 	cjk-gs-integrate/cjk-gs-integrate.pl \
+	clojure-pamphlet/pamphletangler \
 	cluttex/cluttex.lua \
 	context/perl/mptopdf.pl \
 	convbkmk/convbkmk.rb \


Property changes on: trunk/Build/source/texk/texlive/linked_scripts/Makefile.am
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+Date Author Id Revision
\ No newline at end of property
Modified: trunk/Build/source/texk/texlive/linked_scripts/Makefile.in
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/Makefile.in	2019-08-23 21:14:18 UTC (rev 51943)
+++ trunk/Build/source/texk/texlive/linked_scripts/Makefile.in	2019-08-23 22:51:26 UTC (rev 51944)
@@ -315,6 +315,7 @@
 	cachepic/cachepic.tlu \
 	checkcites/checkcites.lua \
 	cjk-gs-integrate/cjk-gs-integrate.pl \
+	clojure-pamphlet/pamphletangler \
 	cluttex/cluttex.lua \
 	context/perl/mptopdf.pl \
 	convbkmk/convbkmk.rb \

Added: trunk/Build/source/texk/texlive/linked_scripts/clojure-pamphlet/pamphletangler
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/clojure-pamphlet/pamphletangler	                        (rev 0)
+++ trunk/Build/source/texk/texlive/linked_scripts/clojure-pamphlet/pamphletangler	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1,191 @@
+#!/usr/bin/perl -w
+
+=head1 NAME
+
+pamphletangler - Extract code bits from LaTeX pamphlet files.
+
+=cut
+
+=head1 SYNOPSIS
+
+B<pamphletangler> [OPTION...] I<FILE> I<CHUNKNAME>
+
+=cut
+
+=head1 DESCRIPTION
+
+The  clojure  pamphlet  system is a system based on the clojure literate
+system.  In the clojure's pamphlet system you have your main LaTeX file, which
+can be compiled regularly. This file contains documentation and source code
+(just like in other forms of literate programming). This code snippets are
+wrapped in the 'chunk' environment, hence they can be recognized by the tangler
+in order  to  extract  them.  Chunks can be included inside each other by the
+'getchunk' command (which will be typesetted acordingly). Finally, you run your
+LaTeX file through the tangler and get your desired chunk of code.
+
+=cut
+
+=head1 OPTIONS
+
+=over 29
+
+=item -L, --line=linetext
+
+If set, this text will be inserted after jumps of lines, changing the string
+inside "changetext" for the line number. This is used so that error report
+refers to pamphlet line number instead of output line number
+
+=item -C, --change=changetext
+
+Defaults to "{}" this is the text that will be replaced with the line number if
+the linetext option is specified
+
+=item -?, --help
+
+Give this help list
+
+=item --usage
+
+Give a short usage message
+
+=item --man
+
+Print manual page
+
+=item -V, --version
+
+Print program version
+
+=back
+
+=head1 LICENSE
+
+Copyright (C) 2019 Ernesto Lanchares Sanchez.
+
+   The clojure-pamphlet tagler is free software; you can redistribute
+   it and/or modify it under the terms of the GNU Lesser General
+   Public License as published by the Free Software Foundation;
+   either version 3 of the License, or (at your option) any later
+   version.
+
+  The clojure-pamphlet tangler is distributed in the hope that it
+  will be useful, but WITHOUT ANY WARRANTY; without even the implied
+  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the GNU Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this program; if not, see
+  L<http://www.gnu.org/licenses/>.
+
+
+=head1 AUTHOR
+
+Ernesto Lanchares <e.lancha98 at gmail.com>
+
+=head1 BUGS
+
+Report bugs to e.lancha98 at gmail.com
+
+=cut
+
+use strict;
+use warnings;
+use Getopt::Long;
+use Pod::Usage qw(pod2usage);
+use vars qw/$VERSION/;
+
+BEGIN { $VERSION = '1.2' }
+
+my $linetext = "";
+my $changetext = "{}";
+my $filename;
+my $chunkname;
+
+OPTS: {
+    GetOptions(
+        'usage' => sub { pod2usage( -verbose => 99, -sections => [ qw(SYNOPSIS) ]); },
+        'help|?' => sub { pod2usage( -verbose => 99, -sections => [ qw(SYNOPSIS DESCRIPTION OPTIONS BUGS) ]); },
+        'man' => sub { pod2usage( -verbose => 2) },
+        'version|V' => sub { print "$VERSION\n"; exit; },
+        'line|L=s' => \$linetext,
+        'change|C=s' => \$changetext
+    );
+
+
+#pod
+    while ( my ($option, $value, $pretty) = Getopt::Mixed::nextOption() ) {
+        $linetext = $value if $option eq 'L';
+        if( $option eq 'V' ) {
+            print "$VERSION\n";
+            exit;
+        }
+        if ($option eq '?') {
+            pod2usage( -verbose => 99, -sections => [ qw(SYNOPSIS OPTIONS BUGS) ]);
+            exit;
+        }
+        if ($option eq 'man') {
+            pod2usage( -verbose => 2 );
+            exit;
+        }
+        $linetext = $value if $option eq 'L';
+        $changetext = $value if $option eq 'C';
+    }
+#cut
+
+    pod2usage( -message => "[ERROR]: Invalid number of arguments." )
+        if scalar(@ARGV) != 2;
+    $filename = shift;
+    $chunkname = shift;
+}
+
+open(my $file, "<", $filename) or die "Can't open $filename: $!";
+
+my $file_contents = do { local $/; <$file> };
+my %codeblocks;
+
+while ($file_contents =~ /\\begin\{chunk\}\{([\w.]+)\}[\s\h\t]*\n?(.*?)\n?[\s\t\h]*\\end\{chunk\}/sg) {
+    $codeblocks{$1} = { source => $2, printing => undef };
+}
+
+open($file, "<", $filename) or die "Can't open $filename: $!";
+my $index = 1;
+while (my $line = <$file>) {
+    while ($line =~ /\\begin\{chunk\}\{([\w.]+)\}/g) {
+        $codeblocks{$1}{line} = $index+1;
+    }
+    $index++;
+}
+
+sub printchunk {
+    my ($chunk, $indent) = @_;
+
+    die "Chunk $chunk not found." if (!exists($codeblocks{$chunk}));
+
+    die "Cyclic reference found: $chunk" if $codeblocks{$chunk}{printing};
+    $codeblocks{$chunk}{printing} = 1;
+
+    my $localines = 1;
+    print $linetext =~ s/$changetext/$codeblocks{$chunk}{line}/gr, "\n";
+    foreach my $line (split(/\n/, $codeblocks{$chunk}{source})) {
+        if ($line =~ /([\s\t\h]*)\\getchunk\{([\w.]+)\}/) {
+            eval {
+                printchunk($2, $1); #$1 contains indent and $2 contains chunkname
+                print $linetext =~ s/$changetext/@{[$codeblocks{$chunk}{line} + $localines]}/gr, "\n";
+                1;
+            } or do {
+                if (rindex($@, "Cyclic reference found:", 0) == 0) {
+                    $@ =~ /(.+?)( at .*)/s;
+                    die "$1 <- $chunk";
+                }
+                die $@;
+            }
+        } else {
+            print $indent, $line, "\n";
+        }
+        $localines++;
+    }
+
+    $codeblocks{$chunk}{printing} = undef;
+    return 0;
+}
+printchunk($chunkname, "");


Property changes on: trunk/Build/source/texk/texlive/linked_scripts/clojure-pamphlet/pamphletangler
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: trunk/Build/source/texk/texlive/linked_scripts/scripts.lst
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/scripts.lst	2019-08-23 21:14:18 UTC (rev 51943)
+++ trunk/Build/source/texk/texlive/linked_scripts/scripts.lst	2019-08-23 22:51:26 UTC (rev 51944)
@@ -45,6 +45,7 @@
 cachepic/cachepic.tlu
 checkcites/checkcites.lua
 cjk-gs-integrate/cjk-gs-integrate.pl
+clojure-pamphlet/pamphletangler
 cluttex/cluttex.lua
 context/perl/mptopdf.pl
 convbkmk/convbkmk.rb

Added: trunk/Master/bin/aarch64-linux/pamphletangler
===================================================================
--- trunk/Master/bin/aarch64-linux/pamphletangler	                        (rev 0)
+++ trunk/Master/bin/aarch64-linux/pamphletangler	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/clojure-pamphlet/pamphletangler
\ No newline at end of file


Property changes on: trunk/Master/bin/aarch64-linux/pamphletangler
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/amd64-freebsd/pamphletangler
===================================================================
--- trunk/Master/bin/amd64-freebsd/pamphletangler	                        (rev 0)
+++ trunk/Master/bin/amd64-freebsd/pamphletangler	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/clojure-pamphlet/pamphletangler
\ No newline at end of file


Property changes on: trunk/Master/bin/amd64-freebsd/pamphletangler
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/amd64-netbsd/pamphletangler
===================================================================
--- trunk/Master/bin/amd64-netbsd/pamphletangler	                        (rev 0)
+++ trunk/Master/bin/amd64-netbsd/pamphletangler	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/clojure-pamphlet/pamphletangler
\ No newline at end of file


Property changes on: trunk/Master/bin/amd64-netbsd/pamphletangler
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/armhf-linux/pamphletangler
===================================================================
--- trunk/Master/bin/armhf-linux/pamphletangler	                        (rev 0)
+++ trunk/Master/bin/armhf-linux/pamphletangler	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/clojure-pamphlet/pamphletangler
\ No newline at end of file


Property changes on: trunk/Master/bin/armhf-linux/pamphletangler
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-cygwin/pamphletangler
===================================================================
--- trunk/Master/bin/i386-cygwin/pamphletangler	                        (rev 0)
+++ trunk/Master/bin/i386-cygwin/pamphletangler	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/clojure-pamphlet/pamphletangler
\ No newline at end of file


Property changes on: trunk/Master/bin/i386-cygwin/pamphletangler
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-freebsd/pamphletangler
===================================================================
--- trunk/Master/bin/i386-freebsd/pamphletangler	                        (rev 0)
+++ trunk/Master/bin/i386-freebsd/pamphletangler	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/clojure-pamphlet/pamphletangler
\ No newline at end of file


Property changes on: trunk/Master/bin/i386-freebsd/pamphletangler
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-linux/pamphletangler
===================================================================
--- trunk/Master/bin/i386-linux/pamphletangler	                        (rev 0)
+++ trunk/Master/bin/i386-linux/pamphletangler	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/clojure-pamphlet/pamphletangler
\ No newline at end of file


Property changes on: trunk/Master/bin/i386-linux/pamphletangler
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-netbsd/pamphletangler
===================================================================
--- trunk/Master/bin/i386-netbsd/pamphletangler	                        (rev 0)
+++ trunk/Master/bin/i386-netbsd/pamphletangler	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/clojure-pamphlet/pamphletangler
\ No newline at end of file


Property changes on: trunk/Master/bin/i386-netbsd/pamphletangler
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/i386-solaris/pamphletangler
===================================================================
--- trunk/Master/bin/i386-solaris/pamphletangler	                        (rev 0)
+++ trunk/Master/bin/i386-solaris/pamphletangler	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/clojure-pamphlet/pamphletangler
\ No newline at end of file


Property changes on: trunk/Master/bin/i386-solaris/pamphletangler
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/win32/pamphletangler.exe
===================================================================
(Binary files differ)

Index: trunk/Master/bin/win32/pamphletangler.exe
===================================================================
--- trunk/Master/bin/win32/pamphletangler.exe	2019-08-23 21:14:18 UTC (rev 51943)
+++ trunk/Master/bin/win32/pamphletangler.exe	2019-08-23 22:51:26 UTC (rev 51944)

Property changes on: trunk/Master/bin/win32/pamphletangler.exe
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Added: trunk/Master/bin/x86_64-cygwin/pamphletangler
===================================================================
--- trunk/Master/bin/x86_64-cygwin/pamphletangler	                        (rev 0)
+++ trunk/Master/bin/x86_64-cygwin/pamphletangler	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/clojure-pamphlet/pamphletangler
\ No newline at end of file


Property changes on: trunk/Master/bin/x86_64-cygwin/pamphletangler
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/x86_64-darwin/pamphletangler
===================================================================
--- trunk/Master/bin/x86_64-darwin/pamphletangler	                        (rev 0)
+++ trunk/Master/bin/x86_64-darwin/pamphletangler	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/clojure-pamphlet/pamphletangler
\ No newline at end of file


Property changes on: trunk/Master/bin/x86_64-darwin/pamphletangler
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/x86_64-darwinlegacy/pamphletangler
===================================================================
--- trunk/Master/bin/x86_64-darwinlegacy/pamphletangler	                        (rev 0)
+++ trunk/Master/bin/x86_64-darwinlegacy/pamphletangler	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/clojure-pamphlet/pamphletangler
\ No newline at end of file


Property changes on: trunk/Master/bin/x86_64-darwinlegacy/pamphletangler
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/x86_64-linux/pamphletangler
===================================================================
--- trunk/Master/bin/x86_64-linux/pamphletangler	                        (rev 0)
+++ trunk/Master/bin/x86_64-linux/pamphletangler	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/clojure-pamphlet/pamphletangler
\ No newline at end of file


Property changes on: trunk/Master/bin/x86_64-linux/pamphletangler
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/x86_64-linuxmusl/pamphletangler
===================================================================
--- trunk/Master/bin/x86_64-linuxmusl/pamphletangler	                        (rev 0)
+++ trunk/Master/bin/x86_64-linuxmusl/pamphletangler	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/clojure-pamphlet/pamphletangler
\ No newline at end of file


Property changes on: trunk/Master/bin/x86_64-linuxmusl/pamphletangler
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/bin/x86_64-solaris/pamphletangler
===================================================================
--- trunk/Master/bin/x86_64-solaris/pamphletangler	                        (rev 0)
+++ trunk/Master/bin/x86_64-solaris/pamphletangler	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1 @@
+link ../../texmf-dist/scripts/clojure-pamphlet/pamphletangler
\ No newline at end of file


Property changes on: trunk/Master/bin/x86_64-solaris/pamphletangler
___________________________________________________________________
Added: svn:special
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/support/clojure-pamphlet/README
===================================================================
--- trunk/Master/texmf-dist/doc/support/clojure-pamphlet/README	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/support/clojure-pamphlet/README	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1,38 @@
+CLOJURE PAMPHLET SYSTEM
+===========
+
+The clojure pamphlet system is a system based on the clojure literate
+system. In the clojure's pamphlet system you have your main LaTeX
+file, which can be compiled regularly. This file contains
+documentation and source code (just like in other forms of literate
+programming). This code snippets are wrapped in the 'chunk'
+environment, hence they can be recognized by the tangler in order to
+extract them. Chunks can be included inside each other by the
+'getchunk' command (which will be typesetted acordingly). Finally, you
+run your LaTeX file through the tangler and get your desired chunk of
+code.
+
+See the INSTALL file for detailed information about how to configure
+and install the tangler.
+ This tangler is a program that takes a pamphlet latex file (A simple
+latex file with special commands in it, see the latex clojure-pamphlet
+package manual page) and a code section and outputs the specified code
+section adding the chunks that are needed (and can be in any other
+part of the document).
+
+-----
+
+Copyright (C) 2019, Ernesto Lanchares Sanchez.
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 3, or (at your option)
+any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.


Property changes on: trunk/Master/texmf-dist/doc/support/clojure-pamphlet/README
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/support/clojure-pamphlet/clojure-pamphlet_guide.pdf
===================================================================
(Binary files differ)

Index: trunk/Master/texmf-dist/doc/support/clojure-pamphlet/clojure-pamphlet_guide.pdf
===================================================================
--- trunk/Master/texmf-dist/doc/support/clojure-pamphlet/clojure-pamphlet_guide.pdf	2019-08-23 21:14:18 UTC (rev 51943)
+++ trunk/Master/texmf-dist/doc/support/clojure-pamphlet/clojure-pamphlet_guide.pdf	2019-08-23 22:51:26 UTC (rev 51944)

Property changes on: trunk/Master/texmf-dist/doc/support/clojure-pamphlet/clojure-pamphlet_guide.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/support/clojure-pamphlet/pamphletangler.1
===================================================================
--- trunk/Master/texmf-dist/doc/support/clojure-pamphlet/pamphletangler.1	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/support/clojure-pamphlet/pamphletangler.1	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1,204 @@
+.\" Automatically generated by Pod::Man 4.11 (Pod::Simple 3.35)
+.\"
+.\" Standard preamble:
+.\" ========================================================================
+.de Sp \" Vertical space (when we can't use .PP)
+.if t .sp .5v
+.if n .sp
+..
+.de Vb \" Begin verbatim text
+.ft CW
+.nf
+.ne \\$1
+..
+.de Ve \" End verbatim text
+.ft R
+.fi
+..
+.\" Set up some character translations and predefined strings.  \*(-- will
+.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
+.\" double quote, and \*(R" will give a right double quote.  \*(C+ will
+.\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
+.\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
+.\" nothing in troff, for use with C<>.
+.tr \(*W-
+.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
+.ie n \{\
+.    ds -- \(*W-
+.    ds PI pi
+.    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
+.    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
+.    ds L" ""
+.    ds R" ""
+.    ds C` ""
+.    ds C' ""
+'br\}
+.el\{\
+.    ds -- \|\(em\|
+.    ds PI \(*p
+.    ds L" ``
+.    ds R" ''
+.    ds C`
+.    ds C'
+'br\}
+.\"
+.\" Escape single quotes in literal strings from groff's Unicode transform.
+.ie \n(.g .ds Aq \(aq
+.el       .ds Aq '
+.\"
+.\" If the F register is >0, we'll generate index entries on stderr for
+.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
+.\" entries marked with X<> in POD.  Of course, you'll have to process the
+.\" output yourself in some meaningful fashion.
+.\"
+.\" Avoid warning from groff about undefined register 'F'.
+.de IX
+..
+.nr rF 0
+.if \n(.g .if rF .nr rF 1
+.if (\n(rF:(\n(.g==0)) \{\
+.    if \nF \{\
+.        de IX
+.        tm Index:\\$1\t\\n%\t"\\$2"
+..
+.        if !\nF==2 \{\
+.            nr % 0
+.            nr F 2
+.        \}
+.    \}
+.\}
+.rr rF
+.\"
+.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
+.\" Fear.  Run.  Save yourself.  No user-serviceable parts.
+.    \" fudge factors for nroff and troff
+.if n \{\
+.    ds #H 0
+.    ds #V .8m
+.    ds #F .3m
+.    ds #[ \f1
+.    ds #] \fP
+.\}
+.if t \{\
+.    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
+.    ds #V .6m
+.    ds #F 0
+.    ds #[ \&
+.    ds #] \&
+.\}
+.    \" simple accents for nroff and troff
+.if n \{\
+.    ds ' \&
+.    ds ` \&
+.    ds ^ \&
+.    ds , \&
+.    ds ~ ~
+.    ds /
+.\}
+.if t \{\
+.    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
+.    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
+.    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
+.    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
+.    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
+.    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
+.\}
+.    \" troff and (daisy-wheel) nroff accents
+.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
+.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
+.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
+.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
+.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
+.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
+.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
+.ds ae a\h'-(\w'a'u*4/10)'e
+.ds Ae A\h'-(\w'A'u*4/10)'E
+.    \" corrections for vroff
+.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
+.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
+.    \" for low resolution devices (crt and lpr)
+.if \n(.H>23 .if \n(.V>19 \
+\{\
+.    ds : e
+.    ds 8 ss
+.    ds o a
+.    ds d- d\h'-1'\(ga
+.    ds D- D\h'-1'\(hy
+.    ds th \o'bp'
+.    ds Th \o'LP'
+.    ds ae ae
+.    ds Ae AE
+.\}
+.rm #[ #] #H #V #F C
+.\" ========================================================================
+.\"
+.IX Title "PAMPHLETANGLER 1"
+.TH PAMPHLETANGLER 1 "2019-08-23" "clojure-pamphlet" "Ernesto Lanchares"
+.\" For nroff, turn off justification.  Always turn off hyphenation; it makes
+.\" way too many mistakes in technical documents.
+.if n .ad l
+.nh
+.SH "NAME"
+pamphletangler \- Extract code bits from LaTeX pamphlet files.
+.SH "SYNOPSIS"
+.IX Header "SYNOPSIS"
+\&\fBpamphletangler\fR [\s-1OPTION...\s0] \fI\s-1FILE\s0\fR \fI\s-1CHUNKNAME\s0\fR
+.SH "DESCRIPTION"
+.IX Header "DESCRIPTION"
+The  clojure  pamphlet  system is a system based on the clojure literate
+system.  In the clojure's pamphlet system you have your main LaTeX file, which
+can be compiled regularly. This file contains documentation and source code
+(just like in other forms of literate programming). This code snippets are
+wrapped in the 'chunk' environment, hence they can be recognized by the tangler
+in order  to  extract  them.  Chunks can be included inside each other by the
+\&'getchunk' command (which will be typesetted acordingly). Finally, you run your
+LaTeX file through the tangler and get your desired chunk of code.
+.SH "OPTIONS"
+.IX Header "OPTIONS"
+.IP "\-L, \-\-line=linetext" 29
+.IX Item "-L, --line=linetext"
+If set, this text will be inserted after jumps of lines, changing the string
+inside \*(L"changetext\*(R" for the line number. This is used so that error report
+refers to pamphlet line number instead of output line number
+.IP "\-C, \-\-change=changetext" 29
+.IX Item "-C, --change=changetext"
+Defaults to \*(L"{}\*(R" this is the text that will be replaced with the line number if
+the linetext option is specified
+.IP "\-?, \-\-help" 29
+.IX Item "-?, --help"
+Give this help list
+.IP "\-\-usage" 29
+.IX Item "--usage"
+Give a short usage message
+.IP "\-\-man" 29
+.IX Item "--man"
+Print manual page
+.IP "\-V, \-\-version" 29
+.IX Item "-V, --version"
+Print program version
+.SH "LICENSE"
+.IX Header "LICENSE"
+Copyright (C) 2019 Ernesto Lanchares Sanchez.
+.PP
+.Vb 5
+\&   The clojure\-pamphlet tagler is free software; you can redistribute
+\&   it and/or modify it under the terms of the GNU Lesser General
+\&   Public License as published by the Free Software Foundation;
+\&   either version 3 of the License, or (at your option) any later
+\&   version.
+\&
+\&  The clojure\-pamphlet tangler is distributed in the hope that it
+\&  will be useful, but WITHOUT ANY WARRANTY; without even the implied
+\&  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+\&  See the GNU Lesser General Public License for more details.
+\&
+\&  You should have received a copy of the GNU Lesser General Public
+\&  License along with this program; if not, see
+\&  L<http://www.gnu.org/licenses/>.
+.Ve
+.SH "AUTHOR"
+.IX Header "AUTHOR"
+Ernesto Lanchares <e.lancha98 at gmail.com>
+.SH "BUGS"
+.IX Header "BUGS"
+Report bugs to e.lancha98 at gmail.com


Property changes on: trunk/Master/texmf-dist/doc/support/clojure-pamphlet/pamphletangler.1
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/scripts/clojure-pamphlet/pamphletangler
===================================================================
--- trunk/Master/texmf-dist/scripts/clojure-pamphlet/pamphletangler	                        (rev 0)
+++ trunk/Master/texmf-dist/scripts/clojure-pamphlet/pamphletangler	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1,191 @@
+#!/usr/bin/perl -w
+
+=head1 NAME
+
+pamphletangler - Extract code bits from LaTeX pamphlet files.
+
+=cut
+
+=head1 SYNOPSIS
+
+B<pamphletangler> [OPTION...] I<FILE> I<CHUNKNAME>
+
+=cut
+
+=head1 DESCRIPTION
+
+The  clojure  pamphlet  system is a system based on the clojure literate
+system.  In the clojure's pamphlet system you have your main LaTeX file, which
+can be compiled regularly. This file contains documentation and source code
+(just like in other forms of literate programming). This code snippets are
+wrapped in the 'chunk' environment, hence they can be recognized by the tangler
+in order  to  extract  them.  Chunks can be included inside each other by the
+'getchunk' command (which will be typesetted acordingly). Finally, you run your
+LaTeX file through the tangler and get your desired chunk of code.
+
+=cut
+
+=head1 OPTIONS
+
+=over 29
+
+=item -L, --line=linetext
+
+If set, this text will be inserted after jumps of lines, changing the string
+inside "changetext" for the line number. This is used so that error report
+refers to pamphlet line number instead of output line number
+
+=item -C, --change=changetext
+
+Defaults to "{}" this is the text that will be replaced with the line number if
+the linetext option is specified
+
+=item -?, --help
+
+Give this help list
+
+=item --usage
+
+Give a short usage message
+
+=item --man
+
+Print manual page
+
+=item -V, --version
+
+Print program version
+
+=back
+
+=head1 LICENSE
+
+Copyright (C) 2019 Ernesto Lanchares Sanchez.
+
+   The clojure-pamphlet tagler is free software; you can redistribute
+   it and/or modify it under the terms of the GNU Lesser General
+   Public License as published by the Free Software Foundation;
+   either version 3 of the License, or (at your option) any later
+   version.
+
+  The clojure-pamphlet tangler is distributed in the hope that it
+  will be useful, but WITHOUT ANY WARRANTY; without even the implied
+  warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+  See the GNU Lesser General Public License for more details.
+
+  You should have received a copy of the GNU Lesser General Public
+  License along with this program; if not, see
+  L<http://www.gnu.org/licenses/>.
+
+
+=head1 AUTHOR
+
+Ernesto Lanchares <e.lancha98 at gmail.com>
+
+=head1 BUGS
+
+Report bugs to e.lancha98 at gmail.com
+
+=cut
+
+use strict;
+use warnings;
+use Getopt::Long;
+use Pod::Usage qw(pod2usage);
+use vars qw/$VERSION/;
+
+BEGIN { $VERSION = '1.2' }
+
+my $linetext = "";
+my $changetext = "{}";
+my $filename;
+my $chunkname;
+
+OPTS: {
+    GetOptions(
+        'usage' => sub { pod2usage( -verbose => 99, -sections => [ qw(SYNOPSIS) ]); },
+        'help|?' => sub { pod2usage( -verbose => 99, -sections => [ qw(SYNOPSIS DESCRIPTION OPTIONS BUGS) ]); },
+        'man' => sub { pod2usage( -verbose => 2) },
+        'version|V' => sub { print "$VERSION\n"; exit; },
+        'line|L=s' => \$linetext,
+        'change|C=s' => \$changetext
+    );
+
+
+#pod
+    while ( my ($option, $value, $pretty) = Getopt::Mixed::nextOption() ) {
+        $linetext = $value if $option eq 'L';
+        if( $option eq 'V' ) {
+            print "$VERSION\n";
+            exit;
+        }
+        if ($option eq '?') {
+            pod2usage( -verbose => 99, -sections => [ qw(SYNOPSIS OPTIONS BUGS) ]);
+            exit;
+        }
+        if ($option eq 'man') {
+            pod2usage( -verbose => 2 );
+            exit;
+        }
+        $linetext = $value if $option eq 'L';
+        $changetext = $value if $option eq 'C';
+    }
+#cut
+
+    pod2usage( -message => "[ERROR]: Invalid number of arguments." )
+        if scalar(@ARGV) != 2;
+    $filename = shift;
+    $chunkname = shift;
+}
+
+open(my $file, "<", $filename) or die "Can't open $filename: $!";
+
+my $file_contents = do { local $/; <$file> };
+my %codeblocks;
+
+while ($file_contents =~ /\\begin\{chunk\}\{([\w.]+)\}[\s\h\t]*\n?(.*?)\n?[\s\t\h]*\\end\{chunk\}/sg) {
+    $codeblocks{$1} = { source => $2, printing => undef };
+}
+
+open($file, "<", $filename) or die "Can't open $filename: $!";
+my $index = 1;
+while (my $line = <$file>) {
+    while ($line =~ /\\begin\{chunk\}\{([\w.]+)\}/g) {
+        $codeblocks{$1}{line} = $index+1;
+    }
+    $index++;
+}
+
+sub printchunk {
+    my ($chunk, $indent) = @_;
+
+    die "Chunk $chunk not found." if (!exists($codeblocks{$chunk}));
+
+    die "Cyclic reference found: $chunk" if $codeblocks{$chunk}{printing};
+    $codeblocks{$chunk}{printing} = 1;
+
+    my $localines = 1;
+    print $linetext =~ s/$changetext/$codeblocks{$chunk}{line}/gr, "\n";
+    foreach my $line (split(/\n/, $codeblocks{$chunk}{source})) {
+        if ($line =~ /([\s\t\h]*)\\getchunk\{([\w.]+)\}/) {
+            eval {
+                printchunk($2, $1); #$1 contains indent and $2 contains chunkname
+                print $linetext =~ s/$changetext/@{[$codeblocks{$chunk}{line} + $localines]}/gr, "\n";
+                1;
+            } or do {
+                if (rindex($@, "Cyclic reference found:", 0) == 0) {
+                    $@ =~ /(.+?)( at .*)/s;
+                    die "$1 <- $chunk";
+                }
+                die $@;
+            }
+        } else {
+            print $indent, $line, "\n";
+        }
+        $localines++;
+    }
+
+    $codeblocks{$chunk}{printing} = undef;
+    return 0;
+}
+printchunk($chunkname, "");


Property changes on: trunk/Master/texmf-dist/scripts/clojure-pamphlet/pamphletangler
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/support/clojure-pamphlet/clojure-pamphlet.dtx
===================================================================
--- trunk/Master/texmf-dist/source/support/clojure-pamphlet/clojure-pamphlet.dtx	                        (rev 0)
+++ trunk/Master/texmf-dist/source/support/clojure-pamphlet/clojure-pamphlet.dtx	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1,339 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2019 by Lanchares Sanchez, Ernesto
+%
+% This file may be distributed and/or modified under the
+% conditions of the GNU General Public License as published by
+% the Free Software Foundation; either version 3, or (at your option)
+% any later version.
+%
+% This program is distributed in the hope that it will be useful,
+% but WITHOUT ANY WARRANTY; without even the implied warranty of
+% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+% GNU General Public License for more details.
+%
+% You should have received a copy of the GNU General Public License
+% along with this program.  If not, see <http://www.gnu.org/licenses/>.
+%
+% \fi
+%
+% \iffalse
+%<package>\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+%<package>\ProvidesPackage{clojure-pamphlet}[2019/07/08 v1.o .dtx clojure pamphlet file]
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{clojure-pamphlet}
+\usepackage{hyperref}
+\usepackage{csquotes}
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+\begin{document}
+    \DocInput{clojure-pamphlet.dtx}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{175}
+%
+% \CharacterTable
+%   {Upper-case    \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+%   Lower-case    \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+%   Digits        \0\1\2\3\4\5\6\7\8\9
+%   Exclamation   \!     Double quote  \"     Hash (number) \#
+%   Dollar        \$     Percent       \%     Ampersand     \&
+%   Acute accent  \'     Left paren    \(     Right paren   \)
+%   Asterisk      \*     Plus          \+     Comma         \,
+%   Minus         \-     Point         \.     Solidus       \/
+%   Colon         \:     Semicolon     \;     Less than     \<
+%   Equals        \=     Greater than  \>     Question mark \?
+%   Commercial at \@     Left bracket  \[     Backslash     \\
+%   Right bracket \]     Circumflex    \^     Underscore    \_
+%   Grave accent  \`     Left brace    \{     Vertical bar  \|
+%   Right brace   \}     Tilde         \~}
+%
+% \changes{v1.0}{2019/07/14}{Initial version}
+%
+% \GetFileInfo{clojure-pamphlet.sty}
+% 
+% \DoNotIndex{\bgroup,\egoup,\ ,\advance,\begin,\bf,\big,\closeout,\csname}
+% \DoNotIndex{\def,\do,\edef,\else,\end,\endcsname,\endinput,\expandafter}
+% \DoNotIndex{\fi,\global,\hbox,\hskip,\hyperlink,\hypertarget,\if,\ifcsname}
+% \DoNotIndex{\ifdefined,\iffalse,\iftrue,\immediate,\it,\jobname,\label,\let}
+% \DoNotIndex{\lstnewenvironment,\lstset,\nameref,\newcommand,\newenvironment}
+% \DoNotIndex{\newline,\newwrite,\next,\noindent,\openout,\relax,\string,\the}
+% \DoNotIndex{\unexpanded,\write,\xdef,\\,\{,\},\@for,\@input,\@empty}
+% \DoNotIndex{\@currentlabelname}
+%
+% \title{The \textsf{clojure-pamphlet} package\thanks{This document
+%   corresponds to \textsf{clojure-pamphlet}~\fileversion,
+%   dated~\filedate.}}
+% \author{Ernesto Lanchares Sanchez\\ \texttt{e.lancha98 at gmail.com}}
+%
+% \maketitle
+%
+% \begin{abstract}
+%   A package to make beautiful literate programming documents. The system is
+%   based on clojure's pamphelt files.
+% \end{abstract}
+%
+% \section{Introduction}
+%
+% \href{http://www.literateprogramming.com/}{Literate Programming} is a
+% programming paradigm that changes the goal of the program:
+% \begin{displayquote}
+%   Let us change our traditional attitude to the construction of programs:
+%   Instead of imagining that our main task is to instruct a computer what to do,
+%   let us concentrate rather on explaining to human beings what we want a
+%   computer to do.
+% \end{displayquote}
+% 
+% Since it's creation, many systems have been created to accomplish this goal,
+% systems like \texttt{WEB}, \texttt{CWEB}, \texttt{noweb}, \ldots This systems
+% all share the same structure: There is one source file and two programs
+% needed, one that extracts the code to be compiled and other that extracts the
+% literature (usually a \TeX/\LaTeX file) to be compiled.
+%
+% This is the reason that we preffer clojure's system where there is one \LaTeX
+% source file that can be compiled and one program to extract the code to be
+% compiled. Although the clojure system is fine as it is, we think the resulting
+% documentation can be a bit prettier hence this package. The difference in
+% using this package or the clojure system as a developer is non-existent,
+% however we think the documentation with our system is a bit more readable. It
+% also automaticly adds hyperlinks to the output in order to make it easier to
+% navigate when viewing in a computer.
+%
+% \section{Usage}
+%
+% The \texttt{clojure-pamphlet} system is designed to be as simple as possible,
+% so this package only provides one environment and one command. The system is
+% based arround code chunks. This chunks are the part of the documents that
+% contain code and can be extracted. The chunks also contain a name so that they
+% can be referenced in the document and in other chunk blocks. The name is also
+% needed for the tangler to extract the chunk.
+%
+% \subsection{\texttt{chunk} environment}
+% \DescribeEnv{chunk}
+% The chunk environment is used to define code blocks. This code blocks have a
+% name and are what the tangler will actually output. It is based on the
+% \href{https://www.ctan.org/pkg/listings}{listings} package, so all style
+% formats that yo can apply to \texttt{lstlisting} environments, you can also
+% apply to chunk environments by simply using the command \texttt{lstset}.
+%
+% Here's an example of a code usage and it's output
+% \begin{verbatim}
+% \begin{chunk}{main}
+% int main(int argc, char* argv[]) {
+%   printf("Hello World.\n");
+% }
+% \end{chunk}
+% \end{verbatim}
+%
+% \iffalse
+%<*test>
+% \fi
+\begin{chunk}{main}
+ int main(int argc, char* argv[]) {
+   printf("Hello World.\n");
+ }
+\end{chunk}
+% \iffalse
+%</test>
+% \fi
+%
+% \DescribeMacro{\getchunk}
+% Also, inside the \texttt{chunk} environment, you can use the \verb|\getchunk|
+% command, which includes the referenced chunk at that exact same spot. The \verb|\getchunk|
+% command requires to be in it's own separate line. Let's
+% illustrate this with an example:
+%
+% \begin{verbatim}
+% \begin{chunk}{onechunk}
+% CHUNK ONE
+% \end{chunk}
+% \begin{chunk}{otherchunk}
+% PREVIOUS
+% \getchunk{onechunk}
+% POST
+% \end{chunk}
+% \end{verbatim}
+%
+% \iffalse
+%<*test>
+% \fi
+\begin{chunk}{print}
+printf("Hello World");
+\end{chunk}
+\begin{chunk}{main}
+int main(int argc, char* argv[]) {
+    \getchunk{print}
+}
+\end{chunk}
+% \iffalse
+%</test>
+% \fi
+%
+% \subsection{The tangler}
+% The tangler is designed to be as simple to use as possible. You just need
+% to provide it with a \LaTeX \texttt{clojure-pamphlet} file and a code chunk to
+% extract. Then the tangler will output the code to be compiled in the standard
+% output. For example in order to extract the main chunk of code we will need to
+% run
+% \begin{verbatim}
+% pamphletangler [filename.tex] main
+% \end{verbatim}
+%
+% And the output will be
+% \begin{verbatim}
+% int main(int argc, char* argv[]) {
+%       printf("Hello World");
+% }
+% \end{verbatim}
+%
+% \StopEventually{\PrintIndex}
+%
+% \section{Implementation}
+%
+% We need to import the listings package to create the code blocks
+% and the hyperref package to create the clickable links
+%    \begin{macrocode}
+\RequirePackage{listings}
+\RequirePackage{hyperref}
+%    \end{macrocode}
+%
+% We need to import the referecences, a.k.a. the ``used by'' text
+% below the code
+%    \begin{macrocode}
+\@input{\jobname.pam}
+%    \end{macrocode}
+%
+% We initialize a counter, needed to define a unique csname in each
+% \verb|getchunk| call.
+%    \begin{macrocode}
+\newcount\pam at references
+%    \end{macrocode}
+%
+% We define commands to write and compare the \{ and \} characters
+% Solution from \url{https://tex.stackexchange.com/a/47453}
+%    \begin{macrocode}
+\edef\wbgroup{\iftrue\string{\else}\fi}
+\edef\wegroup{\iffalse{\else\string}\fi}
+%    \end{macrocode}
+% \begin{macro}{\pam at storetext}
+% This macro is used inside getchunkenv. This will consume tokens
+% and store them inside \verb|pam at tex| macro until it reads a ``\}'' macro
+% (defined by lst), then it calls the \verb|\getchunk| command on the stored
+% text. Finally, calls the ``\}'' macro needed by lst to finish processing the
+% code block.
+%    \begin{macrocode}
+\def\pam at storetext#1{%
+    \expandafter\if\string#1\wegroup%
+        \getchunk{\pam at text}%
+        #1%
+    \else%
+        \edef\pam at text{\pam at text#1}%
+        \expandafter\pam at storetext% This expandafter is so the input of
+                                  % \pam at storetext is not \fi
+    \fi%
+}
+%    \end{macrocode}
+% \end{macro}
+% \begin{environment}{pam at getchunkenv}
+% This environment is not ment to be used outside this document and it's only
+% purpose it's to wrap the \verb|pam at storetext| macro inside an environment.
+%    \begin{macrocode}
+\newenvironment{pam at getchunkenv}{\def\pam at text{}%
+\expandafter\pam at storetext}{}
+%    \end{macrocode}
+% \end{environment}
+%
+% \begin{environment}{chunk}
+% Here is the main environment.
+%    \begin{macrocode}
+\lstnewenvironment{chunk}[1]{%
+    \hypertarget{#1}%
+    {\ }\newline\noindent%
+    \hbox{\hskip 2.0cm}{\bf --- #1 ---}%
+    \edef\@currentlabelname{#1}%
+    \lstset{alsodigit={.-},alsoletter={\\}}%
+    \lstset{escapebegin=\begin{pam at getchunkenv}}%
+    \lstset{escapeend=\end{pam at getchunkenv}}%
+    \lstset{escapeinside={\\getchunk\{}{\}}}%
+}{
+    {\ }\newline\noindent%
+    \hbox{\hskip 2.0cm}%
+    {\it ---\csname referenced#1\endcsname---}%
+}
+%    \end{macrocode}
+% \end{environment}
+% \begin{macro}{\getchunk}
+% We run into the most complicated command. First, we preparate the label so it
+% can be referenced and place the text.
+%    \begin{macrocode}
+\newcommand{\getchunk}[1]{%
+    {\big<}\hyperlink{#1}{#1}{\big>}%
+    \edef\pam at label{reference-\the\pam at references}%
+    \label{\pam at label}%
+    \ifcsname used#1\endcsname\else%
+        \expandafter\def\csname used#1\endcsname{Used by}%
+    \fi%
+%    \end{macrocode}
+% Here we expand the Used by command two times, this is so we fully expand
+% the \verb|\csname| and the command but we don't expand the refs
+%    \begin{macrocode}
+    \edef\pam at tmp{\unexpanded\expandafter\expandafter%
+    \expandafter{\csname used#1\endcsname}}%
+%    \end{macrocode}
+% We add to the used by command, adding a space and the new reference. Also, we
+% increase the global counter and mark the chunk as referenced.
+%    \begin{macrocode}
+\expandafter\xdef\csname used#1\expandafter\endcsname\expandafter{%
+    \expandafter\unexpanded\expandafter{\pam at tmp},%
+    \ \unexpanded\expandafter{\expandafter\nameref\expandafter{\pam at label}}%
+}%
+\global\advance\pam at references 1\relax%
+\ifdefined\pam at chunks%
+    \xdef\pam at chunks{\pam at chunks,#1}%
+\else%
+    \xdef\pam at chunks{#1}%
+\fi%
+}
+%    \end{macrocode}
+% \end{macro}
+% Here we will write the used by commands and references. This will only be
+% done if there are chunks referenced.
+%    \begin{macrocode}
+\AtEndDocument{%
+    \ifdefined\pam at chunks%
+       \newwrite\@pamfile%
+       \immediate\openout\@pamfile=\jobname.pam%
+%    \end{macrocode}
+% Then, we loop through the list and write out the used by commands
+% but the list may contain duplicates so we need to account for it.
+% loop based on \url{https://tex.stackexchange.com/a/16695}
+%    \begin{macrocode}
+\@for\next:=\pam at chunks\do{%
+    \ifcsname lstel@\next\endcsname%
+    \else%
+        \expandafter\let\csname lstel@\next\endcsname\@empty%
+        \immediate\write\@pamfile{%
+            \unexpanded{\expandafter\def\csname }%
+            referenced\next\unexpanded{\endcsname}%
+            \wbgroup%
+            \unexpanded\expandafter\expandafter\expandafter%
+            {\csname used\next\endcsname}%
+            \wegroup%
+        }%
+    \fi%
+}%
+%    \end{macrocode}
+% Finally, we close the auxiliary file
+%    \begin{macrocode}
+       \immediate\closeout\@pamfile%
+   \fi%
+}
+\endinput
+%    \end{macrocode}
+% \Finale
+\endinput


Property changes on: trunk/Master/texmf-dist/source/support/clojure-pamphlet/clojure-pamphlet.dtx
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/source/support/clojure-pamphlet/clojure-pamphlet.ins
===================================================================
--- trunk/Master/texmf-dist/source/support/clojure-pamphlet/clojure-pamphlet.ins	                        (rev 0)
+++ trunk/Master/texmf-dist/source/support/clojure-pamphlet/clojure-pamphlet.ins	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1,54 @@
+%%
+%% Copyright (C) 2019 by Lanchares Sanchez, Ernesto
+%%
+%% This file may be distributed and/or modified under the
+%% conditions of the GNU General Public License as published by
+%% the Free Software Foundation; either version 3, or (at your option)
+%% any later version.
+%%
+%% This program is distributed in the hope that it will be useful,
+%% but WITHOUT ANY WARRANTY; without even the implied warranty of
+%% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+%% GNU General Public License for more details.
+%%
+%% You should have received a copy of the GNU General Public License
+%% along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+\input docstrip.tex
+\keepsilent
+\usedir{/tex/latex/pam}
+
+\preamble
+This is a generated file.
+
+Copyright (C) 2019 by Lanchares Sanchez, Ernesto
+
+This file may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either
+version 1.3 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.3 or later is part of all distributions of
+LaTeX version 2005/12/01 or later.
+\endpreamble
+
+\generate{\file{clojure-pamphlet.sty}{\from{clojure-pamphlet.dtx}{package}}}
+
+\obeyspaces
+\Msg{****************************************************}
+\Msg{*                                                  *}
+\Msg{* To finish the installation you have to move the  *}
+\Msg{* following file into a directory searched by TeX: *}
+\Msg{*                                                  *}
+\Msg{*     clojure-pamphlet.sty                         *}
+\Msg{*                                                  *}
+\Msg{* To produce the documentation run the file        *}
+\Msg{* clojure-pamphelt.dtx through LaTeX.              *}
+\Msg{*                                                  *}
+\Msg{* Happy TeXing!                                    *}
+\Msg{*                                                  *}
+\Msg{****************************************************}
+
+\endbatchfile

Added: trunk/Master/texmf-dist/tex/latex/clojure-pamphlet/clojure-pamphlet.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/clojure-pamphlet/clojure-pamphlet.sty	                        (rev 0)
+++ trunk/Master/texmf-dist/tex/latex/clojure-pamphlet/clojure-pamphlet.sty	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1,98 @@
+%%
+%% This is file `clojure-pamphlet.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% clojure-pamphlet.dtx  (with options: `package')
+%% This is a generated file.
+%% 
+%% Copyright (C) 2019 by Lanchares Sanchez, Ernesto
+%% 
+%% This file may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3 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.3 or later is part of all distributions of
+%% LaTeX version 2005/12/01 or later.
+\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+\ProvidesPackage{clojure-pamphlet}[2019/07/08 v1.o .dtx clojure pamphlet file]
+\RequirePackage{listings}
+\RequirePackage{hyperref}
+\@input{\jobname.pam}
+\newcount\pam at references
+\edef\wbgroup{\iftrue\string{\else}\fi}
+\edef\wegroup{\iffalse{\else\string}\fi}
+\def\pam at storetext#1{%
+    \expandafter\if\string#1\wegroup%
+        \getchunk{\pam at text}%
+        #1%
+    \else%
+        \edef\pam at text{\pam at text#1}%
+        \expandafter\pam at storetext% This expandafter is so the input of
+                                  % \pam at storetext is not \fi
+    \fi%
+}
+\newenvironment{pam at getchunkenv}{\def\pam at text{}%
+\expandafter\pam at storetext}{}
+\lstnewenvironment{chunk}[1]{%
+    \hypertarget{#1}%
+    {\ }\newline\noindent%
+    \hbox{\hskip 2.0cm}{\bf --- #1 ---}%
+    \edef\@currentlabelname{#1}%
+    \lstset{alsodigit={.-},alsoletter={\\}}%
+    \lstset{escapebegin=\begin{pam at getchunkenv}}%
+    \lstset{escapeend=\end{pam at getchunkenv}}%
+    \lstset{escapeinside={\\getchunk\{}{\}}}%
+}{
+    {\ }\newline\noindent%
+    \hbox{\hskip 2.0cm}%
+    {\it ---\csname referenced#1\endcsname---}%
+}
+\newcommand{\getchunk}[1]{%
+    {\big<}\hyperlink{#1}{#1}{\big>}%
+    \edef\pam at label{reference-\the\pam at references}%
+    \label{\pam at label}%
+    \ifcsname used#1\endcsname\else%
+        \expandafter\def\csname used#1\endcsname{Used by}%
+    \fi%
+    \edef\pam at tmp{\unexpanded\expandafter\expandafter%
+    \expandafter{\csname used#1\endcsname}}%
+\expandafter\xdef\csname used#1\expandafter\endcsname\expandafter{%
+    \expandafter\unexpanded\expandafter{\pam at tmp},%
+    \ \unexpanded\expandafter{\expandafter\nameref\expandafter{\pam at label}}%
+}%
+\global\advance\pam at references 1\relax%
+\ifdefined\pam at chunks%
+    \xdef\pam at chunks{\pam at chunks,#1}%
+\else%
+    \xdef\pam at chunks{#1}%
+\fi%
+}
+\AtEndDocument{%
+    \ifdefined\pam at chunks%
+       \newwrite\@pamfile%
+       \immediate\openout\@pamfile=\jobname.pam%
+\@for\next:=\pam at chunks\do{%
+    \ifcsname lstel@\next\endcsname%
+    \else%
+        \expandafter\let\csname lstel@\next\endcsname\@empty%
+        \immediate\write\@pamfile{%
+            \unexpanded{\expandafter\def\csname }%
+            referenced\next\unexpanded{\endcsname}%
+            \wbgroup%
+            \unexpanded\expandafter\expandafter\expandafter%
+            {\csname used\next\endcsname}%
+            \wegroup%
+        }%
+    \fi%
+}%
+       \immediate\closeout\@pamfile%
+   \fi%
+}
+\endinput
+%%
+%% End of file `clojure-pamphlet.sty'.


Property changes on: trunk/Master/texmf-dist/tex/latex/clojure-pamphlet/clojure-pamphlet.sty
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/tlpkg/bin/tlpkg-ctan-check
===================================================================
--- trunk/Master/tlpkg/bin/tlpkg-ctan-check	2019-08-23 21:14:18 UTC (rev 51943)
+++ trunk/Master/tlpkg/bin/tlpkg-ctan-check	2019-08-23 22:51:26 UTC (rev 51944)
@@ -161,7 +161,7 @@
     cite citeall citeref cje cjhebrew cjk cjk-gs-integrate cjk-ko cjkpunct
     classics classpack classicthesis
     cleanthesis clearsans clefval cleveref clipboard
-    clock cloze clrdblpg clrscode clrscode3e clrstrip cluttex
+    clock clojure-pamphlet cloze clrdblpg clrscode clrscode3e clrstrip cluttex
     cm cm-lgc cm-mf-extra-bold cm-super cm-unicode
     cmap cmarrows cmbright cmcyr
     cmdstring cmdtrack cmexb cmextra cmll cmpica cmpj cmsd cmsrb cmtiup

Modified: trunk/Master/tlpkg/libexec/ctan2tds
===================================================================
--- trunk/Master/tlpkg/libexec/ctan2tds	2019-08-23 21:14:18 UTC (rev 51943)
+++ trunk/Master/tlpkg/libexec/ctan2tds	2019-08-23 22:51:26 UTC (rev 51944)
@@ -263,7 +263,6 @@
  'clarendo',            "die 'skipping, nonfree font'",
  'classico',            "die 'skipping, nonfree font'",
  'clock',               "&MAKEflatten",
- 'clojure-pamphlet',	"die 'skipping, compilation'",
  'cm',			"die 'skipping, frozen'",
  'cm-lgc',              "&MAKEcmlgc",
  'cm-super',            "&MAKEflatten",
@@ -1363,6 +1362,7 @@
  'apa6'                 => '&PREHOOK_apa6',
  'cals'                 => '&PREHOOK_cals',
  'chess'                => '&PREHOOK_chess',
+ 'clojure-pamphlet'     => '&PREHOOK_clojure_pamphlet',
  'cluttex'		=> '&PREHOOK_cluttex',
  'cm'			=> '&PREHOOK_cm',
  'cm-super'             => '&PREHOOK_cm_super',
@@ -3039,6 +3039,7 @@
  'checkcites'           => '\.lua$',
  'checklistings'        => '\.sh$',
  'cjk-gs-integrate'     => '\.pl$',
+ 'clojure-pamphlet'	=> 'pamphletangler$',
  'cluttex'		=> 'cluttex\.lua$', # moved by prehook.
  'convbkmk'             => '\.rb$',
  'crossrefware'		=> '\.pl$',
@@ -3423,7 +3424,7 @@
     $standarddocfmt = $standardsourcefmt = $standardfmt = "xelatex";
     $guess = "$standarddocfmt for fmt/docfmt/srcfmt";
 
-  } elsif ($ctan_dir =~ m!/(CTAN|tex-archive)/support/!) {
+  } elsif ($ctan_dir =~ m!/(CTAN|tex-archive)/(support|web)/!) {
     $standarddocfmt = $standardsourcefmt = "support";
     $guess = "$standarddocfmt for docfmt/srcfmt";
 
@@ -5446,6 +5447,11 @@
   &SYSTEM ("$RM -rf inputs pkfonts.zip");
 }
 
+sub PREHOOK_clojure_pamphlet {
+  print "PREHOOK_$package - make .1 with pod2man\n";
+  &prehook_pod2man ("Ernesto Lanchares", "pamphletangler");
+}
+
 sub PREHOOK_cluttex {
   print "PREHOOK_$package - mv */cluttex for specialscripts\n";
   &SYSTEM ("$MV bin/cluttex cluttex.lua");

Added: trunk/Master/tlpkg/tlpsrc/clojure-pamphlet.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/clojure-pamphlet.tlpsrc	                        (rev 0)
+++ trunk/Master/tlpkg/tlpsrc/clojure-pamphlet.tlpsrc	2019-08-23 22:51:26 UTC (rev 51944)
@@ -0,0 +1,3 @@
+runpattern d texmf-dist/tex/latex/${PKGNAME}
+runpattern f texmf-dist/scripts/${PKGNAME}/pamphletangler
+binpattern f bin/${ARCH}/pamphletangler

Modified: trunk/Master/tlpkg/tlpsrc/collection-binextra.tlpsrc
===================================================================
--- trunk/Master/tlpkg/tlpsrc/collection-binextra.tlpsrc	2019-08-23 21:14:18 UTC (rev 51943)
+++ trunk/Master/tlpkg/tlpsrc/collection-binextra.tlpsrc	2019-08-23 22:51:26 UTC (rev 51944)
@@ -15,6 +15,7 @@
 depend bundledoc
 depend checklistings
 depend chktex
+depend clojure-pamphlet
 depend cluttex
 depend ctan-o-mat
 depend ctan_chk



More information about the tex-live-commits mailing list