
From:  Lukasz Stafiniak 
Subject:  Re: [AUCTeXdevel] Feature Request: PreviewLaTeX in not TeX mode 
Date:  Sat, 10 Feb 2007 02:53:31 +0100 
Why don't you want TeX mode? There is a best of all worlds solution: use MMM mode. * Learn about MMM (Multi Mode Mode) which allows having regionssubnodes with major modes different than the major mode for the file; install it. * add your TeXcomments submode with the standard math delimiters (also works with JsMath): (mmmaddclasses '((latexmathcomments :submode latexmode :face mmmdeclarationsubmodeface :front "\\({\\)$$?" :back "$?$\\(}\\)" :frontmatch 1 :backmatch 1 :insert ((?$ inlinemath . (nil @ "{" @ "$" _ "$" @ "}" @ )) (?[ math . (nil @ "{" @ "$$" _ "$$" @ "}" @ )))))) (mmmaddmodeextclass 'pmwikimode nil 'latexmathcomments) * Add a preamble file (a TeX file with empty body, which loads libraries you use in your TeX comments) to directories with your source, let's store its full path as `preamblefilename'. * After you load your source into the buffer, set: (set 'TeXheaderend "^[^%\n]*\\\\begin *{document}") (set 'TeXtrailerstart "^[^%\n]*\\\\end *{document}") (set 'TeXmaster preamblefilename) * Report how this works. On 2/9/07, Masayuki Ataka <address@hidden> wrote:
Hi, AokiSan sent me a feature request for previewlatex, that users could write TeX commands in comments in program source files, and preview them using previewlatex. Source example: >>> fib.c <<< /* Return Fibonacci Numbers : $F_1=1,\ F_2=2,\ F_{n+2} = F_n + F_{n+1} \quad (n \ge 1)$ */ int fib(int a){ ... >>> END fib.c <<< Mathematicians and physicists often write program codes to simulate complex math formula, so it is helpful for them to write math formula using TeX commands and preview it just in source comments. I think, we can write a function such as previewcomments, by changing previewregion and adding some preprocesses. But I'm not familiar with previewlatex. Could you give me a comments?  email: address@hidden Name:: Masayuki Ataka // (Japan) _______________________________________________ auctexdevel mailing list address@hidden http://lists.gnu.org/mailman/listinfo/auctexdevel
[Prev in Thread]  Current Thread  [Next in Thread] 