auctex-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: exam new patch to add support for the choice, environment and others


From: Arash Esbati
Subject: Re: exam new patch to add support for the choice, environment and others.
Date: Sat, 25 Jan 2020 22:56:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50

Hi Uwe,

Uwe Brauer <address@hidden> writes:

> Thanks, but this bold strategy is only reserved for the true AuCTeX
> masters, like you, mortals like me had to test it, and it works,
> thanks!

I'm afraid you're overestimating my lisp-fu :-)

> The corrected patch is attached

Thanks, I slightly modified your change and pushed it, change 0d790743.
This is the diff:

--8<---------------cut here---------------start------------->8---
diff --git a/style/exam.el b/style/exam.el
index be8126d3..3ecc38d7 100644
--- a/style/exam.el
+++ b/style/exam.el
@@ -1,6 +1,6 @@
 ;;; exam.el --- AUCTeX style for the (LaTeX) exam class

-;; Copyright (C) 2016--2018 Free Software Foundation, Inc.
+;; Copyright (C) 2016--2020 Free Software Foundation, Inc.

 ;; Author: Uwe Brauer <address@hidden>
 ;; Created: 2016-03-06
@@ -60,6 +60,9 @@ Item inserted depends on the environment."
           "subpart")
          ((string= environment "subsubparts")
           "subsubpart")
+        ((member environment '("choices" "oneparchoices"
+                               "checkboxes" "oneparcheckboxes"))
+         "choice")
          ;; Fallback
          (t "item"))))

@@ -94,6 +97,10 @@ Arguments NAME and TYPE are the same as for the function
    (LaTeX-add-environments
     '("solution" [ "Height" ])
     '("select")
+    '("choices" LaTeX-env-item)
+    '("oneparchoices" LaTeX-env-item)
+    '("checkboxes" LaTeX-env-item)
+    '("oneparcheckboxes" LaTeX-env-item)
     '("solutionorbox" [ "Height" ])
     '("solutionorlines" [ "Height" ])
     '("solutionordottedlines" [ "Height" ])
@@ -104,10 +111,14 @@ Arguments NAME and TYPE are the same as for the function
     '("subsubparts" LaTeX-env-item))

    ;; Tell AUCTeX about special environments:
-   (let ((envs '("questions" "parts" "subparts" "subsubparts")))
+   (let ((envs '("questions"
+                "parts"      "subparts"         "subsubparts"
+                "choices"    "oneparchoices"
+                "checkboxes" "oneparcheckboxes")))
      (dolist (env envs)
        (add-to-list 'LaTeX-item-list
-                    (cons env 'LaTeX-exam-insert-item))))
+                    (cons env 'LaTeX-exam-insert-item)
+                   t)))

    ;; Append us only once:
    (unless (and (string-match "question" LaTeX-item-regexp)
@@ -229,7 +240,7 @@ Arguments NAME and TYPE are the same as for the function
     '("checkboxchar" 1)
     '("checkboxeshook" 0)
     '("checkedchar" 1)
-    '("choice" 0)
+    '("choice" (TeX-arg-literal " "))
     '("choicelabel" 0)
     '("choiceshook" 0)
     '("chpgword" 1)
--8<---------------cut here---------------end--------------->8---

Best, Arash



reply via email to

[Prev in Thread] Current Thread [Next in Thread]