去 pmlr 下载 icml 的 bibliography.bib
用 如下代码 parse.py 预处理成 latex 段落
#!/usr/bin/python
# -*- coding: UTF-8 -*-
def getValue(s):
return s.split("=")[1].strip().strip(',')[1:-1]
with open("bibliography.bib",'r',encoding='utf8') as fin:
with open("output.txt",'w',encoding='utf8') as fout:
for line in fin.readlines():
if " title =" in line:
fout.write("\section*{%s}\n\n" % getValue(line).replace('&','\$'))
if " author =" in line:
fout.write("\\textbf{Authors}: %s\n\n" %getValue(line).replace('&','\$'))
if " url =" in line:
fout.write("\\textbf{URL}\quad\ \ \,\,:\, \\url{%s}\n\n" %getValue(line))
得到 output.txt
\section*{{AR}e{S} and {M}a{RS} Adversarial and {MMD}-Minimizing Regression for {SDE}s}
\textbf{Authors}: Abbati, Gabriele and Wenk, Philippe and Osborne, Michael A. and Krause, Andreas and Sch{\"o}lkopf, Bernhard and Bauer, Stefan
\textbf{URL}\quad\ \ \,\,:\, \url{http://proceedings.mlr.press/v97/abbati19a.html}
\section*{Dynamic Weights in Multi-Objective Deep Reinforcement Learning}
\textbf{Authors}: Abels, Axel and Roijers, Diederik and Lenaerts, Tom and Now{\'e}, Ann and Steckelmacher, Denis
\textbf{URL}\quad\ \ \,\,:\, \url{http://proceedings.mlr.press/v97/abels19a.html}
...
使用 latex 生成 pdf
\documentclass[a4paper,12pt]{article}
\title{ICML2019}
\author{}
\date{June 9--15, 2019}
% Compile with XeLaTeX or LuaLaTeX
\usepackage[tmargin=1in,bmargin=1in,lmargin=1in,rmargin=1in]{geometry}
\usepackage{fontspec}
\usepackage{xcolor}
\usepackage{titlesec}
\usepackage[comma,numbers,square,sort&compress]{natbib}
\usepackage{epstopdf}
\usepackage{graphicx} %% not necessary
\usepackage{amsmath,amssymb}
\usepackage{amsfonts}
\usepackage{url}
\usepackage{array,tabularx}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{pifont}
\usepackage{extarrows}
\usepackage{bm}
\usepackage{ifthen}
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage{algpseudocode}
\usepackage{amsmath,amsthm}
%\usepackage[colorlinks,linkcolor=black,anchorcolor=blue]{hyperref}
\defaultfontfeatures{Ligatures=TeX}
% Set sans serif font to Calibri
\setsansfont{Calibri}
% Set serifed font to Cambria
\setmainfont{Cambria}
% Define light and dark Microsoft blue colours
\definecolor{MSBlue}{rgb}{.204,.353,.541}
\definecolor{MSLightBlue}{rgb}{.31,.506,.741}
% Define a new fontfamily for the subsubsection font
% Don't use \fontspec directly to change the font
\newfontfamily\subsubsectionfont[Color=MSLightBlue]{Times New Roman}
% Set formats for each heading level
\titleformat*{\section}{\large\bfseries\sffamily\color{MSBlue}}
\titleformat*{\subsection}{\large\bfseries\sffamily\color{MSLightBlue}}
\titleformat*{\subsubsection}{\itshape\subsubsectionfont}
\begin{document}
\maketitle
\setlength\parindent{0em}
%\tableofcontents
\thispagestyle{empty}
\newpage
\setcounter{page}{1}%从下面开始编页码
\input{output.txt}
%\end{CJK*}
\end{document}