日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > windows >内容正文

windows

(How to)Windows Live Writer插入Latex公式

發布時間:2025/4/16 windows 23 豆豆
生活随笔 收集整理的這篇文章主要介紹了 (How to)Windows Live Writer插入Latex公式 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1、首先構建出如下窗體:

????

private void InitializeComponent() {this.buttonOK = new System.Windows.Forms.Button();this.textBoxLaTeX = new System.Windows.Forms.TextBox();this.label1 = new System.Windows.Forms.Label();this.SuspendLayout();...}

2、在buttonOK_Click事件中構造要插入的代碼:

public partial class LaTeXInput : Form {// Constructorpublic LaTeXInput() {InitializeComponent();}// public propertiespublic string ResultHTML {get { return m_result_gchart_html; }}// data membersstring m_result_gchart_html = "";private void buttonOK_Click(object sender, EventArgs e) {// get original latex string, and encode itstring raw_latex = textBoxLaTeX.Text;string encoded_str = HttpUtility.UrlEncode(raw_latex);string gchart_url = "http://chart.googleapis.com/chart?cht=tx&chl=" + encoded_str;m_result_gchart_html = String.Format("<p><img src=\"{0}\" /></p>", gchart_url);this.DialogResult = DialogResult.OK;} }

3、根據Windows Live Writer插件編寫規范編寫自己的插件類:

[WriterPluginAttribute("24E0269C-D61B-11E0-A846-6D254824019B","LaTeX Chart",Description = "A simple LaTeX render plugin for Windows Live Writer",HasEditableOptions = false,ImagePath = "formula_icon.jpg",PublisherUrl = "http://liselsia.org")][InsertableContentSourceAttribute("LaTeX Chart")]public class LaTeXPlugin : ContentSource {public override DialogResult CreateContent(IWin32Window dialogOwner, ref string content) {LaTeXInput input_form = new LaTeXInput();if (DialogResult.OK == input_form.ShowDialog()) {content = input_form.ResultHTML;}input_form.Dispose();return DialogResult.OK;} }

注:只要改動第二個ref傳入的content參數,就能直接改變最終在Live Writer里要加入的HTML代碼。而為了彈出如下的一個輸入LaTeX的對話框,又需要添加一個Windows Form窗口,同時加上System.Windows.Forms.dll的.NET庫的引用。然后以上述代碼所示的input_form.ShowDialog()的方式彈出模態對話框(modal dialog)。

項目地址:https://code.google.com/p/wlwlatex/

SVN:http://wlwlatex.googlecode.com/svn/trunk/

轉載于:https://www.cnblogs.com/Ymete/archive/2012/12/28/2837494.html

總結

以上是生活随笔為你收集整理的(How to)Windows Live Writer插入Latex公式的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。