summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/struktex/struktex.el
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-06-25 21:51:59 +0000
committerKarl Berry <karl@freefriends.org>2017-06-25 21:51:59 +0000
commit08ac04da4c2782bf535e914c4cbb56795854b3b1 (patch)
tree60e697e6e73d897291945e58c386f36bb4c33a36 /Master/texmf-dist/doc/latex/struktex/struktex.el
parent0baef83f46e61ff1d06c181a1bd8e0df785ff73e (diff)
struktex (25jun17)
git-svn-id: svn://tug.org/texlive/trunk@44699 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/latex/struktex/struktex.el')
-rw-r--r--Master/texmf-dist/doc/latex/struktex/struktex.el72
1 files changed, 47 insertions, 25 deletions
diff --git a/Master/texmf-dist/doc/latex/struktex/struktex.el b/Master/texmf-dist/doc/latex/struktex/struktex.el
index 05946964105..110f8ab27fd 100644
--- a/Master/texmf-dist/doc/latex/struktex/struktex.el
+++ b/Master/texmf-dist/doc/latex/struktex/struktex.el
@@ -1,22 +1,23 @@
;;; struktex.el --- AUCTeX style for `struktex.sty'
-;; Copyright (C) 2006 Free Software Foundation, Inc.
+;; Copyright (C) 2006 - 2017 Free Software Foundation, Inc.
;; Author: J. Hoffmann <j.hoffmann_(at)_fh-aachen.de>
;; Maintainer: j.hoffmann_(at)_fh-aachen.de
-;; Created: 2006/01/17
+;; Created: 2017/06/06
;; Keywords: tex
;;; Commentary:
;; This file adds support for `struktex.sty'
;;; Code:
+
(TeX-add-style-hook
"struktex"
(lambda ()
- ;; Add declaration to the list of environments which have an optional
- ;; argument for each item.
+ ;; Add declaration to the list of environments which have
+ ;; an optional argument for each item.
(add-to-list 'LaTeX-item-list
'("declaration" . LaTeX-item-argument))
(LaTeX-add-environments
@@ -37,6 +38,8 @@
'("exit" [ "Height" ] "What" )
'("forever" TeX-mac-forever)
"foreverend"
+ '("forallin" TeX-mac-forallin)
+ "forallin"
'("ifthenelse" TeX-mac-ifthenelse)
"change"
"ifend"
@@ -65,7 +68,8 @@
))
(defun LaTeX-env-struktogramm (environment)
- "Insert ENVIRONMENT with width, height specifications and optional title."
+ "Insert ENVIRONMENT with width, height specifications and
+optional title."
(let ((width (read-string "Width: "))
(height (read-string "Height: "))
(title (read-string "Title (optional): ")))
@@ -79,13 +83,14 @@
"Insert ENVIRONMENT with an optional title."
(let ((title (read-string "Title (optional): ")))
(LaTeX-insert-environment environment
- (if (not (zerop (length title)))
- (format "[%s]" title)))))
+ (if (not (zerop (length title)))
+ (format "[%s]" title)))))
(defun TeX-mac-case (macro)
- "Insert \\case with all arguments, the needed \\switch(es) and the final \\caseend.
-These are optional height and the required arguments slope, number of cases,
-condition, and the texts for the different cases"
+ "Insert \\case with all arguments, the needed \\switch(es) and
+the final \\caseend. These are optional height and the required
+arguments slope, number of cases, condition, and the texts for
+the different cases"
(let ((height (read-string "Height (optional): "))
(slope (read-string "Slope: "))
(number (read-string "Number of cases: "))
@@ -105,10 +110,24 @@ condition, and the texts for the different cases"
(setq prompt (format "Case no. %d: " (+ 1 count)))
(insert (format "\\switch{%s}" (read-string prompt)))
(setq count (1+ count)))
- (end-of-line)
- (newline-and-indent)
- (newline-and-indent)
- (insert "\\caseend")))
+ (end-of-line)
+ (newline-and-indent)
+ (newline-and-indent)
+ (insert "\\caseend")))
+
+(defun TeX-mac-forallin (macro)
+ "Insert \\forallin-block with all arguments.
+This is the optional height and the description of the loop"
+ (let ((height (read-string "Height (optional): "))
+ (loop-description (read-string "Description of loop: ")))
+ (insert (concat (if (not (zerop (length height)))
+ (format "[%s]" height))
+ (format "{%s}"
+ loop-description)))
+ (end-of-line)
+ (newline-and-indent)
+ (newline-and-indent)
+ (insert "\\forallinend")))
(defun TeX-mac-forever (macro)
"Insert \\forever-block with all arguments.
@@ -123,8 +142,9 @@ This is only the optional height"
(defun TeX-mac-ifthenelse (macro)
"Insert \\ifthenelse with all arguments.
-These are optional height and the required arguments left slope, right slope,
-condition, and the possible values of the condition"
+These are optional height and the required arguments
+left slope, right slope, condition, and the possible
+values of the condition"
(let ((height (read-string "Height (optional): "))
(lslope (read-string "Left slope: "))
(rslope (read-string "Right slope: "))
@@ -134,7 +154,8 @@ condition, and the possible values of the condition"
(insert (concat (if (not (zerop (length height)))
(format "[%s]" height))
(format "{%s}{%s}{%s}{%s}{%s}"
- lslope rslope condition conditionvl conditionvr)))
+ lslope rslope condition conditionvl
+ conditionvr)))
(end-of-line)
(newline-and-indent)
(newline-and-indent)
@@ -145,9 +166,10 @@ condition, and the possible values of the condition"
(insert "\\ifend")))
(defun TeX-mac-inparallel (macro)
- "Insert \\inparallel with all arguments, the needed \\task(es) and the final \\inparallelend.
-These are optional height and the required arguments number of tasks
-and the descriptions for the parallel tasks"
+ "Insert \\inparallel with all arguments, the needed \\task(s)
+and the final \\inparallelend. These are optional height and the
+required arguments number of tasks and the descriptions for the
+parallel tasks"
(let ((height (read-string "Height (optional): "))
(number (read-string "Number of parallel tasks: "))
(text (read-string "Task no. 1: "))
@@ -164,10 +186,10 @@ and the descriptions for the parallel tasks"
(setq prompt (format "Task no. %d: " (+ 1 count)))
(insert (format "\\task{%s}" (read-string prompt)))
(setq count (1+ count)))
- (end-of-line)
- (newline-and-indent)
- (newline-and-indent)
- (insert "\\inparallelend")))
+ (end-of-line)
+ (newline-and-indent)
+ (newline-and-indent)
+ (insert "\\inparallelend")))
(defun TeX-mac-until (macro)
"Insert \\until with all arguments.
@@ -197,7 +219,7 @@ These are the optional height and the required argument condition"
(defvar LaTeX-struktex-package-options '("curves" "draft" "emlines" "final"
"pict2e" "anygradient" "verification"
- "nofiller")
+ "nofiller" "debug" "outer")
"Package options for the struktex package.")
;;; struktex.el ends here.