Skip to content

Commit 802eb7b

Browse files
committed
[203_34] map algo-state to \State in LaTeX export
1 parent 256852d commit 802eb7b

3 files changed

Lines changed: 30 additions & 0 deletions

File tree

TeXmacs/plugins/latex/progs/convert/latex/latex-define.scm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@
432432
(dueto (textup (textbf (!append "(" 1 ") "))))
433433
(op 1)
434434
(todo (!group (!append (color "red!75!black") "[To do: " 1 "]")))
435+
(algostate (!group "\\State " 1))
435436
(tmoutput 1)
436437
(tmerrput (!append (color "red!50!black") 1))
437438
(tmtiming (!append (hfill) (footnotesize) (color "black!50") 1 (par)))

TeXmacs/plugins/latex/progs/convert/latex/latex-texmacs-drd.scm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,7 @@
311311
dueto
312312
op
313313
todo
314+
algostate
314315
tmdate
315316
tmoutput
316317
tmerrput

TeXmacs/tests/203_34.scm

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2+
;;
3+
;; MODULE : 203_34.scm
4+
;; DESCRIPTION : Test LaTeX export of algo-state macro to standard \State command
5+
;; COPYRIGHT : (C) 2026
6+
;;
7+
;; This software falls under the GNU general public license version 3 or later.
8+
;; It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
9+
;; in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
10+
;;
11+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
12+
13+
(import (liii check))
14+
15+
(check-set-mode! 'report-failed)
16+
17+
(load "./TeXmacs/plugins/latex/progs/init-latex.scm")
18+
19+
(define (snippet->latex snippet opts)
20+
(serialize-latex (texmacs->latex snippet opts)))
21+
22+
(tm-define (test_203_34)
23+
(with result (snippet->latex '(algo-state "x = 0") '())
24+
(display* ";;; algo-state: " result "\n")
25+
(check (string-contains? result "\\State") => #t)
26+
(check (string-contains? result "\\algostate") => #f)))
27+
28+
(check-report)

0 commit comments

Comments
 (0)