support for EPTCS style with demo document;
authorwenzelm
Sun, 06 Nov 2022 22:17:28 +0100
changeset 76478 d84568379f3f
parent 76477 6e68ec0fdc48
child 76479 8ac1d83301b5
support for EPTCS style with demo document;
Admin/components/components.sha1
Admin/components/main
NEWS
doc/Contents
etc/build.props
src/Doc/Demo_EPTCS/Document.thy
src/Doc/Demo_EPTCS/ROOT
src/Doc/Demo_EPTCS/document/root.bib
src/Doc/Demo_EPTCS/document/root.tex
src/Doc/ROOTS
src/Pure/Admin/build_eptcs.scala
src/Pure/System/isabelle_tool.scala
--- a/Admin/components/components.sha1	Sun Nov 06 21:45:06 2022 +0100
+++ b/Admin/components/components.sha1	Sun Nov 06 22:17:28 2022 +0100
@@ -91,6 +91,7 @@
 6e63f9f354b8c06035952845b987080699a12d55 e-2.6-1.tar.gz
 a3bebab5df4294dac2dd7fd2065a94df00e0b3ff e-2.6.tar.gz
 239e7b8bebbfc29a1c5151e8fb261ffad44877f1 easychair-3.5.tar.gz
+4a3b4b4e0441c4498a0c71dc348f3538be589a15 eptcs-1.7.0.tar.gz
 6d34b18ca0aa1e10bab6413045d079188c0e2dfb exec_process-1.0.1.tar.gz
 8b9bffd10e396d965e815418295f2ee2849bea75 exec_process-1.0.2.tar.gz
 e6aada354da11e533af2dee3dcdd96c06479b053 exec_process-1.0.3.tar.gz
--- a/Admin/components/main	Sun Nov 06 21:45:06 2022 +0100
+++ b/Admin/components/main	Sun Nov 06 22:17:28 2022 +0100
@@ -7,6 +7,7 @@
 cvc4-1.8
 e-2.6-1
 easychair-3.5
+eptcs-1.7.0
 flatlaf-2.4
 foiltex-2.1.4b
 idea-icons-20210508
--- a/NEWS	Sun Nov 06 21:45:06 2022 +0100
+++ b/NEWS	Sun Nov 06 22:17:28 2022 +0100
@@ -13,6 +13,7 @@
 with demo documents in the regular Isabelle "doc" space:
 
   - Easychair as session "Demo_Easychair" / doc "demo_easychair"
+  - EPTCS as session "Demo_EPTCS" / doc "demo_eptcs"
   - FoilTeX as session "Demo_FoilTeX" / doc "demo_foiltex"
   - Dagstuhl LIPIcs style as session "Demo_LIPIcs" / doc "demo_lipics"
   - Springer LaTeX LNCS style as session "Demo_LLNCS" / doc "demo_llncs"
--- a/doc/Contents	Sun Nov 06 21:45:06 2022 +0100
+++ b/doc/Contents	Sun Nov 06 22:17:28 2022 +0100
@@ -20,6 +20,7 @@
 
 Demo Documents
   demo_easychair  Demo for Easychair style
+  demo_eptcs      Demo for EPTCS style
   demo_foiltex    Demo for FoilTeX: slides in LaTeX
   demo_lipics     Demo for Dagstuhl LIPIcs style
   demo_llncs      Demo for Springer LaTeX LNCS style
--- a/etc/build.props	Sun Nov 06 21:45:06 2022 +0100
+++ b/etc/build.props	Sun Nov 06 22:17:28 2022 +0100
@@ -17,6 +17,7 @@
   src/Pure/Admin/build_doc.scala \
   src/Pure/Admin/build_e.scala \
   src/Pure/Admin/build_easychair.scala \
+  src/Pure/Admin/build_eptcs.scala \
   src/Pure/Admin/build_foiltex.scala \
   src/Pure/Admin/build_fonts.scala \
   src/Pure/Admin/build_history.scala \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Doc/Demo_EPTCS/Document.thy	Sun Nov 06 22:17:28 2022 +0100
