博客中插入公式——之在線數學公式生成

在寫Matlab筆記時,其中要輸入一些公式。若是用截圖,上傳圖片到博客中,會由於截的圖大小不一很難看,並且圖片數據很大,很不科學,這有點麻煩!javascript

so,我google搜索下解決方法和資源,整理以下:php

首先確定是解決如何在博客中插入公式:

1,在博客設置中,html頭中添加代碼,導入mathML庫如: <script type="text/javascript" src="http://common.cnblogs.com/script/ASCIIMathML.js"></script>html

而後直接在博客中(不是html)書寫latex語法公式,公式先後有$ \$ $ 來包圍住,例如$\$$\frac{{-b}\pm\sqrt{b^2-4ac}}{2a}$\$$,就會顯示:java

 \frac{{-b}\pm\sqrt{b^2-4ac}}{2a} $ web

2,或者直接在html中添加:<img src="http://latex.codecogs.com/gif.latex?在這裏填寫你的latex代碼" /> 
 例如:<img src="http://latex.codecogs.com/gif.latex?35*d_5+1(\oe%20)"  />字體

 

參考文獻:HZAU_追風少年的博客網站

如今最主要的是要獲得公式的LaTex代碼:

一、會寫LaTex的

 

二、MathType to LaTex

之前熟悉MathType的使用,在想MathType能不能生成LaTex代碼,沒想到果真有
具體步驟: 在 Mathtype 的 Preference(參數) 中,選 Translator(轉換),會出來一個對話框,而後選 Translation to other language (text),裏面就有 Tex-AMS-LaTex 等選項。設定好以後就能夠直接選中部分公式,Ctrl+C 複製,而後再粘貼到文本中就直接看到代碼了。能夠把代碼貼到這裏有相應的網站看代碼生成公式的效果。查看效果。

MathType 中Ctrl+C獲得的代碼:
[plain]  view plain copy
 
 
  1. % MathType!MTEF!2!1!+-  
  2. % feaaguart1ev2aaatCvAUfeBSjuyZL2yd9gzLbvyNv2CaerbuLwBLn  
  3. % hiov2DGi1BTfMBaeXatLxBI9gBaerbd9wDYLwzYbItLDharqqtubsr  
  4. % 4rNCHbWexLMBbXgBd9gzLbvyNv2CaeHbl7mZLdGeaGqiVu0Je9sqqr  
  5. % pepC0xbbL8F4rqqrFfpeea0xe9Lq-Jc9vqaqpepm0xbba9pwe9Q8fs  
  6. % 0-yqaqpepae9pg0FirpepeKkFr0xfr-xfr-xb9adbaqaaeGaciGaai  
  7. % aabeqaamaabaabauaakeaadaGabaabaeqabaGaamyyaiabgUcaRiaa  
  8. % dkgacqGHRaWkcaWG4bGaeyypa0JaaG4maiaadMhaaeaacaWGHbGaam  
  9. % iEaiabgkHiTiaadkgacaWG5bGaeyypa0JaaGymaaqaaiaadggacaWG  
  10. % IbGaey4kaSIaamiEaiaadMhacqGH9aqpcaaIYaaabaGaamyyaiabgU  
  11. % caRiaadkgacqGH9aqpcaGGOaGaamiEaiabgUcaRiaadMhacaGGPaWa  
  12. % aWbaaSqabeaacaaIYaaaaaaakiaawUhaaaaa!5D4F!  
  13. \[\left\{ \begin{gathered}  
  14.   a + b + x = 3y \hfill \\  
  15.   ax - by = 1 \hfill \\  
  16.   ab + xy = 2 \hfill \\  
  17.   a + b = {(x + y)^2} \hfill \\   
  18. \end{gathered}  \right.\]  
只要把
[plain]  view plain copy
 
 
  1. \[\left\{ \begin{gathered}  
  2.   a + b + x = 3y \hfill \\  
  3.   ax - by = 1 \hfill \\  
  4.   ab + xy = 2 \hfill \\  
  5.   a + b = {(x + y)^2} \hfill \\   
  6. \end{gathered}  \right.\]  

加入到 <img src="http://latex.codecogs.com/gif.latex? 在這裏填寫你的latex代碼 " />  紅色字體當中
注意:代碼中有空格的地方一概用%20替代,由於網址中%20就表明空格;
最終的網址是     http://latex.codecogs.com/gif.latex?\left\{%20\begin{gathered}%20a%20+%20b%20+%20x%20=%203y%20\hfill%20\\%20ax%20-%20by%20=%201%20\hfill%20\\%20ab%20+%20xy%20=%202%20\hfill%20\\%20a%20+%20b%20=%20{(x%20+%20y)^2}%20\hfill%20\\%20\end{gathered}%20\right.

 

三、在線數學公式輸入google

網址1:http://codecogs.com/latex/eqneditor.php
網址2:http://www.numberempire.com/texequationeditor/equationeditor.php
網址3:http://webdemo.visionobjects.com/equation.html?locale=zh_CN
 
注意:網址3是經過鼠標畫而生成公式的,識別比較準確,但對於多行的方程組很差用,單行公式的輸入最佳。
相關文章
相關標籤/搜索