summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/struktex/struktex.el
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/struktex/struktex.el')
-rw-r--r--Master/texmf-dist/doc/latex/struktex/struktex.el28
1 files changed, 17 insertions, 11 deletions
diff --git a/Master/texmf-dist/doc/latex/struktex/struktex.el b/Master/texmf-dist/doc/latex/struktex/struktex.el
index 1545000103a..13a65de84d1 100644
--- a/Master/texmf-dist/doc/latex/struktex/struktex.el
+++ b/Master/texmf-dist/doc/latex/struktex/struktex.el
@@ -78,26 +78,32 @@
(format "[%s]" title)))))
(defun TeX-mac-case (macro)
- "Insert \case with all arguments.
+ "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 text of the first case"
+condition, and the texts for the different cases"
(let ((height (read-string "Height (optional): "))
(slope (read-string "Slope: "))
(number (read-string "Number of cases: "))
(condition (read-string "Condition: "))
- (text (read-string "Text: ")))
+ (text (read-string "Case no. 1: "))
+ (count 1)
+ )
+ (setq number-int (string-to-number number))
(insert (concat (if (not (zerop (length height)))
(format "[%s]" height))
(format "{%s}{%s}{%s}{%s}"
slope number condition text)))
- (end-of-line)
- (newline-and-indent)
- (newline-and-indent)
- (insert "\\switch{ }")
- (end-of-line)
- (newline-and-indent)
- (newline-and-indent)
- (insert "\\caseend")))
+ (while (< count number-int)
+ (end-of-line)
+ (newline-and-indent)
+ (newline-and-indent)
+ (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")))
(defun TeX-mac-forever (macro)
"Insert \forever-block with all arguments.