Pages

Saturday, July 20, 2013

TeX Live:tlmgr管理工具、宏包安装位置

本文依据TeX Live 官方中文文档写成(texlive-zh-cn),命令行输入texdoc texlive-zh-cn命令可打开此文件

tlmgr管理工具简单使用教程

Tex Live 包含一个叫 tlmgr 的程序,它可以用来管理安装后的TeX Live系统。

基本使用

  • 打开图形界面:
    tlmgr -gui
Windows用户也可从开始菜单打开。
  • 在初始安装之后,你可以用下面的命令更新系统:
    tlmgr update -all
  • 如果这太激进了一点,先尝试:
    tlmgr update -all -dry-run
  • 或 (产生更少输出):
    tlmgr update -list
  • 下面这个更复杂一点的例子从本地目录添加了一个新的软件包集合,用于 XeTeX 引擎。
    tlmgr -repository /local/mirror/tlnet install collection-xetex
(输出省略)
tlmgr 会安装所有依赖的包,也会处理所有包括刷新文件名数据库和重新生成格式文件在内的所有必要的安装后工作。上面给 XeTeX 生成了新的格式文件。
  • 要描述一个包 (或者集合、安装方案):
    tlmgr show collection-latexextra

Tex Live 目录结构与宏包安装位置

Tex Live 的顶层目录

顶层目录

bin TEX         系统程序,按平台组织。
readme.html     网页,提供了多种语言的简介和有用的链接。
readme-*.dir    Tex Live 多种语言的简介和有用的链接,同时有 HTML 和纯文本版本。
source          所有程序的源代码,包括主要的基于 Web2C  TEX 发行版。
texmf-dist      最主要的文件树,见下文的 TEXMFDIST
tlpkg           用来维护安装程序所用到的脚本,程序和数据,以及对 Windows 的特殊支持。

文档

命令:texdoc name-to-lookup

如:
texdoc texlive-zh-cn   # 打开TeX Live的中文文档
texdoc ctex
顶层目录下的 doc.html 文件中提供的完整的链接会有帮助。程序的文档 (手册,man page, Info 文件等) 在 texmf-dist/doc 目录下,因为这些程序本身是属于 texmf 目录的。TEX 宏包与格式文件的文档则放在 texmf-dist/doc 目录。但不管放在哪个地方,你都可以使用 texdoc 程序来寻找这些文档。
TeX Live 本身的文档在 texmf-dist/doc/texlive 目录下。

预定义的 texmf 目录树概览

