1 ;;; ulem.el --- AUCTeX style for `ulem.sty'
3 ;; Copyright (C) 2012 Free Software Foundation, Inc.
5 ;; Author: Mads Jensen <mje@inducks.org>
8 ;; This file is part of AUCTeX.
10 ;; AUCTeX is free software; you can redistribute it and/or modify it
11 ;; under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 3, or (at your option)
15 ;; AUCTeX is distributed in the hope that it will be useful, but
16 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ;; General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with AUCTeX; see the file COPYING. If not, write to the Free
22 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
27 ;; This file adds support for `ulem.sty'.
40 ;; can be used with \renewcommand or \setlength
43 ;; custom commands can be defined with these commands; see the
44 ;; documentation for an example
47 ;; \useunder {underline_command}{font_declaration}{font_command}
48 ;; replaces occurences of font_declaration and font_command with the
50 '("useunder" TeX-arg-ulem-useunder
51 TeX-arg-ulem-fontdecl TeX-arg-ulem-fontcmd))
54 (when (and (featurep 'font-latex)
55 (eq TeX-install-font-lock 'font-latex-setup))
56 ;; Tell font-lock about the update.
57 (font-latex-add-keywords '(("useunder" "{{{")) 'function)
58 (font-latex-add-keywords '(("uline" "{")
61 ("xout" "{")) 'textual)))
64 (defvar LaTeX-arg-fontdecl
65 (mapcar (lambda (str) (concat "\\" str))
66 '("itshape" "bfseries" "scshape"
67 "ttfamily" "upshape" "mdseries"
68 "rmfamily" "sffamily" "slshape"))
69 "List of font declaration commands in LaTeX")
71 (defvar LaTeX-arg-fontcmd
72 (mapcar (lambda (str) (concat "\\" str))
73 '("textit" "textbf" "textsc"
74 "texttt" "textup" "textmd"
75 "textrm" "textsf" "textsl"))
76 "List of font commands in LaTeX")
78 (defun TeX-arg-ulem-fontdecl (optional &optional prompt)
79 "Prompt for the font-declaration un \\useunder"
81 (completing-read (TeX-argument-prompt
82 optional prompt "Font declaration")
83 LaTeX-arg-fontdecl nil t) optional))
85 (defun TeX-arg-ulem-fontcmd (optional &optional prompt)
86 "Prompt for the font-declaration un \\useunder"
88 (completing-read (TeX-argument-prompt
89 optional prompt "Font command")
90 LaTeX-arg-fontcmd nil t) optional))
92 ;; adapted from url.el:TeX-arg-urlstyle
93 (defun TeX-arg-ulem-useunder (optional &optional prompt)
94 "Prompt for underline command used in \\useunder"
96 (completing-read (TeX-argument-prompt optional prompt "Underline command")
98 (mapcar (lambda (str) (concat "\\" str))
100 "uwave" "sout" "xout")))
103 (defvar LaTeX-ulem-package-options
104 '("UWforbf" "ULforem" "normalbf" "normalem")
105 "Package options for the ulem package.")
107 ;;; ulem.el ends here