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: Uwe Brauer
Subject: Re: [AUCTeX-devel] patch for the exam class.
Date: Mon, 26 Dec 2016 10:09:03 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

>>> "Arash" == Arash Esbati <address@hidden> writes:

   > Hi Uwe,
   > Uwe Brauer <address@hidden> writes:

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

Definitely ;-)


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

   > You have a dupe here.


ok
   >> +(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.


ok
   >> +   (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:

You mean in (partial)gradtable or also in part?

As for (partial)gradtable

When I use Tex-insert-macro
RET
gradtable
Optional 1. Option: h
RET
Optional 2. Option: question
RET

I obtain what I want, namely

\gradetable[h][question]

Are you saying this is a ugly hack. Fine I take your code, but my
«solution» works
   >         '("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.

thanks
   >> +    '("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

You are right

But the ugly hack
    '("extrafootheight"  ["Measure"](TeX-arg-literal "")1)

Would also work, however I will take your solution :-D


   >        '("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.
Oops


   >> +    '("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

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
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)))
ok
   > Best, Arash


Thanks again, I will take your suggestions, but I am bit curious about
my ugly hack solutions
    '("extrafootheight"  ["Measure"](TeX-arg-literal "")1)
      '("gradetable" [ "1. Option" ](TeX-arg-literal "")[ "2. Option" 
](TeX-arg-literal ""))

Uwe 



reply via email to

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