Using Markdown Syntax
脚步慢一些,等一下你的灵魂。
h1
文字超链:Inline方式,Tooltips可省略
h2
- italic
- bold
My First Header
This is some content in my first section.
| First Header | Second Header |
|---|---|
| Content Cell | Content Cell |
| Content Cell | Content Cell |
This is true markdown text using p tag.
My Second Header
This is some content in my second section.
代码:行内代码
在第一行后指定编程语言,也可以不指定
Func:读文本内容
#include <string.h>
#include<stdlib.h>
#include<stdio.h>
void tst_fun(int val)
{
printf("%d\n",val);
}
int main(int argc, char** argv)
{
FILE* pf = fopen("e:\\a.txt","rb");
if(pf == NULL)
{
//err_handle();
return (1);
}
const int BUFFLEN=200;
char buffer[BUFFLEN];
while(!feof(pf)) //判断是否到了文件末尾
{
//读取一行文件内容
fgets(buffer,BUFFLEN,pf);
//handle stream
char* pindex = strstr(buffer,"、");
if(pindex == NULL)
{
continue;
}else
{
pindex+=1;
}
int iVal = atoi(pindex);
//call function
tst_fun(iVal);
}
fclose(pf);
return 0;
}
代码:段落代码 每行文字前加4个空格或者1个Tab
<!-- 注释 -->
val s = "hello Markdown"
println( s )
代码:hexo 可指定编程语言,『』代表左右大括号
『% codeblock [title] [lang:language] [url] [link text] %』
code snippet
『% endcodeblock %』
转义字符 Markdown中的转义字符为\,转义的有:
\\ 反斜杠
\` 反引号
\* 星号
\_ 下划线
\{\} 大括号
\[\] 中括号
\(\) 小括号
\# 井号
\+ 加号
\- 减号
\. 英文句号
\! 感叹号
其它
文本中可直接用html标签,但是要前后加上空行。
one more thing:表格 Markdown的扩展语法,hexo不支持
|| *Year* || *Temperature (low)* || *Temperature (high)* ||
|| 1900 || -10 || 25 ||
|| 1910 || -15 || 30 ||
|| 1920 || -10 || 32 ||
The Normal Distribution
The normal distribution is defined as follows:
<!--latex公式-->
$$latex
f(x;\mu,\sigma^2) = \frac{1}{\sigma\sqrt{2\pi}} e^{ -\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2 }
$$
To generate random draws from a normal distribution we use the rnorm function:
{r block1}
output <- rnorm(1000, 100, 15);
The normal distribution has the typical bell shape:
{r block2, fig.width=8, fig.height=5}
ggplot2::qplot(output)
结束语
以上基本够用,更详尽的请参考文献10,另外Markdown+R可以干大事,请参考文献7。
参考文献
1.不如
My Third Header
This is some content in my three section.
- Bird
- Magic
My Header
This is some content in my first section.
This is h1
This is h2
This is h3
This is h4
This is h5
This is h6
自动链接:尖括号
索引超链:Reference方式,索引1 2可以是任意字符
图片超链
多个感叹号,Tooltips可省略,要设置大小只能借助HTML标记
