zz学习数学要是碰到不明白的怎么办

发信人: quantumboy (学术孤儿), 信区: Mathematics
标 题: Re: 大家学习数学是碰到不明白的怎么办?
发信站: 水木社区 (Wed May 25 14:57:49 2011), 站内

while(弄不明白){
   if(中文书||中文paper)
      撕掉或者烧掉
   else if(法国人写的尤其是布尔巴基写的)
      包好压入箱底
   else if(英美人写的)
      换一本日本或俄国,德国写的
   else if(日,俄,德写的)
      goto wikipedia.com
   else if(不想放弃)
      自己写一本能明白的
   else
      学个编程语言去挣钱吧,别耽误工夫了
}

【 在 automorphic (阿姆鲁索) 的大作中提到: 】
: 无人可问。查书还是自己推?大家说说经验。

Wrong type argument error in pst-node style of AUCTeX

Using AUCTeX 11.86 under Emacs 24.0.50.1. Activated pst-node style. Pressed C-c C-e to insert a psmatrix environment, entered nothing on “Options” and encountered the error:
let: Wrong type argument: char-or-string-p, (“”)

The “Options” can auto-complete with psmatrix options such as rowsep, colsep… Still didn’t work even if I entered something. Checked the pst-node.el under /emacs/site-lisp/auctex/style/:

;;; Environments
(defun LaTeX-pstnode-env-psmatrix (env)
  "Return psmatrix environment with arguments."
  (let ((opt (completing-read-multiple "Options: "
                                       LaTeX-pstnode-psmatrix-list)))
    (LaTeX-insert-environment env opt)))

completing-read-multiple comes from crm.el, which enables the multiple auto completion. The return value is a list instead of a string, so LaTeX-insert-environment won’t accept it. Fixed the code as follows to loop over the list and insert the option items with comma and square brackets. It doesn’t look neat but it works anyway.

;;; Environments
;;; Changed by James Lao
(defun LaTeX-pstnode-env-psmatrix (env)
  "Return psmatrix environment with arguments."
  (let ((opt (completing-read-multiple "Options: "
                                       LaTeX-pstnode-psmatrix-list)))
    (setq opto "")
    (while opt
      (if (string= opto "")
	  (setq opto (car opt))
      (setq opto (concat opto ", " (car opt))))
      (setq opt (cdr opt)))
    (LaTeX-insert-environment env (concat "[" opto "]"))))

I’ve never used the mailing list and would appreciate if someone could help me check with the development team…

preview-latex在GS9.00下报错

在emacs下其实很久不用preview-latex了,一直觉得没有必要——但是忽然用一下的时候发现不能用还是很郁闷的。基本上报错是这样的:

"GSWIN32C.EXE" "-dOutputFile=(_region_.prv/tmp5723kvc/pr1-1.png)" "-q""-dSAFER" "-dNOPAUSE" "-DNOPLATFONTS" "-dPrinted" "-dTextAlphaBits=4""-dGraphicsAlphaBits=4" "-sDEVICE=png16m" "-r70.4906x70.6156"
GS>{DELAYSAFER{.setsafe}if}stopped pop/.preview-BPcurrentpagedevice/BeginPage get dup null eq{pop{pop}bind}ifdef<</BeginPage{currentpagedevice/PageSize get dup 0 get 1 ne exch 1get 1 ne or{.preview-BP }{pop}ifelse}bind/PageSize[1 1]>>setpagedevice/preview-do{[count 3 roll save]3 1 roll dup length 0 eq{pop}{setpagedevice}{ifelse .runandhide}stopped{handleerror quit}if aload pop restore}bind def[(_region_.prv/tmp3712kvc/preview.dsc)(r)file]aload exch dup 0 setfileposition 520()/SubFileDecode filter cvx .runandhide aload pop dup dup 623 setfileposition 50()/SubFileDecode filter cvx<<>>preview-do
Error: /invalidfileaccess in --file--

查了一通后来发现有人遇到这个问题之后把GS降级到8.71以下就好了。说明GS在近来做了一些改动。左看右看看到了-dSAFER这个参数——这个参数本意是要加强权限检查防止gs自动打开系统文件权限——但和权限相关的也只有它了。试着在命令行下重新跑着两个命令(用gswin32会容易些,否则后面这个长命令贴都贴不进去),居然跑通了。又大致查了查,貌似可能是一个BUG,不过我升级到了最新的9.02也没有解决这个问题。

既然如此,到site-lisp/auctex/preview.elc(最好还是用.el重新编译一下) 下面找到
(defcustom preview-gs-options '("-q" "-dSAFER" "-dNOPAUSE" "-DNOPLATFONTS" "-dPrinted" "-dTextAlphaBits=4" "-dGraphicsAlphaBits=4")
-dSAFER一项干掉就是了。虽然这似乎是一个“漏洞”,不过就自己跑跑preview来看,应该没太大风险。

一个更为稳妥的办法是在.emacs里面加上'(preview-gs-options (quote ("-q" "-dNOPAUSE" "-DNOPLATFONTS" "-dPrinted" "-dTextAlphaBits=4" "-dGraphicsAlphaBits=4"))),就好了