---
title: "在博客中用latex写公式"
author: "mmdev"
date: "2013-02-25T04:26:00Z"
tags: []
slug: "latex"
draft: false
lastmod: "2013-03-06T09:34:13Z"
id: 1823074
url: "https://mmdev.iteye.com/blog/1823074"
---

## 在博客中插入Latex 公式的方法：

1\. 访问[Latex在线编辑器](http://www.codecogs.com/latex/eqneditor.php)，将下方code复制到博客中的源代码里，如：

**\[plain]**[view plain](http://blog.csdn.net/abcjennifer/article/details/8036018 "view plain")[copy](http://blog.csdn.net/abcjennifer/article/details/8036018 "copy")

1. P(x|c)=\\frac{P(c|x)\\cdotP(x)}{P(x)}

得到

**\[html]**[view plain](http://blog.csdn.net/abcjennifer/article/details/8036018 "view plain")[copy](http://blog.csdn.net/abcjennifer/article/details/8036018 "copy")

1. &lt;ahref="http://www.codecogs.com/eqnedit.php?latex=P(x|c)=\\frac{P(c|x)\\cdotP(x)}{P(x)}"target="\_blank"&gt;&lt;imgsrc="http://latex.codecogs.com/gif.latex?P(x|c)=\\frac{P(c|x)\\cdotP(x)}{P(x)}"title="P(x|c)=\\frac{P(c|x)\\cdotP(x)}{P(x)}"/&gt;&lt;/a&gt;

插入源代码，得到：

[![](http://latex.codecogs.com/gif.latex?P%28x%7Cc%29=%5Cfrac%7BP%28c%7Cx%29%5Ccdot%20P%28x%29%7D%7BP%28x%29%7D "P(x|c)=\frac{P(c|x)\cdot P(x)}{P(x)}")](http://www.codecogs.com/eqnedit.php?latex=P%28x%7Cc%29%3D%5Cfrac%7BP%28c%7Cx%29%5Ccdot%20P%28x%29%7D%7BP%28x%29%7D)

或者直接在html中添加：&lt;img src="http://latex.codecogs.com/gif.latex?在这里填写你的latex代码" /&gt;  
例如：&lt;img src="http://latex.codecogs.com/gif.latex?35\*d\_5+1(\\oe%20)" /&gt;

![](http://latex.codecogs.com/gif.latex?35%2Ad_5%201%28%5Coe%20%29)

2.[公式手写器](http://webdemo.visionobjects.com/equation.html?locale=zh_CN)

只要手写就好了哦，亲！！！

[链接在此](http://webdemo.visionobjects.com/equation.html?locale=zh_CN)~~

3.Google Chart Tools / Image Charts

Google Chart地址：

- [http://chart.apis.google.com/chart?cht=tx&chl=](http://chart.apis.google.com/chart?cht=tx&chl= "http://chart.apis.google.com/chart?cht=tx&chl=")(个人测试好像不能使用https；基于Google主域名，相对安全–指Google主域名一般不会撞墙)
- [http://chart.googleapis.com/chart?cht=tx&chl=](http://chart.googleapis.com/chart?cht=tx&chl= "http://chart.googleapis.com/chart?cht=tx&chl=")(非SSL链接，基于Google Apis域名)
- [https://chart.googleapis.com/chart?cht=tx&chl=](https://chart.googleapis.com/chart?cht=tx&chl= "https://chart.googleapis.com/chart?cht=tx&chl=")(安全链接，基于Google Apis域名)

但Google Chart对于插入公式来说是大材小用了。

除了常规的饼形图、折线图、冒泡图和柱状图等，还有QR二维码、能量条、极坐标图……好吧，只要你能想到，就能通过URL调用。

Reference:

1.[吉博的blog](http://www.cnblogs.com/jilichuan/archive/2012/08/28/2660833.html)

2\. Latex 公式的书写：[Practice Box](http://www.forkosh.com/mathtextutorial.html)

3.[Delbert's Blog](http://delbert.me/archives/346.html)