summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/scripts/jmlr
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-09-21 21:06:09 +0000
committerKarl Berry <karl@freefriends.org>2020-09-21 21:06:09 +0000
commitc4e7accf23af922ed9c7321ea715b61ed98e9ba3 (patch)
treeff0e1350466dd7f1de361516ef9d92b11775081c /Master/texmf-dist/scripts/jmlr
parent7419f0453ebadbb5a020ffa1c5686220ed212df4 (diff)
jmlr (21sep20)
git-svn-id: svn://tug.org/texlive/trunk@56395 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts/jmlr')
-rwxr-xr-xMaster/texmf-dist/scripts/jmlr/makejmlrbook69
1 files changed, 41 insertions, 28 deletions
diff --git a/Master/texmf-dist/scripts/jmlr/makejmlrbook b/Master/texmf-dist/scripts/jmlr/makejmlrbook
index 252ce3e5497..544943fc754 100755
--- a/Master/texmf-dist/scripts/jmlr/makejmlrbook
+++ b/Master/texmf-dist/scripts/jmlr/makejmlrbook
@@ -2,17 +2,23 @@
# File : makejmlrbook
# Author : Nicola L C Talbot
# Date : 22nd March 2010
-# Last Modified : 30 May 2012
-# Version : 0.32
+# Last Modified : 21st September 2020
+# Version : 0.33
# Description : Given the name of a document using the
# jmlrbook class file, this script runs
# pdflatex (and possibly bibtex) on the
# imported articles and the main document.
-# http://theoval.cmp.uea.ac.uk/~nlct/
+# http://www.dickimaw-books.com/
#
# This file is distributed as part of the jmlr LaTeX bundle.
#
-# Copyright (c) 2006 Nicola L.C. Talbot
+# *****
+# This script is now obsolete and will be removed in later
+# distributions. Use MakeJmlrBookGUI instead:
+# https://www.dickimaw-books.com/software/makejmlrbookgui
+# *****
+#
+# Copyright (c) 2006-2020 Nicola L.C. Talbot
# This work may be distributed and/or modified under the
# conditions of the LaTeX Project Public License, either version 1.3
# of this license or any later version.
@@ -31,7 +37,7 @@ use File::Copy;
use Cwd;
use strict;
-my $version = "0.32 (2012-05-28)";
+my $version = "0.33 (2020-09-21)";
my $eol = "\n";
my $dd = '/';
@@ -60,6 +66,15 @@ my $extractpreface = 0; # v0.3 added
# without executing them)
my $execute = 1; # v0.31 added
+my $appname = basename($0);
+
+warn <<__END_OBSOLETE_WARN;
+Warning: $appname is now obsolete and will be removed in later
+distributions. Use MakeJmlrBookGUI instead:
+https://www.dickimaw-books.com/software/makejmlrbookgui
+
+__END_OBSOLETE_WARN
+
unless(&GetOptions(
"online!" => \$online,
"print!" => \$print,
@@ -80,8 +95,6 @@ unless(&GetOptions(
die "Use --help for help\n";
}
-my $appname = basename($0);
-
if ($showhelp)
{
die "$appname version $version Copyright (c) 2010 Nicola L C Talbot\n",
@@ -179,7 +192,7 @@ foreach my $import (@imports)
my $pages = $pagerefs{$label}->{'start'}.'--'
. $pagerefs{$label}->{'end'};
- $import->{'author'}=~s/\\articlepagesref\s*{$label}/$pages/;
+ $import->{'author'}=~s/\\articlepagesref\s*\{$label\}/$pages/;
}
if ($html)
@@ -390,7 +403,7 @@ foreach my $import (@imports)
# This doesn't handle complicated cases, such as
# the author using \abstract ... \endabstract
# or commenting out the abstract with conditionals
- if (/^([^%]*)\\end{abstract}/)
+ if (/^([^%]*)\\end\{abstract\}/)
{
$text .= $&;
last;
@@ -435,7 +448,7 @@ foreach my $import (@imports)
# v0.31 modified \footnote to set the footnote text as in-line
# parenthesis.
- $text=~s/^([^%\n\r\f]*)\\begin{document}/
+ $text=~s/^([^%\n\r\f]*)\\begin\{document\}/
$prebegindoc$&$begindoc
\\HCode{<div id="content">}
\\renewcommand{\\footnote}[2][]{ (\#2)}%$eol
@@ -585,7 +598,7 @@ if ($html and $execute)
s/^([^%]*)\\documentclass\s*/$&\[html\]/;
}
- s/^([^%]*)\\begin{document}/
+ s/^([^%]*)\\begin\{document\}/
\\hypersetup{draft}$eol$&\\HCode{<div id="content">}/x;
if (/^([^%]*)\\maketitle/)
@@ -601,7 +614,7 @@ if ($html and $execute)
# Find the book logo
if ($preamble
- =~/\\logo\s*(?:\[[^\]]*\])?\s*{(%\s*\n)?\\includegraphics\s*(\[[^\]]*\])?{([^}]*)}}/m)
+ =~/\\logo\s*(?:\[[^\]]*\])?\s*\{(%\s*\n)?\\includegraphics\s*(\[[^\]]*\])?\{([^}]*)\}\}/m)
{
my $texpath = $3;
my $orgtexpath = $texpath;
@@ -644,13 +657,13 @@ if ($html and $execute)
if ($logourl)
{
$preamble=~s/
- \\includegraphics(\[[^\]]*\])?{$orgtexpath}/
+ \\includegraphics(\[[^\]]*\])?\{$orgtexpath\}/
\\href{$logourl}{\\includegraphics${1}{$img$ext}}/mgx;
}
else
{
$preamble=~s/
- \\includegraphics(\[[^\]]*\])?{$orgtexpath}/
+ \\includegraphics(\[[^\]]*\])?\{$orgtexpath\}/
\\includegraphics${1}{$img$ext}/mgx;
}
}
@@ -697,17 +710,17 @@ if ($html and $execute)
while (<TOC>)
{
- if (/^\\tocpart\s*{(.*)}\s*$/)
+ if (/^\\tocpart\s*\{(.*)\}\s*$/)
{
print OUTFD "\\begin{center}\\bfseries $1\\end{center}$eol";
}
- elsif (/\\contentsline\s*{papertitle}{(.*)}{[^{}]*}{[^{}]*}\s*$/)
+ elsif (/\\contentsline\s*\{papertitle\}\{(.*)\}\{[^{}]*\}\{[^{}]*\}\s*$/)
{
# v0.3 Changed by Olivier Chapelle to use description
# environment instead of paragraph break
print OUTFD "\\begin{description}\\item[\\normalfont $1]$eol";
}
- elsif (/\\contentsline\s*{chapterauthor}{(.*)}{[^{}]*}{[^{}]*}\s*$/)
+ elsif (/\\contentsline\s*\{chapterauthor\}\{(.*)\}\{[^{}]*\}\{[^{}]*\}\s*$/)
{
my $details = $1;
$details=~s/([^;]*);/\\textbf{\\emph{$1};}/;
@@ -716,7 +729,7 @@ if ($html and $execute)
my $pages = $pagerefs{$label}->{'start'}.'--'
. $pagerefs{$label}->{'end'};
- $details=~s/\\articlepagesref\s*{$label}/$pages/;
+ $details=~s/\\articlepagesref\s*\{$label\}/$pages/;
# v0.3 Changed by Olivier Chapelle to use newline instead of par
print OUTFD "$details\\newline$eol";
@@ -1110,7 +1123,7 @@ sub parsemainaux{
{
$main_bibdata = 1;
}
- elsif (/\\\@jmlr\@import{(.*)}{(.*)}{(.*)}/)
+ elsif (/\\\@jmlr\@import\{(.*)\}\{(.*)\}\{(.*)\}/)
{
my $import =
{
@@ -1123,18 +1136,18 @@ sub parsemainaux{
push @imports, $import;
}
- elsif (/\\contentsline\s*{chapterauthor}{(.*)}{}{}}\s*$/
+ elsif (/\\contentsline\s*\{chapterauthor\}\{(.*)\}\{\}\{\}}\s*$/
and $#imports > -1)
{
$imports[$#imports]->{'author'} = $1;
}
- elsif (/^\\newlabel\s*{([^}]*)jmlrstart}{{([^}]*)}{([^}]*)}/)
+ elsif (/^\\newlabel\s*\{([^\}]*)jmlrstart\}\{\{([^\}]*)\}\{([^\}]*)\}/)
{
my $label = $1;
$pagerefs{$label}->{'start'} = $3;
}
- elsif (/^\\newlabel\s*{([^}]*)jmlrend}{{([^}]*)}{([^}]*)}/)
+ elsif (/^\\newlabel\s*\{([^\}]*)jmlrend\}\{\{([^\}]*)\}\{([^\}]*)\}/)
{
my $label = $1;
@@ -1142,21 +1155,21 @@ sub parsemainaux{
}
elsif ($extractpreface) # v0.3 new
{
- if (/^\\\@prefacestart{([^}]*)}{(\d*)}/)
+ if (/^\\\@prefacestart\{([^\}]*)\}\{(\d*)\}/)
{
$preface_data->{'Start'} = $1;
$preface_data->{'StartArabic'} = $2;
}
- elsif (/^\\\@prefaceend{([^}]*)}/)
+ elsif (/^\\\@prefaceend\{([^\}]*)\}/)
{
$preface_data->{'End'} = $1;
}
- elsif (/^\\\@prefacefile{([^}]*)}{([^}]*)}/)
+ elsif (/^\\\@prefacefile\{([^\}]*)\}\{([^\}]*)\}/)
{
$preface_data->{'File'} = $1;
$preface_data->{'OutFile'} = $2;
}
- elsif (/^\\\@prefaceeditor{(.*)}/)
+ elsif (/^\\\@prefaceeditor\{(.*)\}/)
{
my $name = $1;
$name=~s/\\\\.*//;
@@ -1280,7 +1293,7 @@ sub createprefacefile{
# This is fairly primitive and works best when the begin
# and end of the environment are on their own line.
- if (/\\begin{preface}/)
+ if (/\\begin\{preface\}/)
{
print PREFOUT;
$scanning = 1;
@@ -1289,7 +1302,7 @@ sub createprefacefile{
{
print PREFOUT;
- last if /\\end{preface}/;
+ last if /\\end\{preface\}/;
}
}