| 1 |
;;; youngtab.el - Support for the user macros of the youngtab package |
| 2 |
;; by Volker B"orchers, <[email protected]> |
| 3 |
;; This program can be redistributed and/or modified under the terms |
| 4 |
;; of the LaTeX Project Public License Distributed from CTAN |
| 5 |
;; archives in directory macros/latex/base/lppl.txt; either |
| 6 |
;; version 1 of the License, or any later version. |
| 7 |
|
| 8 |
;;-((and (not( = elisp favorite-language)) (concat "lucky" "it" "works" (!)))) |
| 9 |
|
| 10 |
(TeX-add-style-hook "youngtab" |
| 11 |
(function |
| 12 |
(lambda () |
| 13 |
(TeX-add-symbols |
| 14 |
'("Yboxdim" "Box Dimension") |
| 15 |
'("Ylinethick" "Line Thickness") |
| 16 |
'("Yinterspace" "Space between 2 Tableaux") |
| 17 |
'("Yvcentermath" TeX-arg-young-bool) |
| 18 |
'("Ystdtext" TeX-arg-young-bool) |
| 19 |
'("yng" (TeX-arg-young t)) |
| 20 |
'("young" TeX-arg-young) |
| 21 |
)))) |
| 22 |
|
| 23 |
(defun TeX-arg-young (optional &optional isyng) |
| 24 |
"Insert macros young and yng. |
| 25 |
Ask for the rows of a tableau. |
| 26 |
Do not accept non-numbers for yng." |
| 27 |
(let ((num 0)) |
| 28 |
(insert "(") |
| 29 |
(while (>= num 0) |
| 30 |
(setq num (1+ num)) |
| 31 |
(setq row (read-input (concat (int-to-string num) ". Row: "))) |
| 32 |
(if (zerop (length row)) |
| 33 |
(setq num -1) |
| 34 |
(if (and isyng (<= (string-to-int row) 0)) |
| 35 |
(setq num (- num 1)) |
| 36 |
(insert (if (> num 1) "," "") row))))) |
| 37 |
(insert ")")) |
| 38 |
|
| 39 |
(defun TeX-arg-young-bool (optional) |
| 40 |
"To handle the switches Yvcentermath and Ystdtext" |
| 41 |
(insert (if (y-or-n-p "true(y) or false(n)? ") "1" "0"))) |
| 42 |
|