1 ;;; CJK.el --- AUCTeX style for the CJK package.
3 ;; Copyright (C) 2009 Free Software Foundation, Inc.
5 ;; Author: Ralf Angeli <angeli@caeruleus.net>
6 ;; Maintainer: auctex-devel@gnu.org
10 ;; This file is part of AUCTeX.
12 ;; AUCTeX is free software; you can redistribute it and/or modify it
13 ;; under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation; either version 3, or (at your option)
17 ;; AUCTeX is distributed in the hope that it will be useful, but
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 ;; General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with AUCTeX; see the file COPYING. If not, write to the Free
24 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
29 ;; This file adds support for the CJK package, version 4.8.0
34 (defvar LaTeX-CJK-package-options
35 '("lowercase" "global" "local" "active" "encapsulated")
36 "Package options for the CJK package.")
38 (defvar LaTeX-CJK-enc-list
39 '("Bg5" "Bg5+" "HK" "GB" "GBt" "GBK" "JIS" "JIS2" "SJIS" "KS" "UTF8" "CNS1"
40 "CNS2" "CNS3" "CNS4" "CNS5" "CNS6" "CNS7" "CEFX" "CEFY")
41 "List of encodings supported by the CJK package.")
43 (defun LaTeX-env-CJK (env)
44 "Prompt for the arguments of ENV and insert it.
45 The function can be used for CJK and CJK* environments."
46 (LaTeX-insert-environment
49 (let ((font-enc (read-string "(Optional) Font encoding: ")))
50 (unless (zerop (length font-enc)) (format "[%s]" font-enc)))
51 (format "{%s}" (completing-read "Encoding: "
52 (mapcar 'list LaTeX-CJK-enc-list)))
53 (format "{%s}" (read-string "Font family: ")))))
60 '("CJKencfamily" ["Font encoding"] "Encoding" "Font family")
61 '("CJKchar" ["Encoding"] "First byte" "Second byte")
64 '("CJKfontenc" "Encoding" "Font encoding")
66 '("Unicode" "First byte" "Second byte")
89 (LaTeX-add-environments
90 '("CJK" LaTeX-env-CJK)
91 '("CJK*" LaTeX-env-CJK))))