diff -r c1b87d15774a -r f8b0367046bd lib/Tools/mkroot --- a/lib/Tools/mkroot Fri Nov 10 22:05:30 2017 +0100 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,201 +0,0 @@ -#!/usr/bin/env bash -# -# Author: Makarius -# -# DESCRIPTION: prepare session root directory - - -## diagnostics - -PRG="$(basename "$0")" - -function usage() -{ - echo - echo "Usage: isabelle $PRG [OPTIONS] [DIR]" - echo - echo " Options are:" - echo " -d enable document preparation" - echo " -n NAME alternative session name (default: DIR base name)" - echo - echo " Prepare session root DIR (default: current directory)." - echo - exit 1 -} - -function fail() -{ - echo "$1" >&2 - exit 2 -} - - -## process command line - -# options - -DOC="" -NAME="" - -while getopts "n:d" OPT -do - case "$OPT" in - d) - DOC="true" - ;; - n) - NAME="$OPTARG" - ;; - \?) - usage - ;; - esac -done - -shift $(($OPTIND - 1)) - - -# args - -if [ "$#" -eq 0 ]; then - DIR="." -elif [ "$#" -eq 1 ]; then - DIR="$1" - shift -else - usage -fi - - -## main - -mkdir -p "$DIR" || fail "Bad directory: \"$DIR\"" - -[ -z "$NAME" ] && NAME="$(basename "$(cd "$DIR"; pwd -P)")" - -[ -e "$DIR/ROOT" ] && fail "Cannot overwrite existing $DIR/ROOT" - -[ "$DOC" = true -a -e "$DIR/document" ] && \ - fail "Cannot overwrite existing $DIR/document" - -echo -echo "Preparing session \"$NAME\" in \"$DIR\"" - - -# ROOT - -echo " creating $DIR/ROOT" - -if [ "$DOC" = true ]; then - cat > "$DIR/ROOT" < "$DIR/ROOT" < "$DIR/document/root.tex" <, \, \, \, \, \, - %\, \, \, \, \, - %\, \, \ - -%\usepackage{eurosym} - %for \ - -%\usepackage[only,bigsqcap]{stmaryrd} - %for \ - -%\usepackage{eufrak} - %for \ ... \, \ ... \ (also included in amssymb) - -%\usepackage{textcomp} - %for \, \, \, \, \, - %\ - -% this should be the last package used -\usepackage{pdfsetup} - -% urls in roman style, theory text in math-similar italics -\urlstyle{rm} -\isabellestyle{it} - -% for uniform font size -%\renewcommand{\isastyle}{\isastyleminor} - - -\begin{document} - -\title{$TITLE} -\author{$AUTHOR} -\maketitle - -\tableofcontents - -% sane default for proof documents -\parindent 0pt\parskip 0.5ex - -% generated text of all theories -\input{session} - -% optional bibliography -%\bibliographystyle{abbrv} -%\bibliography{root} - -\end{document} - -%%% Local Variables: -%%% mode: latex -%%% TeX-master: t -%%% End: -EOF -fi - -# notes - -declare -a DIR_PARTS=($DIR) -if [ ${#DIR_PARTS[@]} = 1 ]; then - OPT_DIR="-D $DIR" -else - OPT_DIR="-D \"$DIR\"" -fi - -cat <