Pages

Saturday, November 30, 2013

换新博客了-github pages

换新博客了,使用 jekyll + github pages,使用vim + markdown写博客,源文件容易维护,纯文本,不依赖数据库和其他大型软件,所有数据都在我的掌握之中,没有这些软件也可以查看我的博客内容,感觉很安全多了。

新博客地址: http://ssendeavour.github.io/ 


这个博客不再更新了。

Friday, October 18, 2013

XeLaTeX/XeTeX常见字体命令溯源

字体知识

  • Serif (衬线字体):用作正文字体。宋体、仿宋
  • Sans serif(非衬线字体): 用于标题。楷体、黑体、幼圆
  • Typewriter(打印机字体,等宽字体):

fontspec宏包

文档地址:fontspec doc fontspec支持配置文件,文档里有详细的讲解,这里忽略。

主要字体选择命令 newfontfamily

\fontspec [<font features>] {<font name>}  # one-time use
\setmainfont [<font features>] {<font name>}
\setsansfont [<font features>] {<font name>}
\setmonofont [<font features>] {<font name>}
\newfontfamily <cmd> [<font features>] {<font name>}

The font features argument accepts comma separated <font feature>=<option> lists;

这些命令也影响像\mathrm这样的数学模式使用的字体。

选择字体的方式(两种) fontspec

  1. 根据字体名称,如Times New Roman。使用这种方式,粗体、斜体立即就可以使用(使用通常的\textbf, \textit命令)。
  2. 根据字体文件名。在XeTeX中,TeX发行版自带的OpenType字体(如/usr/local/texlive/2013/texmf-dist/fonts/opentype/public)只能通过文件名加载。LuaTeX没有这个问题。在默认搜索路径(包括当前目录)上的字体可以只指定文件名,不用指定完整目录。 通过文件名选择的字体必需显式的指定粗体和斜体。如:

    \fontspec [ BoldFont = texgyrepagella-bold.otf , ItalicFont = texgyrepagella-italic.otf , BoldItalicFont = texgyrepagella-bolditalic.otf ] {texgyrepagella-regular.otf}

或者

\fontspec
  [ Extension   = .otf ,
  BoldFont      = texgyrepagella-bold ,
   ... ]
{texgyrepagella-regular}

或者

\fontspec
    [ Extension     = .otf ,
        UprightFont = *-regular ,
        BoldFont    = *-bold ,
        ... ]
    {texgyrepagella}

或者加载不在默认搜索路径的字体,指定path选项:

\fontspec
   [ Path = /Users/will/Fonts/ ,
        UprightFont = *-regular ,
        BoldFont = *-bold ,
       ... ]
{texgyrepagella}

文档默认字体族(font family) setmainfont, setsansfont, setmonofont

以下命令声明全文使用的字体,它们的参数与fontspec命令相同。

\setmainfont [<font features>] {<font name>}
\setsansfont [<font features>] {<font name>}
\setmonofont [<font features>] {<font name>}

New命令选择新字体 newfontfamily,

\newfontfamily \<font-switch> [<font features>] {<font name>}
\newfontface \<font-switch> [<font features>] {<font name>}

字形选择的更控制 BoldFont, ItalicFont, etc.

这允许我们使用字体A + 字体B的粗体 + 字体C的斜体这种组合。

BoldFont = <font name>
ItalicFont = <font name>
BoldItalicFont = <font name>
SlantedFont = <font name>
BoldSlantedFont = <font name>
SmallCapsFont = <font name>

示例:

\fontspec[BoldFont={Helvetica Neue}]
{Helvetica Neue UltraLight}

数学字体

fontspec 宏包必需在其他数学字体宏包(如euler)之后载入。fontspec不改变一般的数学,只影响upright和bold。要改变数学符号的字体,请使用mathspec或者unicode-math宏包

\setmathrm [<font features>] {<font name>}
\setmathsf [<font features>] {<font name>}
\setmathtt [<font features>] {<font name>}
\setboldmathrm [<font features>] {<font name>}

