Skip to content

Instantly share code, notes, and snippets.

View VincentTam's full-sized avatar
🏀
Rolling around

Vincent Tam VincentTam

🏀
Rolling around
View GitHub Profile
@VincentTam
VincentTam / Makefile
Created January 30, 2014 05:29
My minimun working example of a makefile.
CXX = g++
SRCS = foo.cpp
default: $(SRCS:.cpp=.out)
.cpp.out:
$(CXX) $< -o $@
clean:
rm -rf *.out
@VincentTam
VincentTam / quote.markdown
Last active August 29, 2015 13:55
The TeX file is to show the difference between the quote and quotation environments for *TeX compilers, while the Markdown file is to show that such difference doesn't exist in pandoc.

% Sample Draft Paper No. 1 % Somobody Here %

Some paragraphs. After that go to a quote. Some paragraphs.[^1] After that go to a quote. Some paragraphs, after that go to a quote. Some paragraphs.[1] After that go to a quote.

Some long sentence. In a capitalist society, the separation of capital, land and property is unavoidable, but harmful to workers.

<RDF:Description RDF:about="urn:mimetype:text/plain"
NC:value="text/plain"
NC:description="Text Document">
<NC:fileExtensions>markdown</NC:fileExtensions>
<NC:fileExtensions>mdown</NC:fileExtensions>
<NC:fileExtensions>mkdn</NC:fileExtensions>
<NC:fileExtensions>md</NC:fileExtensions>
<NC:fileExtensions>mkd</NC:fileExtensions>
<NC:fileExtensions>mdwn</NC:fileExtensions>
<NC:fileExtensions>mdtxt</NC:fileExtensions>
@VincentTam
VincentTam / biblio.bib
Last active October 21, 2015 05:32
This is a LaTeX template for an English essay with a reference list with the APA format. For details, you may visit http://vincenttam.github.io/blog/2014/03/16/latex-template-for-essays/
@online{Gnu13,
author = {Richard Stallman},
title = {{Free Software and Education}},
date = {2013-11-06},
url = {http://www.gnu.org/education/education.html}
}
@article{kaplan2010users,
title={{Users of the world, unite! The challenges and opportunities
of social media}},
@VincentTam
VincentTam / latex_chin_sample.tex
Last active August 29, 2015 13:59
This is a LaTeX template for a Chinese essay. For details, you may visit http://vincenttam.github.io/blog/2014/04/05/latex-template-for-chin-essays/
\documentclass[12pt,a4paper]{article}
\usepackage[margin=1in]{geometry}
\usepackage{xeCJK}
\setCJKmainfont{AR PL UKai HK}
\setlength{\parindent}{2em}
\setlength{\parskip}{\baselineskip}
\usepackage{setspace}
\doublespacing
\usepackage{metalogo}
@VincentTam
VincentTam / my_template1.latex
Last active August 29, 2015 14:04
I slightly changed the default template file to generate PDF files with desired styles. See https://vincenttam.github.io/blog/2014/08/03/my-pandoc-template-1/ for details.
\documentclass[12pt,a4paper]{$documentclass$}
$if(fontfamily)$
\usepackage{$fontfamily$}
$else$
\usepackage{lmodern}
$endif$
\usepackage{setspace}
\setstretch{1.241} % for one half spacing of 12pt
%\setstretch{1.655} % for double spacing of 12pt
\usepackage{amssymb,amsmath}
@VincentTam
VincentTam / sample.bib
Last active August 29, 2015 14:04
A minimum working example for testing bibliography
@article{Cal2000,
author = {Calude, Andreea S.},
title = {The journey of the four colour theorem through time},
journal = {The New Zealand Mathematics Magazine},
year = {2001},
volume = {38},
number = {3},
pages = {27-35},
}
@VincentTam
VincentTam / new.tex
Created August 10, 2014 11:05
The LaTeX source code of the figure for illustrating the problem described in https://vincenttam.github.io/blog/2014/07/13/evince-viewing-error/
\documentclass[tikz]{standalone}
\usetikzlibrary{calc,through,intersections,backgrounds,patterns}
\begin{document}
\begin{tikzpicture}
\filldraw [pattern=grid] (0,0) circle (1);
\end{tikzpicture}
\end{document}
@VincentTam
VincentTam / 69-language-selector-zh-hk.conf.part
Last active August 29, 2015 14:05
Part of my default /etc/fonts/conf.avail/69-language-selector-zh-hk.conf on Ubuntu 14.04. It caused display problem for monospaced fonts. For details, refer to https://vincenttam,github.io/blog/2014/08/17/ubuntu-14-dot-04-monospaced-font-family/
<match target="pattern">
<test qual="any" name="family">
<string>monospace</string>
</test>
<test name="lang">
<string>zh-hk</string>
</test>
<edit name="family" mode="prepend" binding="strong">
<string>Droid Sans</string>
<string>AR PL UMing HK</string>
@VincentTam
VincentTam / t_table.tex
Last active August 29, 2015 14:07
A LaTeX method of preparing a table consisting of IPA symbols
\documentclass[border=5pt]{standalone}
\begin{document}
\begin{tabular}{lll}
\hline
\multicolumn{1}{||c}{Header 1} &
\multicolumn{1}{||c||}{Header 2} &
\multicolumn{1}{c||}{Header 3} \\ \hline
\multicolumn{1}{||p{3.5cm}}{Cell 1} &
\multicolumn{1}{||p{3.5cm}||}{Cell 1} &
\multicolumn{1}{p{3.5cm}||}{Cell 1} \\ \hline