auctex-devel
[Top][All Lists]
Advanced

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

Re: [AUCTeX-devel] patch for the exam class.


From: Arash Esbati
Subject: Re: [AUCTeX-devel] patch for the exam class.
Date: Sat, 24 Dec 2016 15:32:26 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1

Hi Uwe,

Uwe Brauer <address@hidden> writes:

> I send a patch (in 2 formats since I am not 100 % sure) which provides
> support for the exam class. Thanks very much to essential contributions
> from Arash. 

You're welcome.  I keep on giving some comments, I hope it's ok :-)

> +;;; Code:
> +
> +;;; Code:

You have a dupe here.

> +(defcustom LaTeX-exam-reftex-quick-id-key ?x
> +  "Unique letter identifying exam class macros in RefTeX.
> +
> +A character argument for quick identification when RefTeX inserts
> +new labels with `reftex-label'.  It must be unique.  It is
> +initialized to ?x."
> +  :group 'LaTeX-style
> +  :type 'character)
> +
> +(defcustom LaTeX-exam-label "exm:"
> +  "Default prefix to labels in environments of exam class."
> +  :group 'LaTeX-style
> +  :type 'string)

You should move these 2 variables into `tex-style.el' -- it contains
customizable variables for AUCTeX style files.

> +   (TeX-add-symbols
> +    '("part" [ "Points" ] (TeX-arg-literal " "))
> +    '("subpart" [ "Points" ] (TeX-arg-literal " "))

> +    '("gradetable" [ "1. Option" ](TeX-arg-literal "")[ "2. Option" 
> ](TeX-arg-literal ""))
> +    '("partialgradetable" 1 [ "1. Option" ](TeX-arg-literal "")[ "2. Option" 
> ](TeX-arg-literal ""))

What's the rationale behind the (TeX-arg-literal "") here?  You could
write something like:

        '("gradetable"
          [ TeX-arg-eval completing-read
                         (TeX-argument-prompt optional nil "Orientation")
                         '("v" "h") ]
          [ TeX-arg-eval completing-read
                         (TeX-argument-prompt optional nil "Table index")
                         '("questions" "pages") ] )

> +    '("subsubpart" [ "Points" ] (TeX-arg-literal " "))
> +    '("question"  ["Points"] (TeX-arg-literal " "))

> +    '("subpart"  ["Points"] (TeX-arg-literal " "))
> +    '("subsubpart"  ["Points"] (TeX-arg-literal " "))

These 2 are also dupes.

> +    '("extrafootheight"  ["Measure"] (TeX-arg-literal " "))

I'm not an exam user, but I think this defintion is wrong.  examdoc.pdf
page 99 says a usage like \extrafootheight[.5in]{.25in}.  I would then
suggest something like

       '("extrafootheight"  [ TeX-arg-length "Extra height 1. page footer" ]
                            (TeX-arg-length "Extra height footers"))

> +    '("Alph" 0)                         ;ok
> +    '("Roman" 0)                        ;ok
> +    '("alph" 0)                         ;ok
> +    '("arabic" 0)                       ;ok

These are already in latex.el.  You don't need them.

> +    '("answerlinelength" 1)                           ;ok
> +    '("answerskip" 1)                                 ;ok

These are set with \setlength in document?  If so, you should move them
out of (TeX-add-symbols ...) and set them with (LaTeX-add-lengths):

    (LaTeX-add-lengths "answerlinelength" "answerskip")

> +    '("colorbox" 0)                     ;ok

You should drop this.  \colorbox is defined in color.el and xcolor.el.
Depending on which package used by the user, this command will become
available.  And while we're at it: page 70 says that the command
\shadedsolutions can be used if \usepackage{color} is in the preamble.
Then I suggest you move this line:

> +    '("shadedsolutions" 0)              ;ok

out of TeX-add-symbols and do something like this in the style hook:

(when (or (member "xcolor" (TeX-style-list))
          (member "color" (TeX-style-list)))
  (TeX-add-symbols '("shadedsolutions" 0)))

Best, Arash



reply via email to

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