File: french.hlx

package info (click to toggle)
hyperlatex 2.5-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 480 kB
  • ctags: 288
  • sloc: lisp: 2,291; sh: 180; makefile: 86; awk: 21
file content (124 lines) | stat: -rw-r--r-- 3,750 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
%%
%% Hyperlatex babel support for french language
%%
%% (C) 1997, Eric delaunay <delaunay@lix.polytechnique.fr>
%%     1999, Alain Aubord  <Alain.Aubord@Obs.unige.ch> 
%%           Detection of french guillemots made with the 
%%           characters "<<" an ">>" and the definition of
%%           macros "\fg" and "\og". This code was stolen
%%           from the file for german.



\HlxEval{
(defun hyperlatex-french-active-opening-quote ()
  ;; < or > has already been removed from text
  (let ((here (point))
	(match (assoc (following-char) hyperlatex-french-interesting-chars)))
    (if match
	;; if char is not in the list, we have to add it alone since
        ;; it start not a command but it is used for itself.
	(progn
	  ;; replace the character with its expansion
	  (delete-region (point) (1+ (point)))
	  (insert (cdr match))
	  (goto-char here))
        (insert "<"))))

(defun hyperlatex-french-active-closing-quote ()
  ;; < or > has already been removed from text
  (let ((here (point))
	(match (assoc (following-char) hyperlatex-french-interesting-chars)))
    (if match
	;; if char is not in the list, we have to add it alone since
        ;; it start not a command but it is used for itself.
	(progn
	  ;; replace the character with its expansion
	  (delete-region (point) (1+ (point)))
	  (insert (cdr match))
	  (goto-char here))
        (insert ">"))))

(defvar hyperlatex-french-interesting-chars
  '( ( ?< . "\\og{}")
     ( ?> . "\\fg{}")
     ))
}

\newcommand{\mfqon}{
  \HlxEval{
	;; Make < and > active characters
	(setq hyperlatex-additional-special-characters
		  (concat "<>" hyperlatex-additional-special-characters))
	(hyperlatex-update-special-chars)
	;; Provide definition for active < and >
	(put '< 'hyperlatex-active 'hyperlatex-french-active-opening-quote)
	(put '> 'hyperlatex-active 'hyperlatex-french-active-closing-quote)  }
}
\newcommand{\mfqoff}{
  \HlxEval{
	;; Remove < and > definitions
	(string-match "<>" hyperlatex-additional-special-characters)
	(replace-match "" t t hyperlatex-additional-special-characters)
	(hyperlatex-update-special-chars)
  }
}

\newcommand{\extrasfrench}{
  \mfqon
}

\newcommand{\noextrasfrench}{
  \mfqoff
}
\newcommand{\htmlpanelfrench}{
  \renewcommand{\HlxGoBackName}{Pr\'ec\'edant:}
  \renewcommand{\HlxGoUpName}{Sup\'erieur:}
  \renewcommand{\HlxGoForwardName}{Suivant:}
}

\newcommand{\og}{\xmlsym{##171}~}
\newcommand{\fg}{~\xmlsym{##187}}

\newcommand{\captionsfrench}{
  \newcommand{\refname}{R\'ef\'erences}
  \newcommand{\abstractname}{R\'esum\'e}
  \newcommand{\bibname}{Bibliographie}
  \newcommand{\prefacename}{Pr\'eface}
  \newcommand{\chaptername}{Chapitre}
  \newcommand{\appendixname}{Annexe}
  \newcommand{\contentsname}{Table des mati\`eres}
  \newcommand{\listfigurename}{Table des figures}
  \newcommand{\listtablename}{Liste des tableaux}
  \newcommand{\indexname}{Index}
  \newcommand{\figurename}{Fig.}
  \newcommand{\tablename}{Tab.}
  \newcommand{\partname}{partie}
  \newcommand{\pagename}{page}
  \newcommand{\seename}{{\emph{voir}}}
  \newcommand{\alsoname}{{\emph{voir aussi}}}
  \newcommand{\proofname}{D\'emonstration}
}

\newcommand{\datefrench}{
  \newcommand{\today}{\HlxTodayFrench}
}

\HlxEval{
(put 'HlxTodayFrench 'hyperlatex 'hyperlatex-format-hlxtodayfrench)

(defun hyperlatex-format-hlxtodayfrench ()
   (let* ((date (decode-time))
	  (day (elt date 3))
	  (month (elt date 4))
	  (year (elt date 5))
	  (month-list '("janvier" "f\\'evrier" "mars" "avril"
		      	"mai" "juin" "juillet" "ao\\^ut" 
			"septembre" "octobre" "novembre" "d\\'ecembre")))
    (insert
     (concat (int-to-string day) " "
             (elt month-list (1- month))
	     " " (int-to-string year)))
    (goto-char hyperlatex-command-start)))
}