Skip to content

Commit 4c1daf3

Browse files
committed
fix #26: cannot handle utf-8 strings
1 parent 25d6984 commit 4c1daf3

File tree

6 files changed

+36
-16
lines changed

6 files changed

+36
-16
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ html: clean $(HTML)
1313
python resume.py html $(GRAVATAR_OPTION) < $< | pandoc -t html -c resume.css -o $@
1414

1515
%.pdf: %.md $(LATEX_TEMPLATE)
16-
python resume.py tex < $< | pandoc --template=$(LATEX_TEMPLATE) -H header.tex -o $@
16+
python resume.py tex < $< | pandoc $(PANDOCARGS) --template=$(LATEX_TEMPLATE) -H header.tex -o $@
1717

1818
ifeq ($(OS),Windows_NT)
1919
# on Windows

README.markdown

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,22 @@ This is a simple Markdown resumé template, LaTeX header, and pre-processing
22
script that can be used with [Pandoc](http://johnmacfarlane.net/pandoc/) to
33
create professional-looking PDF and HTML output.
44

5-
Dependencies
6-
------------
5+
## Dependencies
76

8-
* Pandoc >= 1.9 (you can adjust the Makefile to use an earlier version -- the
9-
arguments format changed)
7+
* Pandoc >= 1.9
108
* Python >= 2.7
119
* A Tex installation with pdflatex and the Tex Gyre Pagella font, and some
12-
packages needed by pandoc. On Ubuntu you can get this by installing
13-
`texlive`, `texlive-latex-extra`, and `tex-gyre`.
10+
packages needed by pandoc. On Ubuntu you can get this by doing:
1411

15-
Usage
16-
-----
12+
```
13+
sudo apt-get install texlive texlive-latex-extra tex-gyre
14+
```
1715

18-
Simply run `make` to generate PDF and HTML versions of each .md file in the
19-
directory.
16+
## Usage
17+
18+
To generate PDF and HTML versions of each .md file in the directory:
19+
20+
$ make
2021

2122
In order to enable visually appealing display of contact information, the
2223
Markdown is passed through a Python script that looks for contact details
@@ -25,5 +26,18 @@ box at the top of the document. Lines with bullets (•) will be treated as
2526
separate contact lines in the output.
2627

2728
By default, an image of your [Gravatar](http://www.gravatar.com) will be added
28-
to the HTML resumé. This feature can be disabled by setting the environment
29-
variable `GRAVATAR_OPTION=--no-gravatar`.
29+
to the HTML resumé. To avoid this:
30+
31+
$ GRAVATAR_OPTION=--no-gravatar make
32+
33+
## Unicode characters
34+
35+
The default setup should handle most unicode characters. If you still get
36+
errors (such as for Chinese characters), install XeTeX and a font that has
37+
glyphs for the characters you need.
38+
39+
$ sudo apt-get install texlive-xetex ttf-wqy-zenhei
40+
41+
Modify `header.tex` to use the name of your preferred font, then run:
42+
43+
$ PANDOCARGS='--latex-engine=xelatex' make

header.tex

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
\usepackage[top=.5in, bottom=.5in, left=1in, right=1in]{geometry}
22
\usepackage{tgpagella}
3+
\ifxetex
4+
\usepackage{xeCJK}
5+
\setCJKmainfont{WenQuanYi Zen Hei}
6+
\setmainfont[Mapping=tex-text]{TeXGyrePagella}
7+
\fi
8+
39
\usepackage{titlesec}
410
\titleformat{\section}{\huge\bfseries}{\thesection}{1em}{}
511
\titlespacing{\section}{0pt}{0pt}{1em}

pandoc-templates

resume.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@
55
<meta http-equiv="Content-Style-Type" content="text/css" />
66
<meta name="generator" content="pandoc" />
77
<title></title>
8+
<style type="text/css">code{white-space: pre;}</style>
89
<link rel="stylesheet" href="resume.css" type="text/css" />
910
</head>
1011
<body>
1112
<div id='container'><div id='contact'><p>
1213
<a href="https://raw.github.com/mwhite/resume/master/resume.md">Markdown</a> -&gt; <a href="https://raw.github.com/mwhite/resume/master/resume.pdf">PDF</a>, <a href="http://mwhite.github.com/resume">HTML</a>, and more
1314
</p><p>
14-
<a href="http://github.com/mwhite/resume"><code class="url">http://github.com/mwhite/resume</code></a>
15+
<a href="http://github.com/mwhite/resume">http://github.com/mwhite/resume</a>
1516
</p></div>
1617
<div>
1718
<h1 id="markdown-resumé">Markdown Resumé</h1>
@@ -61,6 +62,5 @@ <h2 id="skills">Skills</h2>
6162
<li><p>Familiar with GNU Make, bash</p></li>
6263
</ul>
6364
</div>
64-
6565
</body>
6666
</html>

resume.pdf

5.54 KB
Binary file not shown.

0 commit comments

Comments
 (0)