编程差分隐私
这是"编程差分隐私"一书的源代码仓库。您可以在这里在线阅读本书。
构建说明
构建本书:
jupyter-book build .
发布HTML:
ghp-import -n -p -f _build/html
生成LaTeX:
jupyter-book build . --builder latex
要获得较好的LaTeX输出效果,请添加以下内容:
\PassOptionsToPackage{svgnames}{xcolor}
...
\sphinxsetup{%
verbatimwithframe=false,
VerbatimColor={named}{OldLace},
TitleColor={named}{DarkGoldenrod},
hintBorderColor={named}{LightCoral},
attentionborder=3pt,
attentionBorderColor={named}{Crimson},
attentionBgColor={named}{FloralWhite},
noteborder=2pt,
noteBorderColor={named}{Olive},
cautionborder=3pt,
cautionBorderColor={named}{Cyan},
cautionBgColor={named}{LightCyan}}
或者:
\PassOptionsToPackage{svgnames}{xcolor}
...
\sphinxsetup{%
% verbatimwithframe=false,
VerbatimColor={named}{Ivory},
TitleColor={named}{DarkGoldenrod},
hintBorderColor={named}{LightCoral},
attentionborder=3pt,
attentionBorderColor={named}{Crimson},
attentionBgColor={named}{FloralWhite},
noteborder=2pt,
noteBorderColor={named}{Olive},
cautionborder=3pt,
cautionBorderColor={named}{Cyan},
cautionBgColor={named}{LightCyan}}
\setkeys{Gin}{width=.60\csname Gin@nat@width\endcsname,keepaspectratio}
还可以添加:
\makeatletter
\usepackage{ifthen}
\usepackage{tcolorbox}
\tcbuselibrary{skins}
\renewenvironment{sphinxadmonition}[2]
{
%条件的绿色框
\ifthenelse{\equal{#2}{Conditions}}{
\medskip
\begin{tcolorbox}[before={}, enhanced, colback=green!10,
colframe=green!65!black,fonttitle=\bfseries,
title=\sphinxstrong{#2}, arc=0mm, drop fuzzy shadow=blue!50!black!50!white]}{
%注释的蓝色框
\ifthenelse{\equal{#2}{Note:}}{
\medskip
\begin{tcolorbox}[before={}, enhanced, colback=blue!5!white,
colframe=blue!75!black,fonttitle=\bfseries,
title=\sphinxstrong{#2}, arc=0mm, drop fuzzy shadow=blue!50!black!50!white]}{
%警告的橙色框
\ifthenelse{\equal{#2}{Warning:}}{
\medskip
\begin{tcolorbox}[before={}, enhanced, colback=orange!5!white,
colframe=orange!75!black,fonttitle=\bfseries,
title=\sphinxstrong{#2}, arc=0mm, drop fuzzy shadow=blue!50!black!50!white]}{
%其他情况的红色框
\medskip
\begin{tcolorbox}[before={}, enhanced, colback=red!5!white,
colframe=red!75!black, fonttitle=\bfseries,
title=\sphinxstrong{#2}, arc=0mm, drop fuzzy shadow=blue!50!black!50!white]}
}
}
}
{
\end{tcolorbox}\par\bigskip
}
\makeatother