使用以上命令显式设置要在\mathrm这样的命令中使用的字体。

例子:

\usepackage{mathpazo}
\usepackage{fontspec,xunicode}
\setmainfont{Optima}
\setmathrm{Optima}
\setboldmathrm[BoldFont={Optima ExtraBlack}]{Optima Bold}

选择font feature

可以使用配置文件创建全局的或者每个字体的font feature。

关于feature

找到了这样一段话:

OpenType fonts (and other ‘smart’ font technologies such as AAT and Graphite) can change the appearance of text in many different ways. These changes are referred to as features. When the user applies a feature — for example, small capitals — to a run of text, the code inside the font makes appropriate adjustments and small capitals appear in place of lowercase letters. However, the use of such features does not affect the underlying text. In our small caps example, the lowercase letters are still stored in the document; only the appearance has been changed by the OpenType feature. This makes it possible to search and copy text without difficulty. If the user selected a different font that does not support small caps, the ‘plain’ lowercase letters would appear instead. Some OpenType features are required to support particular scripts, and these features

small caps, the ‘plain’ lowercase letters would appear instead. Some OpenType features are required to support particular scripts, and these features are often applied automatically. Other features can be applied to support a particular language.

A very large group of OpenType features is designed to support high quality typography in Latin, Greek, Cyrillic and other standard scripts.

详细的feature请参考 fontspec说明文档的第10节。

