Debian Codegraph @

texmf-dist/doc/latex/qcm/qcm.el

raw
1 ;;; qcm.el --- AUC-TeX style file for QCM
2
3 ;; Copyright (C) 2004 Didier Verna.
4
5 ;; Author: Didier Verna <[email protected]>
6 ;; Maintainer: Didier Verna <[email protected]>
7 ;; Created: Tue Apr 18 14:49:29 2000
8 ;; Last Revision: Tue Nov 9 17:46:37 2004
9 ;; Keywords: tex abbrev data
10
11 ;; This file is part of QCM.
12
13 ;; QCM may be distributed and/or modified under the
14 ;; conditions of the LaTeX Project Public License, either version 1.1
15 ;; of this license or (at your option) any later version.
16 ;; The latest version of this license is in
17 ;; http://www.latex-project.org/lppl.txt
18 ;; and version 1.1 or later is part of all distributions of LaTeX
19 ;; version 1999/06/01 or later.
20
21 ;; QCM consists of all files listed in the file `README'.
22
23
24 ;;; Commentary:
25
26 ;; Contents management by FCM version 0.1-b2.
27
28 ;; #### NOTE: maybe this file should be split in two: one for the style and
29 ;; #### one for the class.
30
31 ;;; Code:
32
33 (defun qcm-LaTeX-item-question ()
34 (if current-prefix-arg
35 (TeX-insert-macro "true")
36 (TeX-insert-macro "false")))
37
38 (push '("question" . qcm-LaTeX-item-question) LaTeX-item-list)
39
40 (defun qcm-LaTeX-env-question (environment)
41 "Create a \`question' environment in a QCM document."
42 ;; Questions can be quite long, so instead of prompting for them, which
43 ;; would be annoying, let's just put the point inside the braces.
44 (LaTeX-insert-environment environment "{}")
45 (beginning-of-line)
46 (kill-line)
47 (LaTeX-find-matching-begin)
48 (end-of-line)
49 (forward-char -1)
50 )
51
52 (TeX-add-style-hook "qcm"
53 (function
54 (lambda ()
55 ;; QCM style:
56 (LaTeX-add-environments
57 '("question" qcm-LaTeX-env-question)
58 '("correction")
59 )
60 (TeX-add-symbols
61 '("true" (TeX-arg-literal " "))
62 '("false" (TeX-arg-literal " "))
63 '("truesymbol" t)
64 '("falsesymbol" t)
65 '("correctionstyle" t)
66 '("questionspace")
67 '("thequestion")
68 '("answerstitle" t)
69 '("answerstitlefont" t)
70 '("answernumberfont" t)
71 '("makeform")
72 '("makemask")
73 '("headerfont" t)
74 '("X" t)
75 ;; QCM Class:
76 '("title" t)
77 '("titlefont" t)
78 '("titlespace")
79 '("maketitle")
80 '("questiontitle" t)
81 '("questiontitlefont" t)
82 '("questiontitlespace")
83 '("questionsepspace")
84 )
85 )))
86
87
88
89
90 ;;; Local variables:
91 ;;; eval: (put 'TeX-add-style-hook 'lisp-indent-function 1)
92 ;;; End:
93
94 ;;; qcm.el ends here