@@ -0,0 +1,64 @@
+theory Document
+  imports Main
+begin
+
+section \<open>Some section\<close>
+
+subsection \<open>Some subsection\<close>
+
+subsection \<open>Some subsubsection\<close>
+
+subsubsection \<open>Some subsubsubsection\<close>
+
+paragraph \<open>A paragraph.\<close>
+
+text \<open>Informal bla bla.\<close>
+
+definition "foo = True"  \<comment> \<open>side remark on \<^const>\<open>foo\<close>\<close>
+
+definition "bar = False"  \<comment> \<open>side remark on \<^const>\<open>bar\<close>\<close>
+
+lemma foo unfolding foo_def ..
+
+
+paragraph \<open>Another paragraph.\<close>
+
+text \<open>See also @{cite \<open>\S3\<close> "isabelle-system"}.\<close>
+
+
+section \<open>Formal proof of Cantor's theorem\<close>
+
+text_raw \<open>\isakeeptag{proof}\<close>
+text \<open>
+  Cantor's Theorem states that there is no surjection from
+  a set to its powerset.  The proof works by diagonalization.  E.g.\ see
+  \<^item> \<^url>\<open>http://mathworld.wolfram.com/CantorDiagonalMethod.html\<close>
+  \<^item> \<^url>\<open>https://en.wikipedia.org/wiki/Cantor's_diagonal_argument\<close>
+\<close>
+
+theorem Cantor: "\<nexists>f :: 'a \<Rightarrow> 'a set. \<forall>A. \<exists>x. A = f x"
+proof
+  assume "\<exists>f :: 'a \<Rightarrow> 'a set. \<forall>A. \<exists>x. A = f x"
+  then obtain f :: "'a \<Rightarrow> 'a set" where *: "\<forall>A. \<exists>x. A = f x" ..
+  let ?D = "{x. x \<notin> f x}"
+  from * obtain a where "?D = f a" by blast
+  moreover have "a \<in> ?D \<longleftrightarrow> a \<notin> f a" by blast
+  ultimately show False by blast
+qed
+
+
+subsection \<open>Lorem ipsum dolor\<close>
+
+text \<open>
+  Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec id ipsum
+  sapien. Vivamus malesuada enim nibh, a tristique nisi sodales ac. Praesent
+  ut sem consectetur, interdum tellus ac, sodales nulla. Quisque vel diam at
+  risus tempus tempor eget a tortor. Suspendisse potenti. Nulla erat lacus,
+  dignissim sed volutpat nec, feugiat non leo. Nunc blandit et justo sed
+  venenatis. Donec scelerisque placerat magna, et congue nulla convallis vel.
+  Cras tristique dolor consequat dolor tristique rutrum. Suspendisse ultrices
+  sem nibh, et suscipit felis ultricies at. Aliquam venenatis est vel nulla
+  efficitur ornare. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
+\<close>
+
+end
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Doc/Demo_EPTCS/ROOT	Sun Nov 06 22:17:28 2022 +0100
@@ -0,0 +1,15 @@
+chapter Doc  (*Isabelle documentation*)
+
+session Demo_EPTCS (doc) = HOL +
+  options [
+    document_variants = "demo_eptcs",  (*Isabelle documentation*)
+    document_build = "pdflatex"  (*or: omit option for LuaLaTeX*)
+  ]
+  theories
+    Document
+  document_files (in "$ISABELLE_EPTCS_HOME")
+    "eptcs.bst"
+    "eptcs.cls"
+  document_files
+    "root.bib"
+    "root.tex"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Doc/Demo_EPTCS/document/root.bib	Sun Nov 06 22:17:28 2022 +0100
@@ -0,0 +1,4 @@
+@manual{isabelle-system,
+  author = {Makarius Wenzel},
+  title = {The {Isabelle} System Manual},
+  note = {\url{https://isabelle.in.tum.de/doc/system.pdf}}}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Doc/Demo_EPTCS/document/root.tex	Sun Nov 06 22:17:28 2022 +0100
@@ -0,0 +1,37 @@
+\documentclass[submission,copyright,creativecommons]{eptcs}
+\usepackage[utf8]{inputenc}
+\usepackage{underscore}
+\usepackage[T1]{fontenc}
+
+\hypersetup{colorlinks=true,linkcolor=black,citecolor=black,filecolor=black,urlcolor=black,pdfpagelabels}
+
+\usepackage{amssymb}
+\usepackage{isabelle,isabellesym}\isabellestyle{it}
+
+\isadroptag{theory}
+\isafoldtag{proof}
+
+\providecommand{\event}{Isabelle}
+
+
+\begin{document}
+
+\title{Isabelle document preparation with EPTCS {\LaTeX} style}
+\def\titlerunning{Easychair style}
+\author{Makarius Wenzel
+  \institute{Augsburg, Germany \\ \url{https://sketis.net}}}
+\def\authorrunning{M. Wenzel}
+\maketitle
+
+\begin{abstract}
+Isabelle is a formal document preparation system. This example shows how to
+use it together with the Easychair style. See \url{http://style.eptcs.org} for
+further information.
+\end{abstract}
+
+\input{session}
+
+\bibliographystyle{eptcs}
+\bibliography{root}
+
+\end{document}
--- a/src/Doc/ROOTS	Sun Nov 06 21:45:06 2022 +0100
+++ b/src/Doc/ROOTS	Sun Nov 06 22:17:28 2022 +0100
@@ -1,4 +1,5 @@
 Demo_Easychair
+Demo_EPTCS
 Demo_FoilTeX
 Demo_LIPIcs
 Demo_LLNCS
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/Pure/Admin/build_eptcs.scala	Sun Nov 06 22:17:28 2022 +0100
@@ -0,0 +1,101 @@
+/*  Title:      Pure/Admin/build_eptcs.scala
+    Author:     Makarius
+
+Build Isabelle component for EPTCS style.
+
+See also:
+  - http://style.eptcs.org
+  - https://github.com/EPTCS/style/releases
+*/
+
+package isabelle
+
+
+object Build_EPTCS {
+  /* build eptcs component */
+
+  val default_url = "https://github.com/EPTCS/style/releases/download"
+  val default_version = "1.7.0"
+
+  def build_eptcs(
+    base_url: String = default_url,
+    version: String = default_version,
+    target_dir: Path = Path.current,
+    progress: Progress = new Progress
+  ): Unit = {
+    Isabelle_System.require_command("unzip", test = "-h")
+
+
+    /* component */
+
+    val component = "eptcs-" + version
+    val component_dir = Isabelle_System.new_directory(target_dir + Path.basic(component))
+    progress.echo("Component " + component_dir)
+
+
+    /* download */
+
+    val download_url = base_url + "/v" + version + "/eptcsstyle.zip"
+
+    Isabelle_System.with_tmp_file("download", ext = "zip") { download_file =>
+      Isabelle_System.download_file(download_url, download_file, progress = progress)
+      Isabelle_System.bash("unzip -x " + File.bash_path(download_file),
+        cwd = component_dir.file).check
+    }
+
+
+    /* settings */
+
+    val etc_dir = Isabelle_System.make_directory(component_dir + Path.basic("etc"))
+    File.write(etc_dir + Path.basic("settings"),
+      """# -*- shell-script -*- :mode=shellscript:
+
+ISABELLE_EPTCS_HOME="$COMPONENT"
+""")
+
+
+    /* README */
+
+    File.write(component_dir + Path.basic("README"),
+      """This is the EPTCS style from
+""" + download_url + """
+
+
+    Makarius
+    """ + Date.Format.date(Date.now()) + "\n")
+  }
+
+
+  /* Isabelle tool wrapper */
+
+  val isabelle_tool =
+    Isabelle_Tool("build_eptcs", "build component for EPTCS style",
+      Scala_Project.here,
+      { args =>
+        var target_dir = Path.current
+        var base_url = default_url
+        var version = default_version
+
+        val getopts = Getopts("""
+Usage: isabelle build_eptcs [OPTIONS]
+
+  Options are:
+    -D DIR       target directory (default ".")
+    -U URL       download URL (default: """" + default_url + """")
+    -V VERSION   version (default: """" + default_version + """")
+
+  Build component for EPTCS style.
+""",
+          "D:" -> (arg => target_dir = Path.explode(arg)),
+          "U:" -> (arg => base_url = arg),
+          "V:" -> (arg => version = arg))
+
+        val more_args = getopts(args)
+        if (more_args.nonEmpty) getopts.usage()
+
+        val progress = new Console_Progress()
+
+        build_eptcs(base_url = base_url, version = version, target_dir = target_dir,
+          progress = progress)
+      })
+}
--- a/src/Pure/System/isabelle_tool.scala	Sun Nov 06 21:45:06 2022 +0100
+++ b/src/Pure/System/isabelle_tool.scala	Sun Nov 06 22:17:28 2022 +0100
@@ -160,6 +160,7 @@
   Build_Doc.isabelle_tool,
   Build_E.isabelle_tool,
   Build_Easychair.isabelle_tool,
+  Build_EPTCS.isabelle_tool,
   Build_Foiltex.isabelle_tool,
   Build_Fonts.isabelle_tool,
   Build_JCEF.isabelle_tool,