Mercurial > hgrepos > hgweb.cgi > yatex
comparison yatexadd.el @ 609:c1b39bbfcf34 draft default
Merged with 1.83
author | HIROSE Yuuji <yuuji@gentei.org> |
---|---|
date | Sun, 25 Dec 2022 14:13:45 +0900 |
parents | 38a414d755c1 |
children |
comparison
equal
deleted
inserted
replaced
594:638284a7a9d0 | 609:c1b39bbfcf34 |
---|---|
1 ;;; yatexadd.el --- YaTeX add-in functions -*- coding: sjis -*- | 1 ;;; yatexadd.el --- YaTeX add-in functions -*- coding: sjis -*- |
2 ;;; (c)1991-2019 by HIROSE Yuuji.[yuuji@yatex.org] | 2 ;;; (c)1991-2022 by HIROSE Yuuji.[yuuji@yatex.org] |
3 ;;; Last modified Thu Sep 22 11:41:04 2022 on firestorm | 3 ;;; Last modified Fri Dec 2 08:40:27 2022 on firestorm |
4 ;;; $Id$ | 4 ;;; $Id$ |
5 | 5 |
6 ;;; Code: | 6 ;;; Code: |
7 ;;; | 7 ;;; |
8 ;;Sample functions for LaTeX environment. | 8 ;;Sample functions for LaTeX environment. |
1853 '(("a4paper") ("a5paper") ("b4paper") ("b5paper") ("10pt") ("11pt") ("12pt") | 1853 '(("a4paper") ("a5paper") ("b4paper") ("b5paper") ("10pt") ("11pt") ("12pt") |
1854 ("latterpaper") ("legalpaper") ("executivepaper") ("landscape") | 1854 ("latterpaper") ("legalpaper") ("executivepaper") ("landscape") |
1855 ("oneside") ("twoside") ("draft") ("final") ("leqno") ("fleqn") ("openbib") | 1855 ("oneside") ("twoside") ("draft") ("final") ("leqno") ("fleqn") ("openbib") |
1856 ("tombow") ("titlepage") ("notitlepage") ("dvips") | 1856 ("tombow") ("titlepage") ("notitlepage") ("dvips") |
1857 ("mingoth") ;for jsarticle | 1857 ("mingoth") ;for jsarticle |
1858 ("uplatex") ;for uplatex | |
1858 ("clock") ;for slides class only | 1859 ("clock") ;for slides class only |
1859 ) | 1860 ) |
1860 "Default options list for documentclass") | 1861 "Default options list for documentclass") |
1861 (defvar YaTeX:documentclass-options-private nil | 1862 (defvar YaTeX:documentclass-options-private nil |
1862 "*User defined options list for documentclass") | 1863 "*User defined options list for documentclass") |
1890 (concat "[" opt "]")) | 1891 (concat "[" opt "]")) |
1891 ""))) | 1892 ""))) |
1892 | 1893 |
1893 (defvar YaTeX:documentclasses-default | 1894 (defvar YaTeX:documentclasses-default |
1894 '(("article") ("jarticle") ("report") ("jreport") ("book") ("jbook") | 1895 '(("article") ("jarticle") ("report") ("jreport") ("book") ("jbook") |
1895 ("jsarticle") ("jsbook") | 1896 ("ltjsarticle") ("ltjsreport") ("ltjsbook") |
1897 ("ltjarticle") ("ltjreport") ("ltjbook") | |
1898 ("jsarticle") ("jsreport") ("jsbook") | |
1896 ("j-article") ("j-report") ("j-book") | 1899 ("j-article") ("j-report") ("j-book") |
1897 ("letter") ("slides") ("ltxdoc") ("ltxguide") ("ltnews") ("proc")) | 1900 ("letter") ("slides") ("ltxdoc") ("ltxguide") ("ltnews") ("proc")) |
1898 "Default documentclass alist") | 1901 "Default documentclass alist") |
1899 (defvar YaTeX:documentclasses-private nil | 1902 (defvar YaTeX:documentclasses-private nil |
1900 "*User defined documentclass alist") | 1903 "*User defined documentclass alist") |
2096 '(width height scale angle))) | 2099 '(width height scale angle))) |
2097 ",")) | 2100 ",")) |
2098 (if (string= "" str) "" | 2101 (if (string= "" str) "" |
2099 (concat "[" str "]")))) | 2102 (concat "[" str "]")))) |
2100 | 2103 |
2101 (defvar YaTeX::get-boundingbox-cmd YaTeX-cmd-gs | 2104 (defvar YaTeX::get-boundingbox-cmd |
2105 (or (YaTeX-executable-find "extractbb") YaTeX-cmd-gs) | |
2102 "Command to get bounding box from PDF files. | 2106 "Command to get bounding box from PDF files. |
2103 Possible values are `gs' and `extractbb'.") | 2107 Possible values are `gs' and `extractbb'.") |
2104 | 2108 |
2105 (defun YaTeX::get-boundingbox (file) | 2109 (defun YaTeX::get-boundingbox (file) |
2106 "Return the bound box as a string | 2110 "Return the bound box as a string |
2130 (and (string-match "\\.\\(jpe?g\\|png\\|gif\\|bmp\\|pdf\\)$" imgfile) | 2134 (and (string-match "\\.\\(jpe?g\\|png\\|gif\\|bmp\\|pdf\\)$" imgfile) |
2131 (file-exists-p imgfilepath) | 2135 (file-exists-p imgfilepath) |
2132 (or (fboundp 'yahtml-get-image-info) | 2136 (or (fboundp 'yahtml-get-image-info) |
2133 (progn | 2137 (progn |
2134 (load "yahtml" t) (featurep 'yahtml))) ;(require 'yahtml nil t) | 2138 (load "yahtml" t) (featurep 'yahtml))) ;(require 'yahtml nil t) |
2135 (if (string-match "\\.pdf" imgfile) | 2139 (if (string-match "\\.\\(pdf\\|png\\)" imgfile) |
2136 (and | 2140 (and |
2137 (setq info (YaTeX::get-boundingbox imgfilepath)) | 2141 (setq info (YaTeX::get-boundingbox imgfilepath)) |
2138 (stringp info) | 2142 (stringp info) |
2139 (string< "" info) | 2143 (string< "" info) |
2140 (setq bb (format "bb=%s" info))) | 2144 (setq bb (format "bb=%s" info))) |
2248 ((memq c '(?s ?S)) (setq left "{\\small " right "}")) | 2252 ((memq c '(?s ?S)) (setq left "{\\small " right "}")) |
2249 ((memq c '(?t ?T)) (setq left "{\\tiny " right "}")) | 2253 ((memq c '(?t ?T)) (setq left "{\\tiny " right "}")) |
2250 ((memq c '(?c ?C)) (setq left "{\\scriptsize " right "}"))) | 2254 ((memq c '(?c ?C)) (setq left "{\\scriptsize " right "}"))) |
2251 (format "%s%s%s" left char right))))) | 2255 (format "%s%s%s" left char right))))) |
2252 | 2256 |
2257 | |
2258 ;;; -------------------- booktab staff -------------------- | |
2259 (defun YaTeX::toprule (argp) | |
2260 (if (equal argp 1) (YaTeX:read-length "Top Rule Width: "))) | |
2261 (defun YaTeX::midrule (argp) | |
2262 (if (equal argp 1) (YaTeX:read-length "Middle Rule Width: "))) | |
2263 (defun YaTeX::cmidrule (argp) | |
2264 (if (equal argp 1) (YaTeX:read-length "Inter-Columns Rule Width: "))) | |
2265 (defun YaTeX::bottomrule (argp) | |
2266 (if (equal argp 1) (YaTeX:read-length "Bottom Rule Width: "))) | |
2267 (defun YaTeX::addlinespace (argp) | |
2268 (if (equal argp 1) (YaTeX:read-length "Additional Line space: "))) | |
2269 (defun YaTeX::specialrule (argp) | |
2270 (if (equal argp 1) (YaTeX:read-length "Special rule: "))) | |
2271 | |
2253 ;;; -------------------- beamer stuff -------------------- | 2272 ;;; -------------------- beamer stuff -------------------- |
2254 (defvar YaTeX:frame-option-alist-default | 2273 (defvar YaTeX:frame-option-alist-default |
2255 '(("plain") ("containsverbatim") ("shrink") ("squeeze") | 2274 '(("plain") ("containsverbatim") ("shrink") ("squeeze") |
2256 ("allowframebreaks") ("label="))) | 2275 ("allowframebreaks") ("label="))) |
2257 (defvar YaTeX:frame-option-alist-private nil | 2276 (defvar YaTeX:frame-option-alist-private nil |