yatex

changeset 580:89a13c59674f

Merged to default branch
author HIROSE Yuuji <yuuji@gentei.org>
date Thu, 26 Dec 2019 13:27:55 +0859
parents 70bb775b481c b9ba8aacbea6
children 995282fc8bf5
files
diffstat 11 files changed, 187 insertions(+), 66 deletions(-) [+]
line diff
     1.1 --- a/.hgtags	Mon Nov 25 21:09:06 2019 +0900
     1.2 +++ b/.hgtags	Thu Dec 26 13:27:55 2019 +0859
     1.3 @@ -21,3 +21,4 @@
     1.4  a2bb2426a15410438d5e5917ce939bd4bbbe8194 yatex-1.80
     1.5  ca7cf34e959cc35960081f25b0f903b1bd2a191f master-beginning
     1.6  fbb636ff0fe3fd784af7697db5805a20d33b04d2 yatex-1.81
     1.7 +4dad5f91b26cb44a8caa888fe8aa0aad1f1f10bb yatex-1.82
     2.1 --- a/help/YATEXHLP.eng	Mon Nov 25 21:09:06 2019 +0900
     2.2 +++ b/help/YATEXHLP.eng	Thu Dec 26 13:27:55 2019 +0859
     2.3 @@ -1788,6 +1788,36 @@
     2.4  \textbackslash
     2.5  backslash(\) itself.
     2.6  
     2.7 +geometry
     2.8 +\geometry{params...}   or   \usepackage[params...]{geometry}
     2.9 +From: geometry-samples.tex
    2.10 +See below as examples:
    2.11 +
    2.12 +\geometry{centering}
    2.13 +\geometry{width=10cm,vscale=.7}
    2.14 +\geometry{margin=1cm, papersize={12cm,19cm}, resetpaper}
    2.15 +\geometry{margin=1cm,includeheadfoot}
    2.16 +\geometry{margin=1cm,includeheadfoot,includemp}
    2.17 +\geometry{margin=1cm,bindingoffset=1cm,twoside}
    2.18 +\geometry{hmarginratio=2:1, vmargin=2cm}
    2.19 +\geometry{hscale=0.5,twoside}
    2.20 +\geometry{hscale=0.5,asymmetric}
    2.21 +\geometry{hscale=0.5,heightrounded}
    2.22 +\geometry{left=1cm,right=4cm,top=2cm,includefoot}
    2.23 +\geometry{lines=20,left=2cm,right=6cm,top=2cm,twoside}
    2.24 +\geometry{width=15cm, marginparwidth=3cm, includemp}
    2.25 +\geometry{hdivide={1cm,,2cm}, vdivide={3cm,8in,}, nohead}
    2.26 +\geometry{headsep=20pt, head=40pt,foot=20pt,includeheadfoot}
    2.27 +\geometry{text={6in,8in}, top=2cm, left=2cm}
    2.28 +\geometry{centering,includemp,twoside,landscape}
    2.29 +\geometry{mag=1414,margin=2cm}
    2.30 +\geometry{mag=1414,margin=2truecm,truedimen}
    2.31 +\geometry{a5paper, landscape, twocolumn, twoside,
    2.32 +   left=2cm, hmarginratio=2:1, includemp, marginparwidth=43pt,
    2.33 +   bottom=1cm, foot=.7cm, includefoot, textheight=11cm, heightrounded,
    2.34 +   columnsep=1cm,verbose}
    2.35 +
    2.36 +	  
    2.37  YaTeX
    2.38  (setq auto-mode-alist (cons '("\\.tex$" . yatex-mode) auto-mode-alist))
    2.39  The mode you are probably using now.
     3.1 --- a/help/YATEXHLP.jp	Mon Nov 25 21:09:06 2019 +0900
     3.2 +++ b/help/YATEXHLP.jp	Thu Dec 26 13:27:55 2019 +0859
     3.3 @@ -1805,6 +1805,35 @@
     3.4  \textbackslash
     3.5  バックスラッシュそのもの
     3.6  
     3.7 +geometry
     3.8 +\geometry{params...}   or   \usepackage[params...]{geometry}
     3.9 +From: geometry-samples.tex
    3.10 +以下を参考に:
    3.11 +
    3.12 +\geometry{centering}
    3.13 +\geometry{width=10cm,vscale=.7}
    3.14 +\geometry{margin=1cm, papersize={12cm,19cm}, resetpaper}
    3.15 +\geometry{margin=1cm,includeheadfoot}
    3.16 +\geometry{margin=1cm,includeheadfoot,includemp}
    3.17 +\geometry{margin=1cm,bindingoffset=1cm,twoside}
    3.18 +\geometry{hmarginratio=2:1, vmargin=2cm}
    3.19 +\geometry{hscale=0.5,twoside}
    3.20 +\geometry{hscale=0.5,asymmetric}
    3.21 +\geometry{hscale=0.5,heightrounded}
    3.22 +\geometry{left=1cm,right=4cm,top=2cm,includefoot}
    3.23 +\geometry{lines=20,left=2cm,right=6cm,top=2cm,twoside}
    3.24 +\geometry{width=15cm, marginparwidth=3cm, includemp}
    3.25 +\geometry{hdivide={1cm,,2cm}, vdivide={3cm,8in,}, nohead}
    3.26 +\geometry{headsep=20pt, head=40pt,foot=20pt,includeheadfoot}
    3.27 +\geometry{text={6in,8in}, top=2cm, left=2cm}
    3.28 +\geometry{centering,includemp,twoside,landscape}
    3.29 +\geometry{mag=1414,margin=2cm}
    3.30 +\geometry{mag=1414,margin=2truecm,truedimen}
    3.31 +\geometry{a5paper, landscape, twocolumn, twoside,
    3.32 +   left=2cm, hmarginratio=2:1, includemp, marginparwidth=43pt,
    3.33 +   bottom=1cm, foot=.7cm, includefoot, textheight=11cm, heightrounded,
    3.34 +   columnsep=1cm,verbose}
    3.35 +
    3.36  FILTER
    3.37  %#BEGIN FILTER{OUTPUT}{COMMANDLINE}  ... %#END
    3.38  \if0 から \fi までに囲まれた領域、もしくは %#SRC{...} で指定されたファイルを
     4.1 --- a/yahtml.el	Mon Nov 25 21:09:06 2019 +0900
     4.2 +++ b/yahtml.el	Thu Dec 26 13:27:55 2019 +0859
     4.3 @@ -1,8 +1,8 @@
     4.4  ;;; yahtml.el --- Yet Another HTML mode -*- coding: sjis -*-
     4.5 -;;; (c) 1994-2017 by HIROSE Yuuji [yuuji(@)yatex.org]
     4.6 +;;; (c) 1994-2019 by HIROSE Yuuji [yuuji(@)yatex.org]
     4.7  ;;; $Id$
     4.8  
     4.9 -(defconst yahtml-revision-number "1.80"
    4.10 +(defconst yahtml-revision-number "1.80.1"
    4.11    "Revision number of running yahtml.el")
    4.12  
    4.13  ;;; Commentary:
    4.14 @@ -361,6 +361,7 @@
    4.15        (yahtml-define-begend-key "bb" "body" map)
    4.16        (yahtml-define-begend-key "bc" "center" map)
    4.17        (yahtml-define-begend-key "bd" "dl" map)
    4.18 +      (yahtml-define-begend-key "bD" "div" map)
    4.19        (yahtml-define-begend-key "bu" "ul" map)
    4.20        (yahtml-define-begend-key "bo" "ol" map)
    4.21        (yahtml-define-begend-key "b1" "h1" map)
    4.22 @@ -373,6 +374,7 @@
    4.23        (yahtml-define-begend-key "bv" "div" map)
    4.24        (yahtml-define-begend-key "bS" "span" map)
    4.25        (yahtml-define-begend-key "bp" "pre" map)
    4.26 +      (yahtml-define-begend-key "bq" "blockquote" map)
    4.27        (YaTeX-define-key "b " 'yahtml-insert-begend map)
    4.28        (YaTeX-define-key "B " 'yahtml-insert-begend-region map))
    4.29      (YaTeX-define-key "e" 'YaTeX-end-environment map)
    4.30 @@ -1082,6 +1084,8 @@
    4.31  	(ask (eq yahtml-escape-chars 'ask)))
    4.32      (cond
    4.33       ((null yahtml-escape-chars) str)
    4.34 +     ((string-match "%[0-9A-F][0-9A-F]%[0-9A-F][0-9A-F]%[0-9A-F][0-9A-F]" str)
    4.35 +      str)
    4.36       (t
    4.37        (while (and (string< "" str)
    4.38  		  (setq p (string-match yahtml-unsafe-chars-regexp str)))
     5.1 --- a/yatex.el	Mon Nov 25 21:09:06 2019 +0900
     5.2 +++ b/yatex.el	Thu Dec 26 13:27:55 2019 +0859
     5.3 @@ -1,6 +1,6 @@
     5.4  ;;; yatex.el --- Yet Another tex-mode for emacs //野鳥// -*- coding: sjis -*-
     5.5 -;;; (c)1991-2018 by HIROSE Yuuji.[yuuji@yatex.org]
     5.6 -;;; Last modified Tue Dec 25 20:03:02 2018 on firestorm
     5.7 +;;; (c)1991-2019 by HIROSE Yuuji.[yuuji@yatex.org]
     5.8 +;;; Last modified Thu Dec 26 12:46:41 2019 on firestorm
     5.9  ;;; $Id$
    5.10  ;;; The latest version of this software is always available at;
    5.11  ;;; https://www.yatex.org/
    5.12 @@ -16,7 +16,7 @@
    5.13  
    5.14  ;;; Code:
    5.15  (require 'yatexlib)
    5.16 -(defconst YaTeX-revision-number "1.81.1"
    5.17 +(defconst YaTeX-revision-number "1.82"
    5.18    "Revision number of running yatex.el")
    5.19  
    5.20  ;---------- Local variables ----------
    5.21 @@ -204,7 +204,7 @@
    5.22    "*Regexp of verb family.  Do not contain preceding \\\\ nor \\(\\).")
    5.23  (defvar YaTeX-fill-inhibit-environments
    5.24    (append '("tabular" "tabular*" "array" "picture" "eqnarray" "eqnarray*"
    5.25 -	    "longtable"
    5.26 +	    "longtable" "tabularx"
    5.27  	    "equation" "equation*" "math" "displaymath")
    5.28  	  YaTeX-verbatim-environments)
    5.29    "*In these environments, YaTeX inhibits fill-paragraph from formatting.
    5.30 @@ -218,7 +218,7 @@
    5.31    "*Regexp of environments for equations")
    5.32  (defvar YaTeX-array-env-regexp
    5.33    (concat
    5.34 -   "array\\*?\\|eqnarray\\*?\\|tabbing\\|tabular\\*?\\|"	;LaTeX
    5.35 +   "array\\*?\\|eqnarray\\*?\\|tabbing\\|tabularx?\\*?\\|"	;LaTeX
    5.36     "longtable\\|"						;LaTeX2e
    5.37     "matrix\\|pmatrix\\|bmatrix\\|vmatrix\\|Vmatrix\\|"		;AMS-LaTeX
    5.38     "align\\*?\\|split\\*?\\|aligned\\*?\\|alignat\\*?\\|"	;AMS-LaTeX
    5.39 @@ -326,6 +326,7 @@
    5.40       ("frametitle") ("framesubtitle") 				;; beamer
    5.41       ("subfigure")						;; subfigure
    5.42       ("ruby" 2) ("kenten")					;; okumacro
    5.43 +     ("geometry") ("path")
    5.44       )
    5.45     (if YaTeX-use-LaTeX2e
    5.46         '(("documentclass") ("usepackage")
    5.47 @@ -398,10 +399,10 @@
    5.48       ("eqnarray") ("eqnarray*") ("figure") ("equation") ("equation*")
    5.49       ("abstract") ("array")
    5.50       ("thebibliography") ("theindex") ("flushleft") ("flushright")
    5.51 -     ("minipage")
    5.52 -     ("supertabular")
    5.53 -     ("wrapfigure") ("wraptable")
    5.54 +     ("minipage") ("landscape")
    5.55 +     ("supertabular") ("floatingfigure") ("wrapfigure") ("wraptable")
    5.56       ("frame") ("block") ("example") ("columns") ("column")	;beamer
    5.57 +     ("tabularx")
    5.58       )
    5.59     (if YaTeX-use-LaTeX2e
    5.60         '(("comment")			;defined in version
    5.61 @@ -451,6 +452,7 @@
    5.62     '(("maketitle") ("makeindex") ("sloppy") ("protect") ("par") ("and")
    5.63       ("LaTeX") ("TeX") ("item") ("item[]") ("appendix") ("hline") ("kill")
    5.64       ;;("rightarrow") ("Rightarrow") ("leftarrow") ("Leftarrow")
    5.65 +     ("onecolumn") ("twocolumn")
    5.66       ("pagebreak") ("nopagebreak") ("tableofcontents")
    5.67       ("newpage") ("clearpage") ("cleardoublepage")
    5.68       ("footnotemark") ("verb") ("verb*")
    5.69 @@ -554,6 +556,7 @@
    5.70      (YaTeX-define-begend-key "bD" "description")
    5.71      (YaTeX-define-begend-key "be" "enumerate")
    5.72      (YaTeX-define-begend-key "bE" "equation")
    5.73 +    (YaTeX-define-begend-key "bf" "figure")
    5.74      (YaTeX-define-begend-key "bi" "itemize")
    5.75      (YaTeX-define-begend-key "bl" "flushleft")
    5.76      (YaTeX-define-begend-key "bm" "minipage")
     6.1 --- a/yatex.new	Mon Nov 25 21:09:06 2019 +0900
     6.2 +++ b/yatex.new	Thu Dec 26 13:27:55 2019 +0859
     6.3 @@ -1,6 +1,14 @@
     6.4  	What's new in YaTeX/yahtml
     6.5  	野鳥/yahtml - 各バージョンの変更点について
     6.6  
     6.7 +1.82	== yatex ==
     6.8 +	YaTeX::usepackage-alist-default を廃止し、
     6.9 +	YaTeX-package-alist-default を利用するようにした。
    6.10 +	tabularx等対応。
    6.11 +	PDFまで生成できたときは .log, .dvi ファイルを消すようにした。
    6.12 +	== yahtml ==
    6.13 +	URLエンコード混みと思しきURLは再エンコードしないようにした。
    6.14 +
    6.15  1.81	emacs-26 の主要関数の仕様変更に対応。
    6.16  	== yatex ==
    6.17  	タイプセットコマンド定義中の %k を漢字コード名に変換(-kanji=%k)
     7.1 --- a/yatexadd.el	Mon Nov 25 21:09:06 2019 +0900
     7.2 +++ b/yatexadd.el	Thu Dec 26 13:27:55 2019 +0859
     7.3 @@ -1,6 +1,6 @@
     7.4  ;;; yatexadd.el --- YaTeX add-in functions -*- coding: sjis -*-
     7.5 -;;; (c)1991-2018 by HIROSE Yuuji.[yuuji@yatex.org]
     7.6 -;;; Last modified Wed Nov  7 09:01:08 2018 on firestorm
     7.7 +;;; (c)1991-2019 by HIROSE Yuuji.[yuuji@yatex.org]
     7.8 +;;; Last modified Thu Oct 17 09:44:48 2019 on firestorm
     7.9  ;;; $Id$
    7.10  
    7.11  ;;; Code:
    7.12 @@ -22,8 +22,8 @@
    7.13  Notice that this function refers the let-variable `env' in
    7.14  YaTeX-make-begin-end."
    7.15    (let ((width "") bars (rule "") (and "") (j 1) loc ans (hline "\\hline"))
    7.16 -    (if (string= YaTeX-env-name "tabular*")
    7.17 -	(setq width (concat "{" (YaTeX:read-length "Width: ") "}")))
    7.18 +    (if (string-match "tabular[*x]" YaTeX-env-name)
    7.19 +	(setq width (concat "{" (YaTeX:read-length "Table Width: ") "}")))
    7.20      (setq loc (YaTeX:read-position "tb")
    7.21  	  bars (YaTeX-str2int
    7.22  		(YaTeX-read-string-or-skip
    7.23 @@ -57,6 +57,7 @@
    7.24  
    7.25  (fset 'YaTeX:tabular* 'YaTeX:tabular)
    7.26  (fset 'YaTeX:supertabular 'YaTeX:tabular)
    7.27 +(fset 'YaTeX:tabularx 'YaTeX:tabular)
    7.28  (defun YaTeX:alignat ()
    7.29    (concat "{" (read-string-with-history "Number of columns: ") "}"))
    7.30  (defun YaTeX:array ()
    7.31 @@ -1887,7 +1888,7 @@
    7.32    "*User defined documentclass alist")
    7.33  (defvar YaTeX:documentclasses-local nil
    7.34    "*User defined local documentclass alist")
    7.35 -(defvar YaTeX-default-documentclass (if YaTeX-japan "jarticle" "article")
    7.36 +(defvar YaTeX-default-documentclass (if YaTeX-japan "jsarticle" "article")
    7.37    "*Default documentclass")
    7.38  
    7.39  (defun YaTeX::documentclass (&optional argp)
    7.40 @@ -2148,34 +2149,11 @@
    7.41     ((= argp 1) (YaTeX-read-string-or-skip "Kanji: ")) 
    7.42     ((= argp 2) (YaTeX-read-string-or-skip "Yomi: "))))
    7.43  
    7.44 -(defvar YaTeX::usepackage-alist-default
    7.45 -  '(("version") ("plext") ("url") ("fancybox") ("pifont") ("longtable")
    7.46 -    ("ascmac") ("bm") ("graphics") ("graphicx") ("alltt") ("misc") ("eclbkbox")
    7.47 -    ("amsmath") ("amssymb") ("xymtex") ("chemist")
    7.48 -    ("a4j") ("array") ("epsf") ("color") ("xcolor") ("epsfig") ("floatfig")
    7.49 -    ("landscape") ("path") ("supertabular") ("twocolumn")
    7.50 -    ("latexsym") ("times") ("makeidx") ("geometry") ("type1cm")
    7.51 -    ("subfigure") ("okumacro"))
    7.52 -  "Default completion table for arguments of \\usepackage")
    7.53 +;;(require 'yatexpkg)
    7.54 +(autoload 'YaTeX::usepackage "yatexpkg" "Add-in for \\usepackage{}")
    7.55 +;;; (defun YaTeX::usepackage()...) MOVED to yatexpkg.el
    7.56 +;;; See yatexpkg.el
    7.57  
    7.58 -(defvar YaTeX::usepackage-alist-private nil
    7.59 -  "*Private completion list of the argument for usepackage")
    7.60 -
    7.61 -(defvar YaTeX::usepackage-alist-local nil
    7.62 -  "Directory local  completion list of the argument for usepackage")
    7.63 -
    7.64 -(defun YaTeX::usepackage (&optional argp)
    7.65 -  (cond
    7.66 -   ((equal argp 1)
    7.67 -    (setq YaTeX-env-name "document")
    7.68 -    (let ((minibuffer-local-completion-map YaTeX-minibuffer-completion-map)
    7.69 -	  (delim ","))
    7.70 -      (YaTeX-cplread-with-learning
    7.71 -       (if YaTeX-japan "Use package(カンマで区切ってOK): "
    7.72 -	 "Use package(delimitable by comma): ")
    7.73 -       'YaTeX::usepackage-alist-default
    7.74 -       'YaTeX::usepackage-alist-private
    7.75 -       'YaTeX::usepackage-alist-local)))))
    7.76  
    7.77  (defun YaTeX::mask (argp)
    7.78    (cond
    7.79 @@ -2395,6 +2373,10 @@
    7.80     (t nil)))
    7.81  (fset 'YaTeX:it 'YaTeX:em)
    7.82  
    7.83 +;;; twocolumn
    7.84 +(defun YaTeX:twocolumn ()
    7.85 +  (format "[%s]" (YaTeX-read-string-or-skip "One column paragraph: ")))
    7.86 +
    7.87  ;;; -------------------- End of yatexadd --------------------
    7.88  (provide 'yatexadd)
    7.89  ; Local variables:
     8.1 --- a/yatexenv.el	Mon Nov 25 21:09:06 2019 +0900
     8.2 +++ b/yatexenv.el	Thu Dec 26 13:27:55 2019 +0859
     8.3 @@ -1,6 +1,6 @@
     8.4  ;;; yatexenv.el --- YaTeX environment-specific functions
     8.5 -;;; (c) 1994-2017 by HIROSE Yuuji.[yuuji@yatex.org]
     8.6 -;;; Last modified Sun Sep 17 10:23:16 2017 on firestorm
     8.7 +;;; (c) 1994-2019 by HIROSE Yuuji.[yuuji@yatex.org]
     8.8 +;;; Last modified Sat May 25 14:46:33 2019 on firestorm
     8.9  ;;; $Id$
    8.10  
    8.11  ;;; Code:
    8.12 @@ -89,7 +89,7 @@
    8.13      (while (< (point) end)
    8.14  	(setq elt (following-char))
    8.15  	(cond
    8.16 -	 ((string-match (char-to-string elt) "clr") ;normal indicators.
    8.17 +	 ((string-match (char-to-string elt) "clrX") ;normal indicators.
    8.18  	  (setq cols (1+ cols))
    8.19  	  (forward-char 1))
    8.20  	 ((equal elt ?|)		;vertical
    8.21 @@ -174,6 +174,7 @@
    8.22  (fset 'YaTeX-intelligent-newline-array 'YaTeX-intelligent-newline-tabular)
    8.23  (fset 'YaTeX-intelligent-newline-supertabular 'YaTeX-intelligent-newline-tabular)
    8.24  (fset 'YaTeX-intelligent-newline-longtable 'YaTeX-intelligent-newline-tabular)
    8.25 +(fset 'YaTeX-intelligent-newline-tabularx 'YaTeX-intelligent-newline-tabular*)
    8.26  
    8.27  (defun YaTeX-intelligent-newline-align ()
    8.28    "Intelligent newline function for align.
     9.1 --- a/yatexlib.el	Mon Nov 25 21:09:06 2019 +0900
     9.2 +++ b/yatexlib.el	Thu Dec 26 13:27:55 2019 +0859
     9.3 @@ -1,7 +1,7 @@
     9.4  ;;; yatexlib.el --- YaTeX and yahtml common libraries -*- coding: sjis -*-
     9.5  ;;; 
     9.6 -;;; (c)1994-2018 by HIROSE Yuuji.[yuuji@yatex.org]
     9.7 -;;; Last modified Wed May 23 07:59:08 2018 on firestorm
     9.8 +;;; (c)1994-2019 by HIROSE Yuuji.[yuuji@yatex.org]
     9.9 +;;; Last modified Thu Dec 26 12:47:45 2019 on firestorm
    9.10  ;;; $Id$
    9.11  
    9.12  ;;; Code:
    9.13 @@ -130,7 +130,9 @@
    9.14      (let ((coding
    9.15  	   (cond
    9.16  	    ((boundp 'buffer-file-coding-system)
    9.17 -	     (symbol-name buffer-file-coding-system))
    9.18 +	     (symbol-name (if (fboundp 'coding-system-name)
    9.19 +			      (coding-system-name buffer-file-coding-system)
    9.20 +			    buffer-file-coding-system)))
    9.21  	    ((boundp 'file-coding-system) (symbol-name file-coding-system))))
    9.22  	  (case-fold-search t))
    9.23        (cond ((string-match "utf-8\\>" coding)			"utf8")
    9.24 @@ -1116,8 +1118,8 @@
    9.25  		  regexp (format "\\(%s%s\\)\\|\\(%s%s\\)"
    9.26  				 YaTeX-ec-regexp
    9.27  				 (regexp-quote
    9.28 -				  (cdr (assq env '((?( . ")") (?) . "(")
    9.29 -						   (?[ . "]") (?] . "[")))))
    9.30 +				  (cdr (assq env '((?\( . ")") (?\) . "(")
    9.31 +						   (?\[ . "]") (?\] . "[")))))
    9.32  				 YaTeX-ec-regexp
    9.33  				 (regexp-quote (char-to-string env)))
    9.34  		  re-s (if (memq env '(?\( ?\[))
    10.1 --- a/yatexpkg.el	Mon Nov 25 21:09:06 2019 +0900
    10.2 +++ b/yatexpkg.el	Thu Dec 26 13:27:55 2019 +0859
    10.3 @@ -1,7 +1,7 @@
    10.4  ;;; yatexpkg.el --- YaTeX package manager -*- coding: sjis -*-
    10.5  ;;; 
    10.6 -;;; (c)2003-2018 by HIROSE, Yuuji [yuuji@yatex.org]
    10.7 -;;; Last modified Wed Nov  7 08:57:36 2018 on firestorm
    10.8 +;;; (c)2003-2019 by HIROSE, Yuuji [yuuji@yatex.org]
    10.9 +;;; Last modified Sat May 25 14:46:27 2019 on firestorm
   10.10  ;;; $Id$
   10.11  
   10.12  ;;; Code:
   10.13 @@ -30,17 +30,37 @@
   10.14      ("verbatim"	(section "verbatiminput"))
   10.15      ("eclbkbox"	(env "breakbox"))
   10.16      ("supertabular" (env "supertabular"))
   10.17 +    ("tabularx" (env "tabularx"))
   10.18      ("amsmath"	(env . YaTeX-package-ams-envs)
   10.19       		(section "tag" "tag*"))
   10.20 +    ("amsart"	(same-as . "amsmath"))
   10.21 +    ("amsbook"	(same-as . "amsmath"))
   10.22 +    ("amsproc"	(same-as . "amsmath"))
   10.23      ("amssymb"	(maketitle "leqq" "geqq" "mathbb" "mathfrak"
   10.24  			   "fallingdotseq" "therefore" "because"
   10.25  			   "varDelta" "varTheta" "varLambda" "varXi" "varPi"
   10.26  			   "varSigma" "varUpsilon" "varPhi" "varPsi" "varOmega"
   10.27  			   "lll" "ggg")) ;very few.  Please tell us!
   10.28 +    ("latexsym"	(maketitle "mho" "Join" "Box" "Diamond" "leadsto"
   10.29 +			   "sqsubset" "sqsupset" "lhd" "unlhd" "rhd" "unrhd"))
   10.30      ("mathrsfs"	(section "mathscr"))
   10.31      ("graphicx" (section "includegraphics"
   10.32  			 "rotatebox" "scalebox" "resizebox" "reflectbox")
   10.33       		(option . YaTeX-package-graphics-driver-alist))
   10.34 +    ("xymtex"	(section "Ycyclohexaneh"))	;;XXX we need more and more...
   10.35 +    ("chemist"	nil)				;;XXX we need completions...
   10.36 +    ("a4j"	nil)
   10.37 +    ("array"	nil)
   10.38 +    ("times"	nil)
   10.39 +    ("newtx"	nil)
   10.40 +    ("makeidx"	nil)
   10.41 +    ("geometry"	(section "geometry"))
   10.42 +    ("lscape"	(env "landscape"))
   10.43 +    ("path"	(section "path"))
   10.44 +    ("epsf"	(section "epsfbox"))
   10.45 +    ("epsfig"	(section "epsfig"))
   10.46 +    ("floatflt"	(env "floatingfigure"))
   10.47 +    ("type1cm"	(section "fontsize"))
   10.48      ("svg"	(section "includesvg"))
   10.49      ("color"	(section "textcolor" "colorbox" "pagecolor" "color")
   10.50       		(option . YaTeX-package-graphics-driver-alist)
   10.51 @@ -49,11 +69,8 @@
   10.52      ("ulem"	(section "uline" "uuline" "uwave")
   10.53  		(option ("normalem")))
   10.54      ("multicol"	(env "multicols"))
   10.55 -    ("cref"	(section "cleveref"))
   10.56 -    ("crefrange"	(same-as . "cref"))
   10.57 -    ("cpageref"		(same-as . "cref"))
   10.58 -    ("labelcref"	(same-as . "cref"))
   10.59 -    ("labelcpageref"	(same-as . "cref"))
   10.60 +    ("cleveref"	(section "cref" "crefrange" "cpageref" "labelcref"
   10.61 +			 "labelpageref"))
   10.62      ("wrapfig"	(env "wrapfigure" "wraptable"))
   10.63      ("setspace"	(env "spacing") (section "setstretch"))
   10.64      ("cases"	(env "numcases" "subnumcases"))
   10.65 @@ -139,7 +156,7 @@
   10.66  	(pkglist (YaTeX-package-lookup macro type))
   10.67  	(usepkgrx (concat
   10.68  		   YaTeX-ec-regexp
   10.69 -		   "\\(usepackage\\|include\\)\\b"))
   10.70 +		   "\\(usepackage\\|include\\|documentclass\\)\\b"))
   10.71  	(register (function
   10.72  		   (lambda () (set-buffer cb)
   10.73  		     (set (make-local-variable 'YaTeX-package-resolved-list)
   10.74 @@ -158,10 +175,8 @@
   10.75  		(goto-char (point-min))
   10.76  		(YaTeX-search-active-forward	;if search fails, goto eob
   10.77  		 begdoc YaTeX-comment-prefix nil 1)
   10.78 -		(while ;(YaTeX-re-search-active-backward
   10.79 -			;usepkgrx YaTeX-comment-prefix nil t)
   10.80 -		    ;;allow commented out \usepackages 2004/3/16
   10.81 -		    (re-search-backward usepkgrx nil t)
   10.82 +		(while (re-search-backward usepkgrx nil t)
   10.83 +		  ;;allow commented out \usepackages
   10.84  		  (setq mb0 (match-beginning 0))
   10.85  		  (skip-chars-forward "^{")
   10.86  		  (setq uspkgargs (YaTeX-buffer-substring
   10.87 @@ -236,4 +251,46 @@
   10.88  	      (funcall register)
   10.89  	      (message "Don't forget to put \\usepackage{%s} yourself later"
   10.90  		       (car (car pkglist)))) ;doing car car is negligence...
   10.91 -    ))))))
   10.92 +	    ))))))
   10.93 +
   10.94 +(defvar YaTeX::usepackage-alist-private nil
   10.95 +  "*Private completion list of the argument for usepackage")
   10.96 +
   10.97 +(defvar YaTeX::usepackage-alist-local nil
   10.98 +  "Directory local  completion list of the argument for usepackage")
   10.99 +
  10.100 +(defun YaTeX::usepackage (&optional argp)
  10.101 +  (cond
  10.102 +   ((equal argp 1)
  10.103 +    (setq YaTeX-env-name "document")
  10.104 +    (let ((minibuffer-local-completion-map YaTeX-minibuffer-completion-map)
  10.105 +	  (delim ","))
  10.106 +      (YaTeX-cplread-with-learning
  10.107 +       (if YaTeX-japan "Use package(カンマで区切ってOK): "
  10.108 +	 "Use package(delimitable by comma): ")
  10.109 +       ;; 'YaTeX::usepackage-alist-default	;; OBSOLETED at 1.82
  10.110 +       'YaTeX-package-alist-default
  10.111 +       'YaTeX::usepackage-alist-private
  10.112 +       'YaTeX::usepackage-alist-local)))))
  10.113 +
  10.114 +
  10.115 +;;;
  10.116 +;; Add-ins for auxiliary package handled here
  10.117 +;;;
  10.118 +(defun YaTeX:floatingfigure ()
  10.119 +  (concat (YaTeX:read-position "rlpv")
  10.120 +	  (YaTeX:read-length "Width: ")))
  10.121 +
  10.122 +(defvar YaTeX:geometry-default "margin=1.5cm,includeheadfoot,includemp"
  10.123 +  "*Default options for \\geometry{}")
  10.124 +(defun YaTeX::geometry (argp)
  10.125 +  "Add-in for \\geometry's option"
  10.126 +  ;; cf. https://dayinthelife.at.webry.info/201401/article_2.html
  10.127 +  (cond
  10.128 +   ((= argp 1)
  10.129 +    (YaTeX-help "geometry")
  10.130 +    (message "Change default by setting YaTeX:geometry-default")
  10.131 +    (if (string= YaTeX:geometry-default "") ""
  10.132 +      YaTeX:geometry-default))))
  10.133 +
  10.134 +(provide 'yatexpkg)
    11.1 --- a/yatexprc.el	Mon Nov 25 21:09:06 2019 +0900
    11.2 +++ b/yatexprc.el	Thu Dec 26 13:27:55 2019 +0859
    11.3 @@ -1,7 +1,7 @@
    11.4  ;;; yatexprc.el --- YaTeX process handler -*- coding: sjis -*-
    11.5  ;;; 
    11.6 -;;; (c)1993-2018 by HIROSE Yuuji.[yuuji@yatex.org]
    11.7 -;;; Last modified Mon Nov 25 21:01:57 2019 on monster
    11.8 +;;; (c)1993-2019 by HIROSE Yuuji.[yuuji@yatex.org]
    11.9 +;;; Last modified Thu Dec 26 12:48:12 2019 on firestorm
   11.10  ;;; $Id$
   11.11  
   11.12  ;;; Code:
   11.13 @@ -1353,6 +1353,8 @@
   11.14         (setq fname (substring fname 0 (rindex fname ?.))))
   11.15       ext)))
   11.16  
   11.17 +(defvar YaTeX-proc-feed-relative t
   11.18 +  "Non-nil means feed process relative path name of target file.")
   11.19  (defun YaTeX-get-latex-command (&optional switch)
   11.20    "Specify the latex-command name and its argument.
   11.21  If there is a line which begins with string: \"%#!\", the following
   11.22 @@ -1372,7 +1374,9 @@
   11.23  	  (cond
   11.24  	   (YaTeX-parent-file
   11.25  	    (if YaTeX-dos (expand-file-name YaTeX-parent-file)
   11.26 -	      YaTeX-parent-file))
   11.27 +	      (if YaTeX-proc-feed-relative
   11.28 +		  (file-relative-name YaTeX-parent-file)
   11.29 +		YaTeX-parent-file)))
   11.30  	   (t (save-excursion
   11.31  		(YaTeX-visit-main t)
   11.32  		(file-name-nondirectory (buffer-file-name)))))