summaryrefslogtreecommitdiff
path: root/support/texplate/scripts
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-01-15 03:00:56 +0000
committerNorbert Preining <norbert@preining.info>2020-01-15 03:00:56 +0000
commit3bd863734612dc2fe9c5c7c1405358ffb1228afb (patch)
tree9f7d421c227b998debe92dac90f4cf8634a8f94f /support/texplate/scripts
parentb3225c4301e7724de481f410444fef5463799b9d (diff)
CTAN sync 202001150300
Diffstat (limited to 'support/texplate/scripts')
-rw-r--r--support/texplate/scripts/templates/article.toml54
-rw-r--r--support/texplate/scripts/templates/standalone.toml45
-rw-r--r--support/texplate/scripts/texplate.sh17
3 files changed, 116 insertions, 0 deletions
diff --git a/support/texplate/scripts/templates/article.toml b/support/texplate/scripts/templates/article.toml
new file mode 100644
index 0000000000..53f7796762
--- /dev/null
+++ b/support/texplate/scripts/templates/article.toml
@@ -0,0 +1,54 @@
+name = "article"
+description = """
+A simple template for the default article class, with support for new
+engines (with fontspec fallback), babel languages, geometry options,
+generic packages, and TikZ and corresponding libraries.
+"""
+authors = [ "Island of TeX" ]
+requirements = []
+document = '''
+\documentclass#if($options)[$options]#{end}{article}
+
+#if ($xetex || $luatex)
+\usepackage{fontspec}
+#else
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+#end
+#if ($geometry)
+
+\usepackage[$geometry]{geometry}
+#end
+#if ($babel)
+#if (!$geometry)
+
+#end
+\usepackage[$babel]{babel}
+#end
+#if ($packages)
+
+#foreach ($package in $packages)
+\usepackage{$package}
+#end
+#end
+#if ($tikz)
+
+\usepackage{tikz}
+#if ($libraries)
+#foreach ($library in $libraries)
+\usetikzlibrary{$library}
+#end
+#end
+#end
+
+\begin{document}
+
+\end{document}
+'''
+
+[handlers]
+xetex = "to-boolean"
+luatex = "to-boolean"
+tikz = "to-boolean"
+libraries = "to-csv-list"
+packages = "to-csv-list"
diff --git a/support/texplate/scripts/templates/standalone.toml b/support/texplate/scripts/templates/standalone.toml
new file mode 100644
index 0000000000..dd8daea65f
--- /dev/null
+++ b/support/texplate/scripts/templates/standalone.toml
@@ -0,0 +1,45 @@
+name = "standalone"
+description = """
+A simple template for the standalone class, with support for
+class options, new engines (with fontspec fallback), list of
+packages, and TikZ and corresponding libraries.
+"""
+authors = [ "Island of TeX" ]
+requirements = []
+document = '''
+\documentclass#if($options)[$options]#{end}{standalone}
+
+#if ($xetex || $luatex)
+\usepackage{fontspec}
+#else
+\usepackage[T1]{fontenc}
+\usepackage[utf8]{inputenc}
+#end
+#if ($packages)
+
+#foreach ($package in $packages)
+\usepackage{$package}
+#end
+#end
+#if ($tikz)
+
+\usepackage{tikz}
+#if ($libraries)
+#foreach ($library in $libraries)
+\usetikzlibrary{$library}
+#end
+#end
+#end
+
+\begin{document}
+
+\end{document}
+'''
+
+[handlers]
+xetex = "to-boolean"
+luatex = "to-boolean"
+tikz = "to-boolean"
+libraries = "to-csv-list"
+packages = "to-csv-list"
+
diff --git a/support/texplate/scripts/texplate.sh b/support/texplate/scripts/texplate.sh
new file mode 100644
index 0000000000..da64978037
--- /dev/null
+++ b/support/texplate/scripts/texplate.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+# Public domain. Originally written by Norbert Preining and Karl Berry, 2018.
+# Note from Paulo: this script provides better Cygwin support than our original
+# approach, so the team decided to use it as a proper wrapper for texplate as well.
+
+scriptname=`basename "$0"`
+jar="$scriptname.jar"
+jarpath=`kpsewhich --progname="$scriptname" --format=texmfscripts "$jar"`
+
+kernel=`uname -s 2>/dev/null`
+if echo "$kernel" | grep CYGWIN >/dev/null; then
+ CYGWIN_ROOT=`cygpath -w /`
+ export CYGWIN_ROOT
+ jarpath=`cygpath -w "$jarpath"`
+fi
+
+exec java -jar "$jarpath" "$@" \ No newline at end of file