所有这些目录树,包括个人的,都应该遵循 TEX 目录结构 (TDS, http://tug.org/tds),包括其 中所有细小的子目录,否则文件就可能找不到。

命令:tlmgr conf 列出系统中用于指定 texmf 目录的所有预定义变量

输出示例:
=========================== version information ==========================
tlmgr revision 31082 (2013-07-03 06:25:56 +0200)
tlmgr using installation: /opt/texlive/2013
TeX Live (http://tug.org/texlive) version 2013

==================== executables found by searching PATH =================
PATH: /usr/local/bin:/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/texlive/2013/bin/x86_64-linux
kpsewhich: /usr/local/bin/kpsewhich
updmap: /usr/local/bin/updmap
fmtutil: /usr/local/bin/fmtutil
tlmgr: /usr/local/bin/tlmgr
tex: /usr/local/bin/tex
pdftex: /usr/local/bin/pdftex
mktexpk: /usr/local/bin/mktexpk
dvips: /usr/local/bin/dvips
dvipdfmx: /usr/local/bin/dvipdfmx
=========================== active config files ==========================
texmf.cnf: /opt/texlive/2013/texmf.cnf
updmap.cfg: /opt/texlive/2013/texmf-dist/web2c/updmap.cfg
fmtutil.cnf: /opt/texlive/2013/texmf-var/web2c/fmtutil.cnf
config.ps: /opt/texlive/2013/texmf-dist/dvips/config/config.ps
mktex.cnf: /opt/texlive/2013/texmf-dist/web2c/mktex.cnf
pdftexconfig.tex: /opt/texlive/2013/texmf-dist/tex/generic/config/pdftexconfig.tex
============================= font map files =============================
psfonts.map: /opt/texlive/2013/texmf-var/fonts/map/dvips/updmap/psfonts.map
pdftex.map: /opt/texlive/2013/texmf-var/fonts/map/pdftex/updmap/pdftex.map
ps2pk.map: /opt/texlive/2013/texmf-var/fonts/map/dvips/updmap/ps2pk.map
dvipdfm.map: =========================== kpathsea variables ===========================
TEXMFMAIN=/opt/texlive/2013/texmf-dist
TEXMFDIST=/opt/texlive/2013/texmf-dist
TEXMFLOCAL=/opt/texlive/2013/../texmf-local
TEXMFSYSVAR=/opt/texlive/2013/texmf-var
TEXMFSYSCONFIG=/opt/texlive/2013/texmf-config
TEXMFVAR=/home/starfish/.texlive2013/texmf-var
TEXMFCONFIG=/home/starfish/.texlive2013/texmf-config
TEXMFHOME=/home/starfish/.texlive/texmf
VARTEXFONTS=/home/starfish/.texlive2013/texmf-var/fonts
TEXMF={/home/starfish/.texlive2013/texmf-config,/home/starfish/.texlive2013/texmf-var,/home/starfish/.texlive/texmf,!!/opt/texlive/2013/texmf-config,!!/opt/texlive/2013/texmf-var,!!/opt/texlive/2013/../texmf-local,!!/opt/texlive/2013/texmf-dist}
SYSTEXMF=/opt/texlive/2013/texmf-var:/opt/texlive/2013/../texmf-local:/opt/texlive/2013/texmf-dist
TEXMFDBS={!!/opt/texlive/2013/texmf-config,!!/opt/texlive/2013/texmf-var,!!/opt/texlive/2013/../texmf-local,!!/opt/texlive/2013/texmf-dist}
WEB2C={/home/starfish/.texlive2013/texmf-config,/home/starfish/.texlive2013/texmf-var,/home/starfish/.texlive/texmf,!!/opt/texlive/2013/texmf-config,!!/opt/texlive/2013/texmf-var,!!/opt/texlive/2013/../texmf-local,!!/opt/texlive/2013/texmf-dist}/web2c
TEXPSHEADERS=.:{/home/starfish/.texlive2013/texmf-config,/home/starfish/.texlive2013/texmf-var,/home/starfish/.texlive/texmf,!!/opt/texlive/2013/texmf-config,!!/opt/texlive/2013/texmf-var,!!/opt/texlive/2013/../texmf-local,!!/opt/texlive/2013/texmf-dist}/{dvips,fonts/{enc,type1,type42,type3}}//
TEXCONFIG={/home/starfish/.texlive2013/texmf-config,/home/starfish/.texlive2013/texmf-var,/home/starfish/.texlive/texmf,!!/opt/texlive/2013/texmf-config,!!/opt/texlive/2013/texmf-var,!!/opt/texlive/2013/../texmf-local,!!/opt/texlive/2013/texmf-dist}/dvips//
ENCFONTS=.:{/home/starfish/.texlive2013/texmf-config,/home/starfish/.texlive2013/texmf-var,/home/starfish/.texlive/texmf,!!/opt/texlive/2013/texmf-config,!!/opt/texlive/2013/texmf-var,!!/opt/texlive/2013/../texmf-local,!!/opt/texlive/2013/texmf-dist}/fonts/enc//
TEXFONTMAPS=.:{/home/starfish/.texlive2013/texmf-config,/home/starfish/.texlive2013/texmf-var,/home/starfish/.texlive/texmf,!!/opt/texlive/2013/texmf-config,!!/opt/texlive/2013/texmf-var,!!/opt/texlive/2013/../texmf-local,!!/opt/texlive/2013/texmf-dist}/fonts/map/{kpsewhich,pdftex,dvips,}//
==== kpathsea variables from environment only (ok if no output here) ====

预定义目录的意义

TEXMFDIST 这个目录树包含几乎所有原有发行版本的文件——配置文件、脚本、宏包、字体等等。唯一的例外是每个平台的可执行文件,存储在与它同级的 bin/ 目录下。
TEXMFLOCAL 系统管理员用来安装供整个系统使用的额外的或更新过的宏包、字体的目录。
TEXMFHOME 给用户存放它们自己独立安装的的宏包、字体等等。这个变量根据不同的用户选择不同的主目录。
TEXMFCONFIG  texconfigupdmap、和 fmtutil 这些程序存储个人修改过的配置文件。
TEXMFSYSCONFIG  texconfig-sysupdmap-sys  fmtutil-sys 这些程序存储修改过的全局文件。
TEXMFVAR 这个目录是给 texconfigupdmap  fmtutil 存储 (缓存) 格式文件、生成 map 文件这类运行时个人数据的。
TEXMFSYSVAR  texconfig-sysupdmap-sys  fmtutil-sys 还有 tlmgr 这几个命令存储、缓存运行时使用的格式文件和生成的 map 文件,对整个系统都有效。
TEXMFCACHE ConTEXt MkIV  LuaL A TEX用来保存(缓存的)运行时数据的目录树;缺省为TEXMFSYSVAR,如果该目录不可写,则使用 TEXMFVAR

默认的目录结构:

系统目录

全系统根目录 可以包含多个 TEX Live 版本:
    2012 上一个版本。
    2013 当前版本。
        bin
            i386-linux GNU/Linux 二进制文件
            ...
            universal-darwin Mac OS X 二进制文件
            win32 Windows 二进制文件
        texmf-dist TEXMFDIST  TEXMFMAIN
        texmf-var TEXMFSYSVAR, TEXMFCACHE
        texmf-config TEXMFSYSCONFIG
    texmf-local TEXMFLOCAL 用来存放在不同版本间共享的数据。

用户目录

用户主 (home) 目录 ($HOME 或 %USERPROFILE%)
    .texlive2012 给上个版本的,个人生成和配置的数据。
    .texlive2013 给这个版本的,个人生成和配置的数据。
        texmf-var TEXMFVAR, TEXMFCACHE
        texmf-config TEXMFCONFIG
    texmf TEXMFHOME 个人的宏包文件,等等。等等。
知道了TeX Live组织目录的规则,我们手动安插宏包、字体时就要有章可循了。
Written with StackEdit.

Thursday, July 18, 2013

试试数学公式MathJax MathML

我就试试-=-

一元二次方程 \(ax^2 + bx +c = 0\)的解为: \[ x_{1,2} = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a} \]

公式是使用MathJax渲染的\(\LaTeX{}\)代码。安装使用见这里: http://docs.mathjax.org/en/v1.1-latest/start.html

在Ubuntu中安装使用TexLive2013并为XeTeX设置中文字体

前天在Ubuntu 12.04下,使用网络安装的方法安装了TeX Live 2013。XeTeX最近成为中文LaTeX排版的新趋势,我也想尝试一下,因此卸载了系统源里的2012版,并安装2013版。因为XeTeX还没有正式发布,目前正在活跃的开发中,这一年时间肯定修正了不少bug,值得更新。

在线安装TeX Live 2013

下载安装文件

下载地址:http://www.tug.org/texlive/acquire-netinstall.html

安装

(官方中文指南下载:TeX Live指南

下载安装程序后,按照这个 Quick Install 就可以方便的安装了。这里把主要过程简记如下:

  1. 解压缩: tar xzf install-tl-unx.tar.gz
  2. CTAN网站选择一个离你近、速度快的CTAN的镜像站。我选的是ustc的HTTP源:http://mirrors.ustc.edu.cn/CTAN/,我这边ustc的开源软件源速度一直不错。
  3. 运行安装程序,并设置上一步选择的源,加快下载速度
    • 文本界面:./install-tl --location http://mirrors.ustc.edu.cn/CTAN/
    • 图形界面:./install-tl -gui --location http://mirrors.ustc.edu.cn/CTAN/。需要注意,使用图形界面需要安装perl-tk包(sudo apt-get install perl-tk),否则无法启动图形界面。
  4. 启动安装程序后有个选择安装位置的选项,我选的是/opt/texlive/2013(我对/opt/目录拥有写入权限,如果你对要安装的目录没有定稿权限,需要以root身份sudo ./install-tl 参数重新运行安装程序),TEXMFHOME变量选的是~/.texlive/texmf
  5. 我使用的是文本界面。写这篇文章时我已经安装好了,所以无法截图。需要注意的是install scheme,如果是新手,选full scheme可以省去很多麻烦。如果是LaTeX大神级的,那估计也不用看我的文章了=_=。我选的是custom selections of collections。然后进入customizing installation collections选择要安装的collection。这提供了比scheme更细的方法控制安装哪些包。选的越多需要的硬盘空间越大,全选的话需要3.9G的样子,我的选择需要1.9G,其中的字体和文档都是大部头,可以适当取消几个。
  6. 然后就是漫长的等待,我用了2个半小时安装完(事后看的,做完上面的选择就睡觉去了=_=)

安装后续处理

配置PATH环境变量

使用bash或者zsh的,在~/.profile里添加以下内容

PATH=$PATH:/opt/texlive/2013/bin/x86_64-linux export PATH

或者在安装过程中选择了在系统目录创建链接。如果没选,也可以运行tlmgr -gui,从菜单里选择创建链接。

为XeTeX安装中文字体

字体从哪儿来

  • 从Windows系统的Fonts目录复制: 用资源管理器打开C:\Windows\Fonts,以详细方式查看,点上方的Designed for(英文系统)排序,向下拉找到值为Han (Simplified)的字体,复制下来,送到Linux的~/.fonts目录。
  • Ubuntu源里的中文字体:文鼎、文泉驿(sudo apt-get install ttf-wqy-zenhei ttf-wqy-microhei xfonts-wqy fonts-arphic-ukai fonts-arphic-uming)。如果用那些版权字体不舒服,只用这两种也足够了。
  • Adobe 中文字体,好像是Adobe Reader自带的中文字体,具体不了解,可以免费获得。

安装字体

把获得的各种字体放到~/.fonts目录下。然后运行fc-cache -fv`更新系统字体缓存。

查看系统字体的名称

使用fc-list :lang=zh family style file spacing 命令查看安装的中文字体。其中字体的名称可能有英文、简中、繁中等多个,使用其中哪一个都行(应该是的)。可以使用下面的命令把这个列表保存到文件chinesefontname中,并对字体名进行排序

 fc-list :lang=zh family style file spacing | awk -F: 'BEGIN {OFS=" : "} {print $2 , $1 , $3 }' | sort > chinesefontname

把上面命令中的:lang=zh去掉可以查看系统中的所有字体。

让XeTeX找到TeX Live安装的字体

Linux系统下,需要配置一下XeTeX才能找到随TeX Live安装的字体。

  • 复制字体配置文件
cp /opt/texlive/2013/texmf-var/fonts/conf/texlive-fontconfig.conf ~/.fonts.conf  # 个人使用
# 或者
sudo cp /opt/texlive/2013/texmf-var/fonts/conf/texlive-fontconfig.conf /etc/fonts/conf.d/09-texlive.conf # 系统所有用户可用
  • 更新字体缓存
fc-cache -fv # 安装在~/.fonts.conf
# 或者
fc-cache -fsv # 安装在/etc/fonts/

注意一点,如果你的~/.fonts.conf中原来有内容,比如我就使用文泉驿Fontconfig Designer(视觉习惯) 生成过这个文件,这是个很好用的工具,不想丢掉它生成的内容,打开这两个文件比较一下,发现两个的内容可以合并。把texlive-fontconfig.conf处在fontconfig标签之间的三行

  <dir>/opt/texlive/2013/texmf-dist/fonts/opentype</dir>
  <dir>/opt/texlive/2013/texmf-dist/fonts/truetype</dir>
  <dir>/opt/texlive/2013/texmf-dist/fonts/type1</dir>

复制到~/.fonts.conf<fontconfig>标签的下一行即可。合并后的~/.fonts.conf的部分内容如下(前一个注释是我自己加的):

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!-- manually copied from /opt/texlive/2013/texmf-var/fonts/conf/texlive-fontconfig.conf used by XeTeX -->
  <dir>/opt/texlive/2013/texmf-dist/fonts/opentype</dir>
  <dir>/opt/texlive/2013/texmf-dist/fonts/truetype</dir>
  <dir>/opt/texlive/2013/texmf-dist/fonts/type1</dir>

<!-- created by WenQuanYi FcDesigner v0.5 -->
<match>
    <test name="family"><string>sans-serif</string></test>
    <edit name="family" mode="prepend" binding="strong">
......

在XeTeX中使用系统任意字体

示例如下

% !TEX program = xelatex

\documentclass[12pt,a4paper]{article}

\usepackage{ctex}
\usepackage{fontspec}

% 微软雅黑 \yahei
\setCJKfamilyfont{MSYAHEI}{微软雅黑}
\newcommand{\yahei}{\CJKfamily{MSYAHEI}}

% 楷体 \kai
\setCJKfamilyfont{KAITI}{楷体}
\newcommand{\kai}{\CJKfamily{KAITI}}

\setmainfont[BoldFont=黑体,ItalicFont=楷体]{宋体}
\setsansfont[BoldFont=黑体]{楷体}
\setmonofont{文泉驿等宽微米黑}

\XeTeXlinebreaklocale "zh"
\XeTeXlinebreakskip = 0pt plus 1pt minus 0.1pt

\begin{document}
\zihao{-4}
中文字体!(默认宋体) \\
{\yahei  微软雅黑字体} \\
\kai{楷体。两小儿问孔子} \\
\youyuan{xeCJK 系统定义好的幼圆字体}

\textsf{无衬线字体(楷体)} \\ 
\textbf{\textsf{无衬线字体粗体(黑体)}} \\
\texttt{打字机字体文(泉驿等宽微米黑)} \\

\end{document}

一定要使用xelatex编译,使用xetex不行。

输出果与预期稍有不同,\textsf好像把字体变成了仿宋(从输出的pdf文件看),原因不明。

The font "[SIMKAI.TTF]" cannot be found.

完整的错误如下

 ! fontspec error: "font-not-found"  
 !   
 ! The font "[SIMKAI.TTF]" cannot be found.  

原因是xeCJK配置文件里写的字体文件名与你实际用的文件名不一样,所以就看不到字体了。修正方法是修改texmf-dist/tex/latex/ctex/fontset/ctex-xecjk-winfonts.def文件,把里面的字体改成你在fc-list看到的正确字体,我修改的结果如下(把所有字体都改成了中文):

% ctex-xecjk-winfonts.def: Windows  xeCJK 字体设置,默认为六种中易字体
% vim:ft=tex

\setCJKmainfont[BoldFont={黑体},ItalicFont={楷体}]
  {宋体}
\setCJKsansfont{黑体}
\setCJKmonofont{仿宋}

> Blockquote

\setCJKfamilyfont{zhsong}{宋体}
\setCJKfamilyfont{zhhei}{黑体}
\setCJKfamilyfont{zhkai}{楷体}
\setCJKfamilyfont{zhfs}{仿宋}
\setCJKfamilyfont{zhli}{隶书}
\setCJKfamilyfont{zhyou}{幼圆}

\newcommand*{\songti}{\CJKfamily{zhsong}} % 宋体
\newcommand*{\heiti}{\CJKfamily{zhhei}}   % 黑体
\newcommand*{\kaishu}{\CJKfamily{zhkai}}  % 楷书
\newcommand*{\fangsong}{\CJKfamily{zhfs}} % 仿宋
\newcommand*{\lishu}{\CJKfamily{zhli}}    % 隶书
\newcommand*{\youyuan}{\CJKfamily{zhyou}} % 幼圆

\endinput

从这里可以看出,xeCJK为我们提供了6个预定义的字体命令:\songti, \heiti, \kaishu, \fangsong, \lishu, \youyuan,可以直接使用。1

Sunday, July 14, 2013

自定义Blogger:语法高亮、首行缩进、行距、字号

自定义Blogger:语法高亮、首行缩进、行距、字号


语法高亮

使用prettify
打开Template -> Edit HTML,在编辑器的前几行找到<head>标签(可以用Ctrl+F查找),在<head>标签下插入如下内容:
<script src="https://google-code-prettify.googlecode.com/svn/loader/run_prettify.js"></script>
点击Save Template,保存即可。

使用方法

<pre class="prettyprint">...</pre> <!--或者-->
<code class="prettyprint">...</code> 
<pre class="prettyprint linenums:4"> ... </pre> <!--行号从4开始-->

<pre class=prettyprint>
int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
  Continuation of comment */
int y = bar();
</pre>
int x = foo();  /* This is a comment  <span class="nocode">This is not code</span>
  Continuation of comment */
int y = bar();

首行缩进、行距、字号

许多博客默认的字号和行距太小,阅读时眼睛很累,看到那些密密麻麻的文字就没有仔细读的欲望。我喜欢行与行之间的距离大一点。字体也大一点。五号字适合打印,但绝对不适合屏幕阅读。
在Blogger后台Template -> Customize -> Advanced -> Add CSS里添加以下内容

.post-body p {
    text-indent: 2.0em;
    line-height:150%;
    font-size: 17px;
}

.post-body li{
line-height: 1.5em;
margin-bottom: 1em;
margin-top: 1em;
}

h2{
font-size: 1.3em;
margin-top: 1.2em;
margin-bottom: 1.2em;
}

h3{
font-size: 1.2em;
margin-top: 1.2em;
margin-bottom: 1.2em;
}
h4{
font-size: 1.1em;
margin-top: 1em;
margin-bottom: 1.1em;
}
这篇博文(codeitpretty.com)详细讲解了用CSS设置与字体相关的属性,有兴趣可以读一读,学习一下。
Written with StackEdit.

StackEdit Welcome document

Welcome to StackEdit!

Hello, I am your first Markdown document within StackEdit1. Don't delete me, I can be helpful. I can be recovered anyway in the Utils tab of the Settings dialog.


Documents

StackEdit stores your documents in the browser local storage, which means all your documents are automatically saved locally and are accessible offline.

Create a document

You can create a new document by clicking the button in the navigation bar. This will switch from the current document to the new one.

Switch to another document

You can list all your local documents and switch from one to another by clicking the button in the navigation bar.

Rename a document

You can rename the current document by clicking the document title in the navigation bar.

Delete a document

You can delete the current document by clicking the button in the navigation bar.


Synchronization

StackEdit can be combined with Google Drive and Dropbox to have your documents centralized in the Cloud. The synchronization mechanism will take care of uploading your modifications or downloading the latest version of your documents.

Import a document

You can import a document from the Cloud by going to the Google Drive or the Dropbox sub-menu and by clicking Import from.... Once imported, your document will be automatically synchronized with the Google Drive / Dropbox file.

Export a document

You can export any document by going to the Google Drive or the Dropbox sub-menu and by clicking Export to.... Even if your document is already synchronized with Google Drive or Dropbox, you can export it to a another location. StackEdit can synchronize one document with multiple locations.

Synchronize a document

Once your document is linked to a Google Drive or a Dropbox file, StackEdit will periodically (every 3 minutes) synchronize it by downloading/uploading any modification. Any conflict will be detected, and a local copy of your document will be created as a backup if necessary.

If you just have modified your document and you want to force the synchronization, click the button in the navigation bar.

NOTE: The button is disabled when:

  • you are offline,
  • or the document is not synchronized with any location,
  • or the document has not been modified since the last synchronization.

Manage document synchronization

Since one document can be synchronized with multiple locations, you can list and manage synchronized locations by clicking Manage synchronization in the menu. This will open a dialog box allowing you to add or remove synchronization links that are associated to your document.

NOTE: If you delete the file from Google Drive or from Dropbox, the document will no longer be synchronized with that location.


Publication

Once you are happy with your document, you can publish it on different websites directly from StackEdit. As for now, StackEdit can publish on Blogger, Dropbox, Gist, GitHub, Google Drive, Tumblr, WordPress and on any SSH server.

Publish a document

You can publish your document by going to the Publish on sub-menu and by choosing a website. In the dialog box, you can choose the publication format:

  • Markdown, to publish the Markdown text on a website that can interpret it (GitHub for instance),
  • HTML, to publish the document converted into HTML (on a blog for instance),
  • Template, to have a full control of the output.

NOTE: The default template is a simple webpage that wraps your document in HTML format. You can customize it in the Publish tab of the Settings dialog.

Update a publication

After publishing, StackEdit will keep your document linked to that publish location so that you can update it easily. Once you have modified your document and you want to update your publication, click on the button in the navigation bar.

NOTE: The button is disabled when:

  • you are offline,
  • or the document has not been published anywhere.

Manage document publication

Since one document can be published on multiple locations, you can list and manage publish locations by clicking Manage publication in the menu. This will open a dialog box allowing you to remove publication links that are associated to your document.

NOTE: In some cases, if you remove the file from the website or the post from the blog, the document will no longer be published on that location.


Markdown Extra

StackEdit supports Markdown Extra, which extends Markdown syntax with some nice features.

Tables

Markdown Extra has a special syntax for tables:

Item Value
Computer $1600
Phone $12
Pipe $1

You can specify column alignment with one or two colons:

Item Value Qty
Computer $1600 5
Phone $12 12
Pipe $1 234

Definition Lists

Markdown Extra has a special syntax for definition lists too:

Term 1
Term 2
Definition A
Definition B
Term 3

Definition C

Definition D

part of definition D

Fenced code blocks

GitHub's fenced code blocks are also supported with Prettify syntax highlighting:

// Foo
var bar = 0;

NOTE: To use Highlight.js instead of Prettify, just configure the Markdown Extra extension in the Settings dialog.

Special Attributes

With Markdown Extra, you can specify class and id attributes on headers and fenced code blocks just like this:

Header example
var foo = bar;

Then you can create cross-references like this: beginning of the document.

Footnotes

You can create footnotes like this2.

Table of contents

You can insert a table of contents using the marker [TOC]:

MathJax

You can render LaTeX mathematical expressions using MathJax, as on math.stackexchange.com:

The Gamma function satisfying Γ(n)=(n1)!nN is via through the Euler integral

Γ(z)=0tz1etdt.

NOTE: You can find more information:

  • about Markdown syntax here,
  • about Markdown Extra extension here,
  • about Prettify syntax highlighting here.
  • about Highlight.js syntax highlighting here.

  1. StackEdit is a free, open-source Markdown editor based on PageDown, the Markdown library used by Stack Overflow and the other Stack Exchange sites.
  2. Here is the text of the footnote.

接待尚hh等三人骑川藏318

高中同学尚hh和他的两个同学9号下午乘火车来到成都,原本计划10号跟着一个队伍走。但是那个队伍让他们仨9号去雅安找他们。而且成都这几天一直下雨,走不了,尚决定不跟他们了。

9号冒着大雨骑车去火车北站把他们接回我租的地方。雨衣还是在超市买的一次性的,回来身上基本都湿透了,我的自行车没有挡泥板,一路上骑不快,还弄一身水。10号又下了一天雨,11号天气预报要下雨,却没有下。带他们仨去市区吃小吃,买东西。下午去找另一个在成都的同学郝mq,我和她商议怎么招待他们,决定去锦里,在锦里转了一圈,他们也没买小吃。然后就去了郝去过的重庆胖妈烂火锅(这名字真难记,回来后凭着记忆搜了一下才记住)。这个火锅店可以团购,其实相当于打6.6折,郝团购的,我支付宝付钱。5个人吃了244元,包括300元的菜和44元的酒水,洒水要另外算的,开始没注意,点的菜加酒水刚好接近300元。这次算我和郝请他们三个,郝问应该给我多少,我说100就行了。女生嘛不好意思跟人家要那零头。

这两天天气好转,昨天一天他们收拾东西,带尚的两个同学去红光捷安特店调车。我也是第一次去那个店,买了挡泥板和一个尾灯,50元。如果在网上买,一半就够了…… 今天早上6点多醒时外面下的很大,还以为他们走不了了。7点时雨突然停了。尚发来短信说他们决定出发。于是去收了钥匙,吃了早饭就与他们分别了。

这几天都没跟他们合影,出发前临时拍了两张,算作纪念吧。纪念我这么傻。祝他们平安顺利到达拉萨。祝他那个对骑行川藏面临的困难没有什么认识的队友也坚持走完全程。




Friday, July 5, 2013

又开了一个(空)博客

又开了一个博客。。。

前后开过几次,都没写过什么,自己这体育老师教出来的语文实在捉急。但是看到别人都有博客,自己一直也想拥有一个。这个博客能不能写出点什么来,以后看吧。

这个名字本来想的是懒虫,拿去注册微博,不出意外被人注册了,于是就变通了一下。注册这个博客地址时,lazybug又被注册,崩溃的是lazybugbug, lazybugbugbug也被注册了,只好再加个g,嗯,就是它了,lazybugg。