A repository for my vitæ. It uses org-mode, a custom style sheet and a LaTeX
file style. The resume is done within resume.org file. All styles are embedded
within this file and a Makefile
is provided to produce the html
and pdf
files.
This section is used to publish the documentation to html
and pdf
in the
pub/
directory.
This code defines the publish-html-cv
and publish-pdf-cv
which are used to
publish the CV into html
and pdf
, respectively.
(require 'ox-html)
if [ -d .git ]; then
LC_MESSAGES=en git --no-pager log -1 HEAD --date=short --pretty=format:'<i class=\"fab fa-github-alt\"></i> commit <a href=https://github.com/xgarrido/org-resume/commit/%H>%h</a> - %ad'
fi
preamble+='<div id=\"address\">'
preamble+='<span class=\"name\">Xavier Garrido</span><br>'
preamble+='<a href=\"http://www.ijclab.in2p3.fr\">IJCLab</a><br>'
preamble+='Paris-Saclay University, Orsay<br>'
preamble+='</div>'
preamble+='<div id=\"contact\">'
preamble+='<span class=\"name\"> </span><br>'
preamble+='(33) 1 64 46 84 28<br>'
preamble+='<a href=\"http://xgarrido.github.io\">xgarrido.github.io</a><br>'
preamble+='<a href=\"mailto:[email protected]\">[email protected]</a>'
preamble+='</div>'
echo -ne $preamble
(setq this-directory (file-name-directory (or load-file-name buffer-file-name)))
(setq pub-directory (concat this-directory "pub/"))
(unless (boundp 'org-publish-project-alist)
(setq org-publish-project-alist nil))
(setq org-publish-timestamp-directory "/tmp/org-timestamps/")
(setq org-html-style-default "")
(setq org-html-htmlize-output-type 'css)
(add-to-list
'org-publish-project-alist
`("publish-html-cv"
:base-directory ,this-directory
:base-extension "org"
:publishing-directory ,(expand-file-name "html" pub-directory)
:publishing-function org-html-publish-to-html
:exclude ".*publish.*.org\\|README.org"
:time-stamp-file nil
:section-numbers nil
:with-toc nil
:html-head "<link rel=\"stylesheet\" href=\"stylesheets/styles.css\">
<link rel=\"stylesheet\" href=\"stylesheets/org-pygments.css\">"
:html-preamble "<<html-preamble()>>"
:html-postamble "<<html-postamble()>>"
:html-head-include-scripts nil))
@import url(//fonts.googleapis.com/css?family=Open+Sans);
@import url(//fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700);
@import url(//fonts.googleapis.com/css?family=Inconsolata);
body {
width:800px;
margin:50px auto;
/*font:14px/1.5 Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;*/
font-family: "Open Sans", sans-serif;
font-size: 12px;
color:#777777;
font-weight:300;
}
h1, h2, h3, h4, h5, h6 {
color:#777777;
margin:0 0 20px;
}
h1, h2, h3 {
line-height:1.1;
}
h1 {
display: none;
}
h3, h4, h5, h6 {
font-style: italic;
}
a {
color: #3399cc; /*#67ad00;*/
font-weight:400;
text-decoration:none;
}
a:hover {
color:#006699; /*#7fd600;*/
}
a small {
font-size:11px;
color:#777777;
margin-top:-0.6em;
display:block;
}
a:hover small {
color:#777777;
}
p, ul, ol, table, pre, dl {
margin:0 0 20px;
}
blockquote {
border-left:1px solid #e5e5e5;
width:600px;
padding:0 0 0 20px;
font-style:italic;
}
code, pre {
font-family:Inconsolata, Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal;
color:#777;
font-size:12px;
}
pre {
padding:8px 15px;
background: #f8f8f8;
border-radius:5px;
border:1px solid #e5e5e5;
overflow-x: auto;
}
table {
width:80%;
border-collapse:collapse;
margin-left:auto;
margin-right:auto;
}
th, td {
text-align:left;
padding:5px 10px;
border-bottom:1px solid #e5e5e5;
}
dt {
color:#444;
font-weight:700;
}
th {
color:#444;
}
img {
max-width:100%;
}
#content {
width:700px;
float:right;
padding-bottom:50px;
/* border:1px solid #e5e5e5; */
/* border-width:1px 0; */
/* padding:20px 0; */
/* margin:0 0 20px; */
}
strong {
color:#222;
font-weight:700;
}
small {
font-size:11px;
}
hr {
border:0;
background:#e5e5e5;
height:1px;
margin:0 0 20px;
}
.footpara {
display: inline;
}
.scrollbar-container {
position: absolute;
top: 0; bottom: 0; left: 0; right: 0;
margin: 20px;
border: 4px solid rgba(0, 0, 0, 0.2);
overflow: auto;
background-color: whiteSmoke;
}
.scrollbar-container .inner {
height: 2011px;
width: 1985px;
padding: 1em;
background-color: white;
font-family: sans-serif;
}
::-webkit-scrollbar {
background: transparent;
}
::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.2);
border: solid whiteSmoke 4px;
border-radius:15px;
}
::-webkit-scrollbar-thumb:hover {
background-color: rgba(0, 0, 0, 0.3);
}
#preamble:before, #preamble:after {
display: table;
content: "";
}
#preamble:after {
clear: both;
}
#postamble {
margin-top: 10px;
text-align: center;
font-size: 11px;
clear: both;
}
#address {
float: left;
}
#contact {
float: right;
text-align: right;
}
.name {
font-size: 20px;
line-height: 22px;
font-weight: 600;
}
@media print, screen and (max-width: 960px) {
body {
width:auto;
margin:0;
}
header, content, footer {
float:none;
position:static;
width:auto;
}
header {
padding-right:320px;
}
header a small {
display:inline;
}
header ul {
position:absolute;
right:50px;
top:52px;
}
}
@media print, screen and (max-width: 720px) {
body {
word-wrap:break-word;
}
header {
padding:0;
}
header ul, header p.view {
position:static;
}
pre, code {
word-wrap:normal;
}
}
@media print, screen and (max-width: 480px) {
body {
padding:15px;
}
header ul {
display:none;
}
}
@media print {
body {
padding:0.4in;
font-size:12pt;
color:#444;
}
}
.org-string,
.org-type {
color: #DEB542;
}
.org-builtin,
.org-variable-name,
.org-constant,
.org-function-name {
color: #69B7F0;
}
.org-comment,
.org-comment-delimiter,
.org-doc {
color: #93a1a1;
}
.org-keyword {
color: #D33682;
}
pre {
color: #777777;
}
A homemade style for producing nice looking vitæ with org-mode
. The main trick
is to use titlesec LaTeX package to tweak the title/section/subsection… look
and thus, use all the hierarchical view of org-mode
. Then the style itself is
a mix of Kieran Healy’s CV with an old one I had.
This section defines org
preamble and settings for documents exported from
.org
to .tex
files. The basic use is to add \usepackage{org-preamble}
in
your LaTeX document.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{org-preamble}[2013/03/03 v0.01 Bundling of Preamble items for Org to LaTeX export]
Options can be passed to org-preamble
style file within \usepackage[options]
call. For the time being, I have only copied/pasted how to declare such options
but do not use it.
\RequirePackage{ifthen}
\newboolean{@fr} %
\setboolean{@fr}{false} %
\DeclareOption{fr}{
\setboolean{@fr}{true}
}
\ProcessOptions
\RequirePackage{amsmath,amssymb}
minted is a package that facilitates expressive syntax highlighting in LaTeX
using the powerful Pygments library. The package also provides options to
customize the highlighted source code output using fancyvrb
.
\RequirePackage[cache]{minted}
\RequirePackage{ifxetex}
\ifxetex
\RequirePackage{fontspec}
\RequirePackage{xunicode}
%%\else
\fi
\RequirePackage{hyperref}
pifont package
\RequirePackage{pifont}
\RequirePackage{comment}
tikz package
\RequirePackage{tikz}
\usetikzlibrary{positioning,arrows,decorations,backgrounds,patterns,matrix,shapes,fit,calc,shadows,plotmarks,spy,trees}
We use the external library from tikz
to cache i.e. produce a pdf
file of
each tikzpicture
. tikz/external
looks if the pdf exist and if not, export it.
%%\tikzset{
%% external/system call={%
%% xelatex -shell-escape
%% -halt-on-error -interaction=batchmode
%% -jobname "\image" "\texsource"}}
%%\tikzexternalize[prefix=latex.d/]
\input "|mkdir -p latex.d"
\input "|mkdir -p /tmp/latex.d"
\RequirePackage{xspace}
\RequirePackage[normalem]{ulem}
\RequirePackage{relsize}
\newfontfamily{\FA}{FontAwesome}
\newcommand*{\faicon}[1]{{\FA\csname faicon@#1\endcsname}}
\expandafter\def\csname faicon@github-alt\endcsname{\symbol{"F113}}\def\faGithubAlt{{\FA\csname faicon@github-alt\endcsname}\xspace}
\expandafter\def\csname faicon@external-link\endcsname{\symbol{"F08E}}\def\faExternalLink{{\FA\csname faicon@external-link\endcsname}\xspace}
\let\@email\@empty
\@ifundefined{email}{%
\newcommand\email[1]{\gdef\@email{#1}}}{}
\RequirePackage{changepage}
\newcommand\clearemptydoublepage{%
\checkoddpage
\ifthenelse{\boolean{oddpage}}%
{\null\clearpage\thispagestyle{empty} \null \clearpage}%
{\null\clearpage}%
}
%%\newcommand{\clearemptydoublepage}{\newpage{\cleardoubleemptypage\thispagestyle{empty}}
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{cv_style}[2013/11/06 v0.01 Bundling CV LaTeX style]
\RequirePackage{kvoptions}
\SetupKeyvalOptions{
family=cv,
prefix=cv@
}
\DeclareBoolOption[false]{oldstyle}
\ProcessKeyvalOptions*
These values can be overloaded within the org file using #+LATEX_HEADER
command.
\def\myemail{[email protected]}
\def\myweb{xavier.github.io}
\def\myphone{+33 (0)1 64 46 84 28}
\def\myfax{+33 (0)1 69 07 94 04}
\definecolor{red}{RGB}{221,42,43}
\definecolor{green}{RGB}{105,182,40}
\definecolor{blue}{RGB}{0,51,153}
\definecolor{gray}{RGB}{25,25,25}
%\definecolor{red}{HTML}{D43F3F}
%\definecolor{blue}{HTML}{00ACE9}
%\definecolor{green}{HTML}{6A9A1F}
\colorlet{theMainColor}{blue}
\colorlet{theRefColor}{blue!90}
\newcommand{\globalcolor}[1]{%
\color{#1}\global\let\default@color\current@color
}
\RequirePackage{titlesec}
\RequirePackage{enumitem}
\RequirePackage{a4wide}
\hypersetup{
xetex,
colorlinks=true,
urlcolor=theRefColor,
filecolor=theRefColor,
linkcolor=theRefColor,
plainpages=false,
pdfpagelabels,
bookmarksnumbered,
pagebackref
}
\setlength{\parindent}{0cm}
Choose fonts for use with xelatex. Minion and Myriad are widely available, from Adobe. Inconsolata is used as monospace font.
\setromanfont[Mapping={tex-text},Numbers={OldStyle}]{Minion Pro}
\setsansfont[Mapping=tex-text,Colour=theMainColor]{Myriad Pro}
\setmonofont[Mapping=tex-text,Scale=0.9]{Inconsolata}
\RequirePackage{ifthen}
\newboolean{@fr} %
\setboolean{@fr}{false} %
\DeclareOption{fr}{
\setboolean{@fr}{true}
}
\ProcessOptions
\newcommand{\mytitle}{}
\ifthenelse{\boolean{@fr}}{
\renewcommand{\mytitle}{\normalsize\@author\\\footnotesize \href{http://www.lal.in2p3.fr}{Laboratoire de l'Accélérateur Linéaire}
\\ Bâtiment 200, \\ Université Paris-Sud, \\ \vspace{-0.05in} 91898 Orsay Cedex}
}{
\renewcommand{\mytitle}{\normalsize\@author\\\footnotesize \href{http://www.lal.in2p3.fr}{Laboratoire de l'Accélérateur Linéaire}
\\ Building 200, \\ Paris-South University, \\ \vspace{-0.05in} 91898 Orsay Cedex}
}
\renewcommand*{\maketitle}{%
\globalcolor{gray}
\begin{minipage}[t]{2.95in}
\flushleft {\mytitle}
\end{minipage}
\hfill
\hfill
\begin{minipage}[t]{1.7in}
\ifthenelse{\boolean{@fr}}{
\flushright \footnotesize Téléphone:~\myphone \\
}{
\flushright \footnotesize Phone:~\myphone \\
}
Fax:~\myfax \\
{\scriptsize \texttt{\href{mailto:\myemail}{\myemail}}} \\
{\scriptsize \texttt{\href{\myweb}{\myweb}}}
\end{minipage}
\vspace{10pt}
}
titlesec
format respects the following writing convention:
\titleformat{<command>}{<shape>}{<format>}{<label>}{<sep>}{<before-code>}{<after-code>}
\ifthenelse{\boolean{cv@oldstyle}}{
\titleformat{\section}[block] %command
{\usekomafont{sectioning}\usekomafont{section}%
\tikz[overlay] \shade[left color=white,right color=blue] (0,-0.7ex) rectangle (\textwidth,-0.8ex);}%} %format
{\thesection} %label
{1em} %sep
{} %before
[] %after
\titlespacing{\section}{0pt}{10pt}{5pt}}{
\titleformat{\section} %command
[leftmargin] %shape
{\footnotesize\bfseries\sffamily\raggedleft} %format
{} %label
{0pt} %sep
{\lowercase} %before
[] %after
\titlespacing{\section}{90pt}{10pt}{15pt}}
\titleformat{\subsection} %command
{\bfseries\itshape} %format
{} %label
{0pt} %sep
{} %before
[] %after
\ifthenelse{\boolean{cv@oldstyle}}{}{
\titlespacing{\subsection}{-5pt}{15pt}{5pt}}
\ifthenelse{\boolean{cv@oldstyle}}{}{
\renewenvironment{itemize}{
\begin{list}{\textbullet}{%
\setlength{\itemsep}{0.05in}
\setlength{\parsep}{0in}
\setlength{\parskip}{0in}
\setlength{\topsep}{0in}
\setlength{\partopsep}{0in}
\setlength{\leftmargin}{0.1in}}
\vspace{-5mm}}{\end{list}}
%% \renewenvironment{enumerate}{
%% \begin{list}{}{%
%% \setlength{\itemsep}{0.05in}
%% \setlength{\parsep}{0in}
%% \setlength{\parskip}{0in}
%% \setlength{\topsep}{0in}
%% \setlength{\partopsep}{0in}
%% \setlength{\leftmargin}{0.1in}}}{\end{list}}
}
if [ -d .git ]; then
log=$(LC_MESSAGES=en git --no-pager log -1 HEAD --date=short --pretty=format:"commit \href{https://github.com/xgarrido/org-resume/commit/%H}{\color{gray!50}\texttt{%h}} -- %ad")
echo "\renewcommand*{\PrelimText}{\textnormal{\small\color{gray!50}${log}}}"
fi
\RequirePackage{ifthen}
\newboolean{@novc} %
\setboolean{@novc}{false} %
\DeclareOption{novc}{
\setboolean{@novc}{true}
}
\ProcessOptions
\ifthenelse{\boolean{@novc}}{}{
\RequirePackage{prelim2e}
<<vc-status()>>
}
(setq org-export-with-smart-quotes t)
(setq org-latex-remove-logfiles nil)
Only include one default package and remove all the crapppy stuff included by
org
→ latex
translation.
(add-to-list 'org-latex-packages-alist '("" "org-preamble"))
(unless (boundp 'org-latex-classes)
(setq org-latex-classes nil))
(add-to-list 'org-latex-classes
'("cv"
"\\documentclass[10pt]{scrartcl}
[PACKAGES]
\\usepackage[]{cv-style}
[NO-DEFAULT-PACKAGES]"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
(setq org-latex-pdf-process '("latexmk -xelatex -shell-escape -quiet %f"))
Remove the quote block
(defun latex::cv-quote-filter (contents backend info)
(when (eq backend 'latex)
(replace-regexp-in-string "." "" contents)))
(add-to-list 'org-export-filter-quote-block-functions
'latex::cv-quote-filter)
(add-to-list
'org-publish-project-alist
`("publish-pdf-cv"
:base-directory ,this-directory
:base-extension "org"
:publishing-directory ,(expand-file-name "pdf" pub-directory)
:publishing-function org-latex-publish-to-pdf
:exclude ".*publish.*.org\\|README.org"
:section-numbers 2
:with-toc t
:latex-class "cv"
:latex-header-extra ""
))
(defun org-publish-html ()
(progn
(org-publish-project "publish-html-cv" 'force)
(rename-file (expand-file-name "resume.html" (expand-file-name "html" pub-directory))
(expand-file-name "index.html" (expand-file-name "html" pub-directory)) t)
))
(defun org-publish-pdf ()
(progn
(org-publish-project "publish-pdf-cv" 'force)
(shell-command "mv ./latex.d pub/pdf/.; mv -f resume* *.sty ./pub/pdf/latex.d/.; mv ./pub/pdf/latex.d/resume*.org .")
))