feature按照逻辑功能分类。所有的分类如下(fontspec doc 第10节)

  • Ligature (两个特定的字母连在一起,为了美观或者功能)
  • Letters (转为大写、小型大写字母等)
  • Numbers (指定显示样式等)
  • Contextuals (根据字母在单词中的位置不同使用不同的笔画)
  • VerticalPosition (把字母或数字设置为上标、下标样式)
  • Fractions (显示成小型的分数的样式,类似LaTeX的行间分数,也可以显示斜的分数线
  • StylisticSet (以另一种字母样式显示)
  • CharacterVariant (与StylisticSet类似)
  • Alternates (选择字体的可选字体样式,如果存在)
  • Style
  • Diacritics
  • Kerning (指定字母与字母之间的距离如何调整)

默认 feature defaultfontfeatures

\defaultfontfeatures{<font features>}
\defaultfontfeatures[<font name>] {<font features>}

重复使用这两个命令新设置会覆盖旧的。 例子:

\defaultfontfeatures[TeX Gyre Adventor]{Color=blue}
\setmainfont{TeX Gyre Adventor}% will be blue

改变当前选择的feature addfontfeatures

\addfontfeatures{<font features>}

例子:

\addfontfeature{Numbers=OldStyle}...
\addfontfeature{Numbers=Lining}...

例子中,两次改变同一个feature,结果如何,要看具体字体。作者说以后会实现新的配置覆盖旧的配置。

不同字体不同 feature

BoldFeatures{<features>}
ItalicFeatures{<features>}
BoldItalicFeatures{<features>}
SlantedFeatures{<features>}
BoldSlantedFeatures{<features>}
SmallCapsFeatures{<features>}

例子:

\fontspec[
    UprightFeatures={Color = 220022,
    SmallCapsFeatures = {Color=115511}},
    ItalicFeatures={Color = 2244FF,
    SmallCapsFeatures = {Color=112299}},
    BoldFeatures={Color = FF4422,
    SmallCapsFeatures = {Color=992211}},
    BoldItalicFeatures={Color = 888844,
    SmallCapsFeatures = {Color=444422}},
]{TeX Gyre Termes}

 Upright {\scshape Small Caps}\\
 \itshape Italic {\scshape Italic Small Caps}\\
 \upshape\bfseries Bold {\scshape Bold Small Caps}\\
 \itshape Bold Italic {\scshape Bold Italic Small Caps}

与字体无关的features

  1. color/colour: 颜色值为6个十六进制数,外加可选的两位十六进制数指定透明度(即RRGGBBAA或RRGGBB),注:透明度只有Mac OS X中的LuaTeX和XeTeX使用xdv2pdf驱动支持,使用xdvipdfmx的XeTeX不支持透明度。如果载入了xcolor宏包,也可以使用它定义的颜色名称。
  2. scale: Scale = / MatchLowercase / MatchUppercase
  3. ...省略了。还包括调整字距、标题符号后面的距离、连字符、

再往下都是些用处不大的东西了。不写了。

other \usefont{OT1}{cmr}{m}{n}

Written with StackEdit.

Friday, September 13, 2013

第4章:Android开发权威指南(SDK2.3)笔记

Android开发权威指南(SDK2.3)笔记

第4章 我的UI我作主————用户界面开发基础


在不同Activity之间传递数据

4种方法:

  1. 使用Intentintent.putExtra(key, value)。在接收方:getIntent().getStringExtra(key), getIntent().getInt(key)
  2. 使用静态变量。在Activity或其子类中定义public static的静态变量,在startActivity之前为这些变量赋值。官方不推荐
  3. 使用剪切板ClipboardManager clipboard = (ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE);, clipboard.setText(string);。缺点:只能传递字符串。(注:可通过ByteArrayOutputStream, ObjectOutputStream, Base64将可序列化的对象转换为字符串,接收方再转换为原对象来实现传递。
  4. 使用全局对象。全局对象对应的类必须是android.app.Application的子类。全局类不需要定义静态变量,定义成public成员变量就可以。全局类必须有无参的构造方法(因为它是由系统调用的)。在代码中通过getApplicationContext()获得全局对象,并可对其属性赋值。

视图:布局

几个重要的xml属性:

  1. android:layout_gravity:当前视图在父视图中的位置。
  2. android:gravity:表示容器中的子视图在容器中的位置。
  3. android:layout_marginTop:当前视图边缘离基线的距离。例如,当前的是居中的,那么这条基线就是屏幕的中位线,所以80dp就是顶端到这条基线的距离。小鸟的图像会在基线的下面的位置显示。

重用xml布局文件

使用<include>标签:

<include android:id="@+id/cell1" layout=@layout/workspace_screen" />
<include android:id="@+id/cell2" layout=@layout/workspace_screen" />
<include android:id="@+id/cell3" layout=@layout/workspace_screen" />

注:如果要覆盖布局的尺寸,必须同时覆盖android:layout_width(原书为android:layout_weight)和android:layout_height。只覆盖一个无效。

Written with StackEdit.

Android开发权威指南(SDK2.3)笔记(第4章)

Android开发权威指南(SDK2.3)笔记

第4章 我的UI我作主————用户界面开发基础


在不同Activity之间传递数据

4种方法:

  1. 使用Intentintent.putExtra(key, value)。在接收方:getIntent().getStringExtra(key), getIntent().getInt(key)
  2. 使用静态变量。在Activity或其子类中定义public static的静态变量,在startActivity之前为这些变量赋值。官方不推荐
  3. 使用剪切板ClipboardManager clipboard = (ClipboardManager)getSystemService(Context.CLIPBOARD_SERVICE);, clipboard.setText(string);。缺点:只能传递字符串。(注:可通过ByteArrayOutputStream, ObjectOutputStream, Base64将可序列化的对象转换为字符串,接收方再转换为原对象来实现传递。
  4. 使用全局对象。全局对象对应的类必须是android.app.Application的子类。全局类不需要定义静态变量,定义成public成员变量就可以。全局类必须有无参的构造方法(因为它是由系统调用的)。在代码中通过getApplicationContext()获得全局对象,并可对其属性赋值。

视图:布局

几个重要的xml属性:

  1. android:layout_gravity:当前视图在父视图中的位置。
  2. android:gravity:表示容器中的子视图在容器中的位置。
  3. android:layout_marginTop:当前视图边缘离基线的距离。例如,当前的是居中的,那么这条基线就是屏幕的中位线,所以80dp就是顶端到这条基线的距离。小鸟的图像会在基线的下面的位置显示。

重用xml布局文件

使用<include>标签:

<include android:id="@+id/cell1" layout=@layout/workspace_screen" />
<include android:id="@+id/cell2" layout=@layout/workspace_screen" />
<include android:id="@+id/cell3" layout=@layout/workspace_screen" />

注:如果要覆盖布局的尺寸,必须同时覆盖android:layout_width(原书为android:layout_weight)和android:layout_height。只覆盖一个无效。

Written with StackEdit.

Tuesday, August 27, 2013

华为C8812无法在Ubuntu系统Eclipse ADB中使用

华为的电信定制手机C8812连接Ubuntu后,打开调试模式,使用命令

adb devices

返回如下结果

➜  51-android git:(develop) adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
emulator-5554   device
????????????    device

识别出了手机,也能在命令行的ADB中正常使用。但是却不能在Eclipse中使用,就因为那一行问号。解决办法不是Google官方的添加 /etc/udev/rules.d/51-android.rules 文件(添加这个文件之前adb devices显示的结果就是这样)。而是华为自己的问题,解决办法如下,来自这里

  1. 使用电话拨打##2846579##
  2. 这时会出现一个菜单,选择projectMenu
  3. 接着选择后台设置
  4. 接着选择USB模式
  5. 选择Google模式

完成步骤5后就可以了,不要重启,我第一次找到这个方法时,按帖子说的重启了,结果又变回去了。

事实又一次证明,国产手机对于好玩机的人来说就是个坑,尤其是定制机。

Written with StackEdit.

Sunday, August 25, 2013

想去程序员培训学校

无意中看到了CSDN办的黑马程序员训练营,培训Android开发,说是平均工资7K。学习时间4个月,学费13500,可就业后分12个月付款。下载了一集它的入学前必看的基础视频看了一下。想起了去年在东软的日子,都是同一性质批量生产程序员的培训机构,没多少区别。要说有区别,这个视频上讲课的教师思路清晰,写代码很快,是个老手。20多分钟就从零开始做了一个可以播放音频文件的Android出来,还注意到了基本的易错的地方。讲的节奏很快,照这个速度,如果是我学4个月应该能做一个合格的入门Android程序员了。

前几天也看了一个微软程序员的博客(刘未鹏,博客),他很重视学习方法,读了许多认知心理学方面的书。他也讲到现在的大学教育(软件开发这一块)与软件公司的用人需求严重脱节的现象,还专门写了一篇博文(怎样花两年时间去面试一个人)。分析这个问题并给出了可行的建议。他写到现在学软件的大学生的困惑:

绝大多数应届生直到毕业也不清楚他们想要去的公司到底需要什么样的能力,或者说,他们到底需要具备什么样的能力才能在应聘季节拥有自己的选择权。中国虽然本科教育环境差,但是同样有很多的人在本科希望整点东西出来,他们有一腔的激情和抱负,有强大的动力,但就是不知道自己需要掌握哪些技能才能满足雇主的要求,求告无门,整年整年苦闷的像没头苍蝇一样乱撞。

我觉得我就是这个处境,大学三年了,学了些C,C++的语言基础,也认真读完了《深入浅出MFC》对MFC的原理也大略有个了解。可也于了解,学完了基础就不知道接下来干什么了。我知道其实这主要是因此我懒,有那么多开源项目可以去学习,或者自己写小软件自娱自乐,可是我都没有做。我只乐于学习一些小Trick,比如结构体的内存对齐,C函数参数的入栈顺序有哪几种,C++的虚函数,纯虚函数,又或者一些漂亮的命令行命令,却又不去系统的学习bash。玩Linux又不去看鸟歌的书,也不编译内核,也不写大的程序。学了Python,仅止于能爬几个页面,处理个字符串,不去学Web框架。

我去学个黑马程序员培训班学的话,如果出来真能找到7k的工作,那比考研好多了。因为我就需要有实际的项目需求摆在那里,督促着我去学习,只有这样,我才知道该往哪里努力。而程序员学习本应该是这样的,以实际需求为导向,缺哪补哪。而且以我在大学学习的基础知识(操作系统,体系结构,算法),加上培训后掌握的开发经验,进一般的软件公司应该没有问题。进入公司,才算上了道。老在学校里,我又不会和人交往,永远不知道自己该干什么,知道了也没有压力和动力学习。对这个大学早已厌倦了。也不想继续读研究生了,虽然考上的可能性也很小。那就明年毕业后去黑马吧。

告诉我该做什么,怎样做,我就能做好。

Written with StackEdit.

Wednesday, August 14, 2013

Ubuntu 12.04.2 编译 Vim 7.4,带有中文支持

还没编译过vim,趁这次vim出新版,Ubuntu源里还没有,又想尝鲜,就促成了这次编译。

安装依赖库

为了保证编译顺利进行,首先安装依赖的库。
sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev\ libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev libperl-dev python-dev
其中libperl-dev和python-dev分别用于perl和python脚本支持。如果需要lua和ruby的支持,需要分别安装 liblua5.1-0-dev 和 ruby-dev。

git下载Vim源码

git clone https://github.com/b4winckler/vim.git

配置

假设上一步把vim的代码下载到了~/vim目录中。
cd ~/vim
./configure --with-features=huge --with-python-config-dir=/usr/lib/python2.7/config/ --enable-multibyte --enable-cscope --enable-fontset --enable-gui=auto --disable-hangulinput --enable-luainterp=yes --enable-perlinterp=yes --enable-pythoninterp=yes --enable-xim --prefix=/usr
其中

  1. --with-features=huge 打开最多特性。
  2. --with-python-config-dir=/usr/lib/python2.7/config/ 指定的是一个包含config.c的目录(安装python-dev后才有)。
  3. --enable-multibyte 支持多字节文字(中日韩等)
  4. --disable-hangulinput 取消韩国语输入法。
  5. --enable-xim 支持xim输入法(以防不能使用ibus或者fcitx,不知道是否必需)

顺便强烈推荐一下zsh,它兼容bash,可以解析Makefile,Tab自动给出配置选项,使用它就不用手工输入这些长长的选项了,例如:我输入 “./configure --en” 按两次Tab键(按第一次补全为“./configure --enable-”),自动列出所有可用选项,见下图:

zsh自动补全
ZSH自动补全功能
当然它的功能远不止这一项。文件名和其实常用程序的参数自动补全也非常强大。

编译

很简单,直接使用make命令:
make

安装

安装之前,可以先运行一下编译好的新vim,查看功能是否正常
./src/vim --version
./src/vim
确认没有问题后,根据下面参考文档的建议,先把系统原来的vim卸载掉(我安装时没有卸载,安装后vi命令指向的还是原来的vim,vim也是原来的vim。因为我原来的vm安装在/usr/local/bin,现在的vim安装在/usr/bin,vi是vim的链接。新vim安装后好像不会更新vi的链接)
sudo apt-get remove vim vim-addon-manager vim-common vim-gui-common vim-tiny vim-scripts vim-runtime
然后再安装
sudo make install

把vim作为默认编辑器

来自下面参考资料里的方式,很高级的样子。顺便也把vi链接到vim了:
sudo update-alternatives --install /usr/bin/editor editor /usr/bin/vim 1
sudo update-alternatives --set editor /usr/bin/vim
sudo update-alternatives --install /usr/bin/vi vi /usr/bin/vim 1
sudo update-alternatives --set vi /usr/bin/vim

参考资料:

Building Vim from source

Saturday, August 10, 2013

同步技术不简单:DropBox技术过硬,Xmarks跨浏览器同步书签,还是扶不起来的阿斗

最近Chrome换了Blink引擎后就一直抽风,打开网页就会卡5-10秒钟,几乎不能用。所以暂时将就着用Firefox,还下了个Opera,因此听说它也要换Blink引擎了,可惜Linux版是个旧版,比最新版落后了3个版本。用着也还行,偶尔卡一下。

用Firefox就得重新登陆各种网站了,一个一个找注册时用的密码很麻烦,在Chrome里都是自动登陆的。最要命的是Chrome里的书签没法同步过来。去年用过Xmarks,同步功能有问题,删掉的书签过一会儿又出来了,搞的很烦,就不用了。现在又要用,Google了一翻,大家异口同声的说Xmarks,看来还是没有别的选择,只好再把它装起,看看它的技术进步了没有。刚才在Chrome里整理了一些书签,删了几十个。过一个小时发现删掉的书签又出来了!!!!直接覆盖了我的修改!!!不玩了,立马缷。

同步这东西,看着简单,但是小公司做出来的东西就是不靠谱。用Windows的时候,找同步网盘,首先用的是Windows家的SkyDrive,微软大公司了吧,可这个SkyDrive一点也不靠谱。经常出现文件冲突。最可气的是出现冲突了,SkyDrive一点提醒都没有,只是默默的把冲突的两个版本的文本重命名一下。只有当你打开我的电脑,进入那个文件夹才发现冲突了。这时候可能你也不知道应该保留哪个版本了。真恼人。后来换了国内的一个网盘,记不大清了,好像是盛大网盘,问题与SkyDrive一模一样。后来电脑就换了Linux,大部分网盘都不支持Linux,于是试用了众口相传的DropBox。从此世界就安静了,再没出现过文件冲突的烦恼事。不愧是专业的同步网盘!现在如果有人问用什么网盘,我只推荐DropBox。

DropBox的优点:

  1. 技术过硬,这一点最重要,从我将近一年的使用来看,从来没有出现过文件冲突的情况。微软的SKyDrive和盛大网盘都经常出现。
  2. 瞬间感知文件变化。修改一个文件后,按下保存Ctrl+S,立刻就能看到任务栏里的DropBox在转动,表示正在同步。不知道这个特性是否为LInux独有。
  3. 保存最近三个月的文件修改记录。而这些历史版本不占用存储空间。这个比git方便多了。同步密度比git大多了,每保存一次就同步一次。
  4. 文件可以外链。接收文件的人不需要有DropBox账号就可以下载。
  5. 简洁好用,没有广告。
  6. 全平台支持,不论将来你换了Android, iPhone, Mac,Linux,还是其他设备,DropBox都在那里。
  7. 等你发现
唯一的不足:
  • 空间小。注册有2GB,facebook, twitter关注它可送1-2G。我现在有18.88GB,原因是去年末有个活动。所在学校注册的人数达到一定数量,就送相应的空间使用权2年。虽然只有两年时间,这个应该不是问题,互联网的发展速度这么快,两年之后网盘是什么情况,还不一定呢,说不定到时候DropBox的免费空间要提到20GB呢。以后也许还是其他活动。
这点不足,应该和它的定位有关,它是同步盘,不是网盘。虽然用户并不会区分这一点。2GB的空间肯定是对用户使用的平均空间进行过统计测算的,对大部分人够用。免费的,技术又这么好,也别奢求太多了。只能盼望着网盘的空间也遵守摩尔定律,像电子邮箱一样,从原来的几十MB,1G到现在的几乎无限容量。

我的DropBox只同步了文档,照片和音乐(我的文件不是很多)这些最重要的东西。所以空间只用了60%。将来空间用完了,就不同步音乐了,这个是可以从网上再下载的,而且可以转移到网上歌单。文档就比较独特了,价值最大,因此最优先同步文档,其他的都可丢到一边。

下面是我的DropBox邀请链接,通过这个链接注册DropBox,你和我都可以多得500MB空间。共赢,何乐而不为?

http://db.tt/5GnQmDbJ (通过此链接注册DropBox,多得500MB空间)

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.