[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/tempel 29f008f836 1/2: Add TeX matrix example
From: |
ELPA Syncer |
Subject: |
[elpa] externals/tempel 29f008f836 1/2: Add TeX matrix example |
Date: |
Sat, 16 Nov 2024 03:59:07 -0500 (EST) |
branch: externals/tempel
commit 29f008f836d761cc1ef09de66f9cfc189549ba02
Author: Daniel Mendler <mail@daniel-mendler.de>
Commit: Daniel Mendler <mail@daniel-mendler.de>
Add TeX matrix example
---
README.org | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/README.org b/README.org
index 690fcd79c8..46fd9c8d53 100644
--- a/README.org
+++ b/README.org
@@ -358,7 +358,7 @@ custom element ~*~ to repeat a template a number of times:
(add-to-list 'tempel-user-elements #'tempel-repeat)
#+end_src
-The ~*~ custom element can be used to expand dynamic tables:
+The ~*~ custom element can be used to expand dynamic tables or LaTeX matrices:
#+begin_src emacs-lisp
(table (p (read-number "Rows: ") rows noinsert)
@@ -366,6 +366,13 @@ The ~*~ custom element can be used to expand dynamic
tables:
"| " (p " ") (* (1- cols) " | " (p " ")) " |" n
"|" (* cols "----|") n
(* rows "| " (p " ") (* (1- cols) " | " (p " ")) " |" n))
+
+(matrix (p (read-number "Rows: ") rows noinsert)
+ (p (read-number "Cols: ") cols noinsert)
+ "\\begin{" (p "pmatrix" type) "}" n
+ (* (1- rows) (p " ") (* (1- cols) " & " (p " ")) "\\\\" n)
+ (p " ") (* (1- cols) " & " (p " ")) n
+ "\\end{" type "}")
#+end_src
* Adding template sources