热血孤星——德州见闻记

忙完了一阵,是时候出来浪一波了。

在Austin ARM实习的Eason学长表示你来我这有地方住,瞬间感觉不去亏了一个亿,果断订了机票,拎包就走。

对于我这种在东北读了本科,加拿大呆了三年(从此觉得-20℃是人体最适温度),洛矶山脉脚下呆了半年(我们有世界闻名的滑雪场(们)和The greatest snow on earth)的人来说,德州给人的第一印象就是热,贼热,非常热,简直要化了,不想在室外多呆一秒的那种热。不过据说我来的这几天其实还不算热(有个白人老太跟我讲“现在这个天气跟热一点都沾不上边"),很多时候天上都飘着云彩,也不算晒,可以说是十分幸运了。人可能不会喜欢这么热的天气,但是作物和植被可开心坏了。我在德州吃到了心心念甜甜的大西瓜,同样又大又甜的车厘子,在Austin高架桥上开车两边是茫茫的树海,瞄一眼GPS发现居然是在市里面。

另一个印象是大。食︰大口吃肉大碗喝酒;住:德州最不缺的就是地;行︰车位大,车道宽,皮卡满街跑,大家开车都不看限速(我学长表示这条路有限速的?我从来没看到有人注意过限速);衣:美国人的整体版型要比亚洲人大好多圈,大概德州人的衣服还要在这个基础上再加两圈吧。

IMG_20190602_141945

上图是Austin的N层高速立交桥,据说Houston的高速更丧心病狂。被这种蛋疼的设计坑了无数次的我到现在也没有理解为什么会有最左边车道开着开着忽然成了调头专用道这种设定。如果说这个还好,那么开着开着忽然无缝衔接开到了收费路段就更让人无语了。因为德州的油价非常便宜(差不多是加州的1/2,其实看一个地方油贵不贵很简单,比如你看加州有很多普锐斯,盐湖城有很多特斯拉,而我在德州呆了几天一辆混动/纯电都没能见到,说明啥?说明我穷,买不起普锐斯,也买不起特斯拉),所以德州有很多收费路段。老司机可以在只走Interstate (免费)的情况下到达目的地,而我,并不能。

wx_camera_1559433504434

上图是在德州吃的grill,德州人民对“吃肉”的理解是,吃,排队打饭,打完饭自己去找座位吃,我们没时间伺候你(在美国吃过饭的小伙伴知道美国的服务员几分钟跑来一趟像雷总耍猴一样问你are you OK

image-20230226192856198无非是要你多给点小费,在德州很多餐厅跟食堂一样,是没有服务员的);肉,你要吃肉我们就只给你肉,绝不会用菜把盘子装饰一下。这种grill店基本是人手一瓶啤酒,德州人民对酒的狂热是显而易见的,导致了模样“大概"是成年人的话买酒基本没有人会查你的身份证(对比一下犹他州,不带身份证连酒铺都进不去)。当然,酒驾是不对的,开车还是要注意安全_(.-.)-

Austin其实是一个很美的城市,坐落在Austin downtown的UT Austin建筑风格也十分统一。

image-20230226194603384

如果要找更加有风格的城市可以去San Antonio,从进城的高速路开始就被刷成了橘红色(嗯看起来人家真的有钱)。

这样的土地养育了一群生性豪爽放荡不羁的人民。德州人民的反骨是出了名的,下面这张是Texas Capitol的正面,孤星旗高高飘扬,而美国国旗在这栋楼的背面。顺便提一下Texas Capitol是免费参观的,里面还有人免费带逛,非常值得一去。

IMG_20190603_142554

下图为Texas Capitol内景。

IMG_20190603_122353

议会大厦顶端是德州的女神像,女神手里拿的是德州的象征――lone star。据说这个女神像比美国首都DC那个女神像还高了一头。我好奇地问讲解员联邦政府觉得你们搞这个东西比联邦的那个还高真的OK吗?那小姑娘朗声说道"We don’t care"然后小声跟我讲“Although l shouldn’t say this……“E德州的这种反叛的精神根植于德州人民的血液中。其实了解一下德州的历史大概不难察觉一二。如果要了解德州的历史,座落在UT Austin旁边的Texas State Museum是一个不错的去处。

IMG_20190531_135523

我在这里参观的时候遇到了一位白人老太太,老太太非常自豪地对我这个明显的外国人说“We’re the only state who wants to become a nation.”

IMG_20190531_143211

Alamo战役的一声炮响揭开了德州独立运动的篇章。事情的根本原因是墨西哥政府觉得德州人民越来越不听话,盎格鲁人越来越多,北边还有虎视眈眈的美国,怕这瓢肥水会流入外人田,于是决定给他们一点人生的经验。事情的导火索是墨政府想要收回驻扎在德州的一挺重炮,然而德州人民表示借出去的炮就是泼出去的水,Libertyor death,打,奉陪到底,谈,谈你妈b。独立战争只打了7个月就让墨政府疲于奔命,不得不承认现在的德州已经不是他们能控制得了的了,于是德州人民建立了自己的国家,名为Republic of Texas。不过德州人民的危机意识非常强,虽然建立了自己的国家,但是北边是想要继续扩张的美国(美国人一直觉得作为天选之国,自己的国境线应该从美洲大陆的西海岸一直延伸到东海岸。你说北边?加拿大那块能把人J冻掉的地方是给地球人住的?美洲大陆保皇党们觉得美国人都是傻屌,这地方怎么就不好了,于是这些人成了后来的Canadian) ,南边是失去颜面哪里甘心的墨西哥(毕竟西班牙也曾是帝国,西裔们哪里受得了这种委屈),要在两个大国的夹缝中间生存何谈容易。当时的美国国内针对是否接纳德州加入联邦也有两派势力,不过最后经过(此处省略一万字,因为那段历史我没看)以后,德州人民经过还是公投加入了联邦,成为了美利坚合众国的一部分。现在的德州早已不是当年那个德州,名企林立经济繁荣人民安居乐业,几乎成为了美国的榜样。由于德州加入联邦是投票决定的,德州人民有一种当年加入联邦是迫不得已,现在特别想独立出来的情结。现在打开谷歌,搜索Republic of Texas,你会找到一个“德克萨斯共和国政府”的“官方网站"。我琢磨了好久发现这并不是一个愚人节玩笑因为我在参观德州议会的时候发现他们的档案馆是这样的

IMG_20190603_141634

下面那行字是"The Republic of Texas"提醒人们我们曾经是一个国家,一切权利属于人民。如果联邦把我们惹毛了,我们就嘿嘿嘿。

当然上面那段历史是我根据博物馆的记载添油加醋了一番,不要太当真。

现在的德州是美国最具潜力的几个州之一,很多加州白领苦于宇宙中心夸张的房价和生活成本向东南方向迁移(大概是习惯了四季如春的加州很难再回到冰天雪地的地方了)。德州因为相对便宜的房价,越来越多的高科技企业的入驻,没有州个人所得税(这个巨大的福利吸引了好多加州的纸面(税前)富翁),低廉的生活成本而成为了他们的重要选择之一。

IMG_20190602_152811

作为一个中国人能在Austin见到大华超市,吃到卤味拼盘和脆皮烤鸭可以说是非常幸福了。硅谷的中产阶级大多会重视孩子的教育,而德州的旗舰大学UT Austin更是有能媲美常青藤大学的实力。

如果想吃,Houston是一个绝佳的满足各种老饕刁钻胃口的地方。如果想玩,Austin向北有个挺大的溶洞叫Inner Space Cavern,看完这个我觉得皖南那个花山谜窟是不是人造用来坑钱的

San Antonio有世界著名的六旗公园和各种游乐场,过山车让你坐到无聊为止。

image-20230226195205707

(德州六旗最刺激的过山车应该是Iron Rattler,排队的人不是特别多,建议不要错过,并且强烈建议全程双臂张开,不要扶保险杠,体验极佳——嗯听说如果再张开双手那是摸G奶的感觉,没体验过的可以体验一下……)

image-20230226195218288

刷遍了德州六旗最刺激的过山车们以后我特别想体验新泽西六旗的Kingda Ka过山车,至今还没有找到人愿意(敢)一起去,有意向的老铁欢迎联系我。

嗯是时候回村里继续搬砖了,苦逼夏天它lei了lei了B

Adios Tejas!

wxgopher@AUS airport

Austin,The Republic of Texas

Canada, Eh

注:写一些不带个人身世(所以说是可以发表在公共场合)的东西。上中学的时候特别痴迷梁实秋的杂文,梁的文章常读常新,记得有一位语文老师跟我说过看似不经意的调侃的幽默是经历过了大风浪淬炼出来的,希望等我而立之年也能写出那样的文字。

Sorry, eh, I’m Canadian

Sorry是一个著名的梗。加拿大人是可以把sorry这个词用到几乎任何场合的:走路与别人擦肩而过,两人同时Sorry;跟陌生人打招呼问路,以Sorry开头……同样的道理,eh这个结尾语气词可以加在几乎任何句子的最后。 一图胜千言,上图:

2

加拿大人也是虚伪的,但是继承自英国绅士的这种虚伪被隐藏得非常好,以至于我一年以后才意识到,举个例子:几乎所有的本地人都表示萨斯卡通是一个让人来了就不想走的地方,但是有趣的是这么一个“非常受人欢迎”的迁入人口却并不多;再比如萨省首府里贾那的议会大厦是在预计2020年里贾那会达到100万人(数字存疑)规模的基础建成的,然而从2018年的形势来看,除非是加拿大别的省全部被核覆盖,实在想不出来怎么在两年之内搬80万人过去……所以其实你看,大家都是用嘴说话但是用脚投票的嘛。

虽然我还没有踏上美国的国土,但是在加拿大的三年加拿大人黑美国人的梗听了特别多;总结一下无外乎美国人粗鲁和自以为是,自从Trump上台以后又多了一个黑点。不知道是否是出于政治正确的原因,我认识的几乎所有加拿大人都觉得Trump不可理喻,只有一位小哥指出Trump是美国总统,所以一切从美国利益出发是可以理解的;几乎所有加拿大人在知道我要去美国以后都会冒出一句“States, why states?! you are gonna live with Trump, that guy, you know?!”。加拿大人对于美国人有一种天生的傲慢,言谈举止透露出一种“你才是美国人,你们全家都是美国人”的感觉。当然这与加拿大的历史是分不开的:当初的说着英语法语各种语的保皇党们为了不被美国“解放”(美国人民觉得除了美国以外世界所有人民都生活在水深火热之中,南北统一以后发现北边居然还有在邪恶的英国统治下的穷苦劳动人民,必须把他们解放出来),联合起来抗击美国的侵略,结果是加拿大人(实际上主要是英军)抓住一波timing极限反杀,火烧白宫,迫使美国重新坐在了谈判桌前,这也是加拿大国家认同感的开始——始于“只要你不想当美国人,你就是加拿大人”。但是现在的加拿大人颇有一种没落贵族的感觉,守着自己引以为豪的全民免费医疗、公立教育和极小的贫富差距,欣赏(看戏)Trump带领下美国的的跌宕起伏,但是又透露出贵族没落的不甘:曾经有一个加拿大人很诚实地告诉我说为什么提到加拿大大家只知道Justin Bieber呢,因为我们也没办法呀好莱坞产业太大了在加拿大拍电影根本不赚钱。

Vancouver is not the real Canada

所有的移民加拿大的广告大多会放上一些蓝到不真实的天,绿到刺眼的草,红到张扬的枫叶——这些也确实没有错,但是能把这几张图片无缝衔接滚动播放一年的地方只有温哥华周围,因为真实的加拿大日常其实是这样的(网上随便抓了一张)

winter-canada-must-haves

banff

冬天有多长呢?正应了一首歌,每天的日子大约在冬季,不是在冬天就是在迎接冬天的路上。“柳絮因风起”大概是从八月底开始的(卡尔加里已经下过2018年“第三季度”的第一场雪了),而踏青赏花却要等到四月底——只需要一场雨,第二天起来世界就换了一个色调,春雨贵如油在这里差不多是春雨就是催化剂。

冬天有多冷呢?从通勤的角度来说每个月有一半的时间早晨起来第一件事是扒车;从车的角度原地热车十分钟以后变速箱还是会冷保护,相比瑟瑟发抖坐在冰箱里开车,什么原地热车发动机积碳见鬼去吧;从感受来说,到了加拿大我才知道原来气温和体感温度完全是两回事:五级大风+-30℃的低温体感温度能有-40℃到-50℃,对于想体验这是什么感受的各位看官,我只希望你们不要体验就好了……

实际上大多数技术移民的人是不会去温哥华的——加拿大的IT产业主要在安大略的多伦多和魁北克的蒙特利尔,工业制造也基本不在温哥华;没有特别多钱的投资移民也基本去了边远省份;那么剩下的就是一些真·有钱人才会去温哥华了。相传温哥华的Richmond是因为里面住的都是rich(这当然是杜撰的),但是据说温哥华早高峰最不堵的地方也是Richmond,因为那里的人们是不需要上班的。

The real Canadian Tim Hortons

加拿大人的国民自觉性大概是我见过的最高的了。衣食住行,只要是本土的牌子,无不会写上"Real Canadian"或者"Proudly Canadian"。然而有一个叫Tim Hortons (Tims)的牌子例外,大概因为Tims在某些场合完全可以代指加拿大了。

在加拿大公路自驾游,经过的无数甚至不到万人的小镇子,可能没有KFC,没有麦当劳,但是有两样东西是一定会有的:加油站和Tims。加拿大人的早晨一般都开始于一杯“double double”和一块甜甜圈或者羊角包。“double double”是国境线以北的人们才会理解的黑话,意思是double sugar and double cream。大概是这里极端寒冷的气候使得人们的味觉都退化了,我一直觉得加拿大人对甜是不是有什么误解——咖啡double double基本成了咖啡味儿的奶茶,甜甜圈和羊角包因为照顾到有些喝黑咖啡的苦主要做的非常甜,以至于单独吃它们会甜到你怀疑人生。七月的时候加拿大国庆节,Tims会推出一款国庆特别版的甜甜圈,网上抓了张图,长这样

3

红的白的是糖霜,下面白色额是糖浆,后面那个面包本身也是甜的,各位看官随便感受一下。

初到加拿大的时候吃了几顿卡路里爆炸的早饭以后感觉我的中国胃和这国民第一煎饼果子连锁店实在是不搭,于是开始发掘Tims的菜单,试来试去觉得最符合我口味的可能还是下面这个combo

4

早上懒得做饭又因为是工作日所以跳过早饭一觉睡到中午直接吃brunch并不是一个选项,这个时候我会路过Tims,跟柜台大妈说"English sausage hash brown and a regular steeped tea"。Steeped tea是Tims里面对于不想喝咖啡,不想喝热巧克力,又不想喝茶包的人来说为数不多的选择之一了。Hash brown就是土豆饼。

Octolingual and illiterate

Octolingual说的是我硕士老板,illiterate是我硕士老板说我。

第一次知道我的老板会八门语言的时候我下巴差点没掉下来,这个时候我特别想去拉他去知乎回答“会X门语言是一种怎样的体验”,其实他已经告诉过我答案了“把我扔在地球上的任何一个角落我都能活下去”。

我素来都是羡慕出生在欧洲的人们的,天生就是bilingual甚至是trilingual。前阵子有一个厄瓜多尔的使团来到我们组访问(厄瓜多尔说西班牙语),当时配了一位英西翻译负责把我们说的(各种口音的)英语翻译成西语。使团走了以后我们组的意大利妹子非常兴奋地说“我虽然不会说西语但是他们说的每句话我差不多都能理解”。是呀,西语法语意大利语这些拉丁语族的语言某些部分都是非常相似的。multilingual的好处不仅在于能听懂多门语言,甚至还能对写作产生影响。想起来上周组会的时候,老板提到合成形容词为什么要加hyphen的时候是这么开场的“如果你们会德语的话……”

英语非常烂的我有这这样一位picky的老板自然没少吃瘪,我至今记得第一次看我老板给我改的材料我恨不得羞愧到找个地缝钻进去——几乎每一个句子都有问题,从punctuation,到hyphen/em-dash/en-dash(一度以为我老板长了双写轮眼,这三种短横的长度都能区分开来),到介词和冠词,让我感觉我人生的前20年几乎没有学过英语;计算机系另一位教授也在给我的评语中建议我去上一门语言课。经历过一系列让我羞愧难当的事情以后我决定好好补习一下我的英语。当时看到有一位老师(Mrs. McWhinney)在组织一个迷你的语法温习课,就报名参加了。不得不说native speaker教第二外语能很敏锐抓住国际生常犯的错误,第一节课讲punctuation的时候成功加深了我前20年确实等于没学过英语的感觉……McWhinney夫人发给我们的笔记我现在还会时常拿出来温习,常读常新。顺带提一句,Mrs. McWhinney的言谈举止无不透露出一种风韵犹存的优雅。后来去她家——一栋一看就知道非常贵的别墅——做客party,才知道她是副校长的夫人(怪不得?)

题外话,我觉得适应Canadian English大概是这些年我写作遇到的最大的问题了。Canadian English实则是一种发音接近美音拼写接近英式拼写,但是很多用词又和英国不一样的语言,以至于傲慢的英国佬提到英国人移民加拿大居然需要考雅思的时候说“Those Canadians they don’t even know how to speak English, and they want to test our English?!”

番外:关于做饭的一些小心得

不能说在这方面我有多专业,撷取一二仅供各位参考。如果我这里面有哪条建议能给看官的生活带来一些改进,那也是很值得的。如果有不妥之处也希望各位大厨评论区不吝赐教。

  1. 一些比较肥的牛肉拿盐,胡椒腌一下然后在平底锅上煎,味道出奇好;

  2. “三汁闷锅”的“三汁” = 番茄酱+黄豆酱(我们这里方言叫酱豆)+耗油,按照1:1:1即可;

  3. 实际上好吃的菜很大程度就是取决于香料,香料真的是人类非常伟大的发明。我常用的调味料:十三香(比较懒的时候用来代替各种香料),耗油(素菜会放),豆瓣酱/酱豆(酌情放),洋葱(用来代替小葱炝锅,这个技巧是现任房东大哥告诉我的,因为这里的小葱没有葱味儿),四川青花椒,还有一种中超卖的比较好用的干辣椒(多试一试就知道有的牌子的干辣椒确实还不错),姜/蒜(百搭);

  4. 但是更牛的人可以只靠刀工和火候把食材本身的香味激发出来,这就要常年的摸索/研究了。梁实秋有一本散文集叫雅舍谈吃,可以找来研究一下;

  5. 做饭做的好不好吃主要是肯不肯花时间,比如很多肉类先滑/炸再炒会比直接炒好吃;

  6. 煮饺子/面条可以凉水下锅,水开以后隔段时间放凉水——这样煮出来比较劲道;

  7. 番茄炒蛋加番茄酱有意想不到的惊喜;

  8. 炒绿叶蔬菜要用大火;

  9. 很懒的时候咖喱炖一切也是很下饭的。咖喱首推日式咖喱,不要买印度咖喱;

  10. 高压锅是人类厨艺进步的阶梯。猪蹄,排骨都可以往里扔;

  11. 烤箱同理。羊腿腌一下裹上锡纸放进去烤,除了羊腿本身特别贵以外想不出来这道菜的缺点;

  12. 空气炸锅做出来的口感确实可以比较接近油炸,唯一的缺点是清洗起来比较费劲(据说空气炸锅是要用洗碗机洗的,然而因为我们懒得清洗洗碗机……所以从来没用过……);

  13. 这是听别人的段子:什么腰子之类的东西没有耐心处理干净做千万不要买,否则煮出来就成了开水煮尿了——嗯其实这并不是段子;

  14. 知乎上有个帖子,有提到如何用老外的食材做出来中餐的味道,一时半会找不到了,感兴趣的看官可以去查查,全是干货;

See you Canada!

Notes on ltxprimer

Source: theltxprimer from Indian TeX group

The basics

Period:

latex assumes each period not following an upper case letter ends a sentence. In traditional typesetting, an extra little space is appended. Sometimes we don’t want this, so:

In order to produce Carrots are good for your eyes, since they contain Vitamin A. Have you ever seen a rabbit wearing glasses?, the correct input should be Carrots are good for your eyes, since they contain Vitamin A\@. Have you ever seen a rabbit wearing glasses?.

To produce The numbers 1, 2, 3, etc. are called natural numbers. According to Kronecker, they were made by God; all else being the work of Man., the correct input should be The numbers 1, 2, 3, etc.\ are called natural numbers. According to Kronecker, they were made by God;all else being the works of Man..

Quotes:

To produce “”, input `` and '', or use \lq and \rq instead.

Hyphenation:

  • Hyphen (-): separating compound names. e.g., Munthe-Kaas;
  • Compound nouns are not hyphenated, but compound adjectives are; e.g., Lie group as opposed to Lie-group method. Compound adjectives that use adverbs are not hyphenated; e.g., “diagonally implicit method” is correct;
  • -- (em-dash): used between two people, e.g., Runge–Kutta;
  • --- (en-dash): connects things that are related to each other by distance, as in the May–September issue of a magazine.

Accents:

Él está aquı́, input \’{E}l est\’{a} aqu\’{\i}.

Some special symbols:

Symbol Input
~ \textasciitilde
\ \textbackslash
_ \ _

Fonts

Style (roman, sans serif, etc.), series (medium, boldface, etc.), shape (upright, italic, etc.)

Declaration (\upshape) and command (\textup{}). The declaration can be used as enviroment names.

Optional arguments are inclosed in [], and mandatory arguments are inclosed in ().

Document


Page format

  • onecolumn/twocolumn
  • oneside/twoside (affects position of page number)
  • openany(chapters begin on “any” new page)/openright(chapters begin only on new right , that is, odd numbered, page)
  • notitlepage/titlepage (whether to separate title page)

Page style

  • \pagestyle{...},\thispagestyle{...}

  • plain/empty/headings/myheadings

  • \pagenumbering{...}

  • arabic/roman/Roman/alph/Alph

  • \setcounter{page}{ number }

Forming a document

  • \and helps you to put authors parallel
  • A proper hierarchy:\chapter\section\subsection\subsubsection\paragraph\subparagraph
  • \subsubsection is not numbered
  • A detailed structure, see P24 and 25
  • \Par and “\"

Bibliography


  • Bib style packages: harvard, natbib
  • With \nocite{*} , every entry in all the databases will be included, something that is useful when producing a list of all entries and their keys.
  • aux: reference auxiliary; bib: original bib; bst: bib style; bbl formatted bib; blg: log

Table of contents, index and glossary


  • .toc: table of contents, *.lot list of tables, *.lof list of figures

  • Edit the .toc , lof , lot files and use a \nofiles command to suppress the writing of new versions of the files

    is the last resort for you to fine-tune TOC

  • Use \addtocontents{ file }{ text } or\addcontentsline{ file }{ type }{ text } to add sections marked with * (will be omitted by default) (Actually \addcontentsline is invoked by \section or caption)

  • Fragile argument: What is the difference between Fragile and Robust commands

  • minitoc for mini TOC

  • makeidxto make index (*.idx file)

  • \makeglossary to make glossary (*.glo file)

Displayed text


  • Quotation \begin{quote} \end{quote} or (for multiple paragraphs) \begin{quotation} \end{quotation}
  • verse environment to quote poem. Use \\* to put it within a page. Use \\[n pt] to specify line space
  • {\renewcommand{\labelitemi}{$\triangleright$} (for example, \labelitemi, \labelitemiv, etc.) to replace default itemize bullets. Use {} to enclose \renewcommand and anything else for local effect only
  • Package enumerate for customized enumerate bullets and other formatting styles
  • \renewcommand{\descriptionlabel}[1]{\hspace{1cm}\textsf{#1}} example to customize description
  • enumerate can also include description

Rows and columns


  • tabbing environment for vertical alignment in enumerate

  • Use parbox to format column cells

  • \multicolumn{1} can override the position specification of any column set at the beginning of the environment.

  • \arraystretch to stretch columns

  • Use r@{--}l for range. Example:

    \begin{center}
    \begin{tabular}{|c|r@{--}l|}
    \hline
    Height & \multicolumn{2}{c|}{Ideal weight}\\
    (cm)
    & \multicolumn{2}{c|}{(kg)}\\
    \hline
    155 & 53.5 & 64\\
    160 & 56
    & 67\\
    ...............
    190 & 78
    & 92.5\\
    \hline
    \end{tabular}
    \end{center}
  • Enhancement: array, multirow, multicol, longtable, hhline, delarray, tabularx etc.

Mathematics


  • Text placed within $$ is in math italic

  • TeX has its own spacing rules in math mode

  • Inline math: in LaTeX:\( ... \) or \begin{math}\end{math}); in TeX: $$

  • Independent line: in LaTeX: \[\] or \begin{displaymath}\end{displaymath}, in TeX: $$$$

  • \;: thickspace, \, thinspace

  • \ldots: ellipsis (...)

  • Binary operator:\mathbin; relation operator: \mathrel

    x\Box y % produces x\Boxy
    x\mathbin\Box y % produces x \Box y
  • \newcommand{\vect}[1]{(#1_1,#1_2,\dots,#1_n)}% use \vect{sth} will substitute 1 to sth (2 and #2, 3 and #3… is the same)

  • The amsmath package:

    • Multi-line equation: multline env; use split env and & for alignment

    • Multi equations: gather env pr align env

    • An example: gather two groups of equations together

      • \begin{equation*}
        	\begin{aligned}
        		\cosˆ2x+sinˆ2x & = 1\\
        		\cosˆ2x-\sinˆ2x & = \cos 2x
        	\end{aligned}
        	\qquad\text{and}\qquad
        	\begin{aligned}
        		\coshˆ2x-\sinhˆ2x & = 1\\
        		\coshˆ2x+\sinhˆ2x & = \cosh 2x
        	\end{aligned}
        \end{equation*}
    • \tag{} for customized equation label; \notag to suppress

    • pmatrix is enclosed in parentheses, bmatrix is in square brackets, Bmatrix is in braces, and vmatrix is for determinant

    • \dotsc for dots to be used with commas, \dotsb for dots with binary operations (or relations), and \dotsm for multiplication dots. There is also a \dotsi for dots with integrals

    • smallmatrix env for inline matrices (use \left \right for appropriate alignment for brackets)

    • \bigl, \bigr; \biggl, \biggr; \Biggl, \Biggr to control bracket sizes (if you find using \left \right produces too large brackets)

    • \tfrac a “tiny” version of \frac, \genfrac for a customized frac. Note, binomial coefficients \binom is a special case of \genfrac

    • \verset for putting symbols overhead. e.g. $\overset{\circ}{a}$

    • \displaystyle changes inline expressions to displayed style (as in env).

    • \substack for multi-line subscripts.

    • Refer to “Log-like symbols” for math notations that should be typed in Roman (other than usual italic)

    • \DeclareMathOperator*{\new_operator}{statement}

    • “The TEX Book”: more on typing math

  • \newtheorem{user_difined}{displayed_test}[numbering_style], for userdefined` env

  • Customized theorem: amsthm package

Boxes


  • A box is an object that is treated by TEX as a single character. A box cannot be split and broken across lines or pages.

  • 3 types of boxes:

    • LR: (left-right) The content of this box are typeset from left to right.
    • Par: (paragraphs) This kind of box can contain several lines, which will be typeset in paragraph mode just like normal text. Paragraphs are put one on top of the other. Their widths are controlled by a user specified value.
    • Rule: A thin or thick line that is often used to separate various logical elements on the output page, such as between table rows and columns and between running titles and the main text.
  • LR boxes:

    • \mbox{ text } % without frame
      \makebox{ width }{ pos }{ text } % without frame
      \fbox{ text } % with frame
      \framebox{ width }{ pos }{ text } % with frame
      % pos arguments: l for left, r for right, c for center, s for stretch (in-text spaces)
    • \fboxrule, \fboxsep, and\raisebox for determining frame style, box positions(or rotations)

  • Par boxes:

    • Use either \parbox or minipage env (minipage is a page itself, i.e., it has footnotes, contains tabular, etc.)
    • \parbox{ pos }{ height }{ inner pos }{ width }{ text } or \begin{minipage}{ pos }{ height }{ inner pos }{ width }, with t,b,c,s for top, bottom, center, stretch
  • A rule box is basically a filled-in black rectangle.

  • It is also possible to have a rule box of zero width. This creates an invisible line with the given height. Such a construction is called a strut and is used to force a horizontal box to have a desired height or depth that is different from that of its contents.

Floats


  • Figures:

  • \begin{figure}
    	\includegraphics{figure.eps}
    	\caption{This is an inserted EPS graphic} 
    	% use \caption[lof]{description} to produce concise description in list of figures
    	\label{fig1}
    \end{figure}
    • Figures are not allowed in boxes (\parbox or minipage)
    • Positional arguments: h for here, t for top, b for bottom and p for page containing only floats (default [tbp])
    • \clearpage : This command places unprocessed floats and starts a new page.
    • \FloatBarrier: This command causes all unprocessed floats to be processed. This is provided by the placeins package. It does not start a new page, unlike \clearpage .
    • To place figures within a section: \usepackage[section]{placeins}, a less-restrictive one: \usepackage[below]{placeins}
    • The afterpage package provides the \afterpage command which executes a command at the next naturally-ocurring page break. (\afterpage{\clearpage} causes all unprocessed floats to be cleared at the next page break.)
    • Use float placement counters to control number of floats per page: \setcounter{totalnumber/topnumber/bottomnumber}{n}
    • Adjust float coverage per page using \textfraction etc.
    • Add graphics search path: \graphicspath{{dir1/}{dir2/}}
    • \rotatebox and \scalebox provided by graphicx package can rotate and boxes and floats
  • tabular is actually a minipage

    • The tabular env:

    • `\begin{ tabular }[ pos ]{ cols } rows \end{ tabular }``

    • ``\begin{ tabular* }{ width }[ pos ]{ cols } rows \end{ tabular* }`

    • Column positioning arguments:

      cols meaning
      l left
      r right
      c center
      { wd } The text in this column is set into lines of width wd and the top line is aligned with the other columns. In fact, the text is set in a parbox with the command \parbox[ t ]{ wd }{ column text } .
      * { num }{ cols } The column format contained in cols is reproduced num times, so that *{3}{|c|}| is the same as |c|c|c| .

Cross references


  • “cross” means both backward AND forward
  • Use ~ in your cross reference to avoid breaking lines
  • In floats, \label command should be given after the \caption command or in its argument
  • \pageref{ key } refer to page number
  • Package varioref (\vref{key}) produces “full” reference (position, page number, etc.) using some rules. (produce ref and/or \pageref depending on the current page)
  • Use package xr for external reference: \usepackage{xr} \externaldocument{ other.tex }

Footnotes, marginpars, and endnotes


  • Use tabularx, longtable or wrap tabular in minipage if you want to use footnote inside a tabular. Another package called threeparttable is also helpful.
  • \setcounter{footnote}{0} for resetting footnote counter (or use \@addtoreset{footnote}{section} in \makeatletter or \makeatother preamble)
  • \marginpar for marginal notes. A better version (macro): \newcommand{\marginlabel}[1] {\mbox{}\marginpar{\raggedleft\hspace{0pt}#1}}
  • Create query for margin notes: \def\query#1#2{\underline{#1}\marginpar{#2}}
  • Package endnotes for endnotes.