mirror of
https://github.com/rosenpass/rosenpass.git
synced 2025-12-12 07:40:30 -08:00
add LaTeX setup
This commit is contained in:
14
.gitignore
vendored
14
.gitignore
vendored
@@ -1,2 +1,16 @@
|
||||
# Rust
|
||||
/target
|
||||
|
||||
# LaTeX
|
||||
_minted-*
|
||||
_markdown_*
|
||||
*.aux
|
||||
*.out
|
||||
*.log
|
||||
*.fdb*
|
||||
*.fls
|
||||
*.gz
|
||||
*.pdf
|
||||
*.bbl
|
||||
*.blg
|
||||
!papers/graphics/*.pdf
|
||||
|
||||
4
papers/.latexmkrc
Normal file
4
papers/.latexmkrc
Normal file
@@ -0,0 +1,4 @@
|
||||
ensure_path('TEXINPUTS','tex/', '.');
|
||||
ensure_path('LUAINPUTS','tex/', '.');
|
||||
|
||||
$pdf_mode=4;
|
||||
25
papers/readme.md
Normal file
25
papers/readme.md
Normal file
@@ -0,0 +1,25 @@
|
||||
# Rosenpass papers:
|
||||
|
||||
This directory is containing publications by the Rosenpass project. You find this readme either within the source directory or the branch holding the built PDFs files.
|
||||
|
||||
## Direct links to the PDF files
|
||||
|
||||
[Whitepaper](https://github.com/rosenpass/rosenpass/blob/papers-pdf/whitepaper.pdf)
|
||||
|
||||
## Local build instructions
|
||||
|
||||
Requirements: To build the PDF files from Markdown you have to use at least TeX Live 2021 and python-pygments for the syntax highlighting.
|
||||
|
||||
You can build the PDF files from Markdown using `latexmk`. Simply run
|
||||
|
||||
```
|
||||
latexmk -r tex/CI.rc
|
||||
```
|
||||
|
||||
inside `papers/`. The PDF files will be located directly in `papers/`.
|
||||
|
||||
## Add version info within the template-rosenpass files
|
||||
|
||||
The version info is using gitinfo2. To use the setup one has to run the `papers/tex/gitinfo2.sh` script. In local copies it's also possible to add this as a post-checkout or post-commit hook to keep it automatically up to date.
|
||||
|
||||
The version information in the footer automatically includes a “draft”. This can be removed by tagging a release version using `\jobname-release`, e.h. `whitepaper-release` for the `whitepaper.md` file.
|
||||
11
papers/tex/CI.rc
Normal file
11
papers/tex/CI.rc
Normal file
@@ -0,0 +1,11 @@
|
||||
ensure_path('TEXINPUTS','tex/', '.');
|
||||
ensure_path('LUAINPUTS','tex/', '.');
|
||||
|
||||
@default_files=("*.md");
|
||||
@default_excluded_files = ("*_content.md", "README.md", "readme.md");
|
||||
$do_cd=1;
|
||||
$pdf_mode=4;
|
||||
|
||||
$lualatex= 'lualatex --jobname=%R --shell-escape %O "\\def\\MarkDownInputFile{%S}\\input{markdown-wrapper.tex}"';
|
||||
|
||||
$clean_ext='_markdown_%R _markdown_%R _minted-%R _minted-%R';
|
||||
44
papers/tex/cryptoverif-lexer.py
Normal file
44
papers/tex/cryptoverif-lexer.py
Normal file
@@ -0,0 +1,44 @@
|
||||
import re
|
||||
from pygments.lexer import RegexLexer, bygroups, words
|
||||
from pygments.token import *
|
||||
|
||||
class CryptoVerifLexer(RegexLexer):
|
||||
"""
|
||||
Lexer for the CryptoVerif
|
||||
"""
|
||||
flags = re.MULTILINE | re.DOTALL
|
||||
|
||||
name = 'CrptoVerif'
|
||||
aliases = ['cryptoverif']
|
||||
filenames = ['*.ocvl']
|
||||
|
||||
tokens = {
|
||||
'root': [
|
||||
(r'\(\*', Comment.Multiline, 'comment'),
|
||||
(r'\s+', Text),
|
||||
(r'(%|&)[^;]*;', Name.Entity),
|
||||
('<!--', Comment, 'comment'),
|
||||
(r'[(|)*,?+]', Operator),
|
||||
(r'"[^"]*"', String.Double),
|
||||
(r'\'[^\']*\'', String.Single),
|
||||
(r'[{}]', Name.Builtin),
|
||||
(words((
|
||||
'type', 'let', 'letfun', 'in', 'out', 'if', 'then', 'else', 'equation', 'forall', 'foreach', 'table', 'find', 'implementation', 'const', 'fun', 'bottom', 'serial', 'equal', 'inverse', 'fixed', 'large', 'bounded', 'unique', 'data', 'event', 'inj-event', 'query', 'get', 'proba', 'process', 'proof', 'param', 'def', 'expand', 'run', 'use_entropy', 'do', 'random', 'set', 'yield', 'insert', 'return', 'suchthat'), suffix=r'\b'),
|
||||
Keyword),
|
||||
(r'[\w_]+', Text),
|
||||
(r'\d', Number),
|
||||
(r'\s', Text),
|
||||
(r'[]{}:(),;\.[]', Punctuation),
|
||||
(r'=', Operator),
|
||||
],
|
||||
'comment':[
|
||||
(r'[^*]+', Comment.Multiline),
|
||||
(r'\(\*', Comment.Multiline, '#push'),
|
||||
(r'\*\)', Comment.Multiline, '#pop'),
|
||||
(r'[*\)]', Comment.Multiline)
|
||||
],
|
||||
'format': [
|
||||
(r'\.\n', String.Interpol, '#pop'),
|
||||
(r'[^\n]*\n', String.Interpol),
|
||||
],
|
||||
}
|
||||
32
papers/tex/gitinfo2.sh
Executable file
32
papers/tex/gitinfo2.sh
Executable file
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh
|
||||
# Copyright 2015 Brent Longborough
|
||||
# modified 2023 by Marei Peischl
|
||||
# Part of gitinfo2 package Version 2
|
||||
# Release 2.0.7 2015-11-22
|
||||
# Please read gitinfo2.pdf for licencing and other details
|
||||
# -----------------------------------------------------
|
||||
# Post-{commit,checkout,merge} hook for the gitinfo2 package
|
||||
#
|
||||
# Get the first tag found in the history from the current HEAD
|
||||
FIRSTTAG=$(git describe --tags --always --dirty='-*' 2>/dev/null)
|
||||
# Get the first tag in history that looks like a Release
|
||||
RELTAG=$(git describe --tags --long --always --dirty='-*' --match '[0-9]*.*' 2>/dev/null)
|
||||
# Hoover up the metadata
|
||||
git --no-pager log -1 --date=short --decorate=short \
|
||||
--pretty=format:"\usepackage[%
|
||||
shash={%h},
|
||||
lhash={%H},
|
||||
authname={%an},
|
||||
authemail={%ae},
|
||||
authsdate={%ad},
|
||||
authidate={%ai},
|
||||
authudate={%at},
|
||||
commname={%cn},
|
||||
commemail={%ce},
|
||||
commsdate={%cd},
|
||||
commidate={%ci},
|
||||
commudate={%ct},
|
||||
refnames={%d},
|
||||
firsttagdescribe={$FIRSTTAG},
|
||||
reltag={$RELTAG}
|
||||
]{gitexinfo}" HEAD > gitHeadInfo.gin
|
||||
157
papers/tex/markdown-wrapper.tex
Normal file
157
papers/tex/markdown-wrapper.tex
Normal file
@@ -0,0 +1,157 @@
|
||||
\newcommand\markdownRendererJekyllDataBooleanPrototype[2]{#1}
|
||||
\newcommand\markdownRendererJekyllDataEmptyPrototype[1]{#1}
|
||||
\newcommand\markdownRendererJekyllDataNumberPrototype[2]{#1}
|
||||
\newcommand\markdownRendererJekyllDataStringPrototype[2]{#1}
|
||||
\newcommand\markdownRendererJekyllDataEnd[1]{#1}
|
||||
|
||||
\RequirePackage[%
|
||||
contentBlocks,
|
||||
% debugExtensions,
|
||||
definitionLists,
|
||||
fancy_lists,
|
||||
fencedCode,
|
||||
hashEnumerators,
|
||||
inlineNotes,
|
||||
jekyllData,
|
||||
notes,
|
||||
pipeTables,
|
||||
rawAttribute,
|
||||
smartEllipses,
|
||||
strikeThrough,
|
||||
subscripts,
|
||||
superscripts,
|
||||
tableCaptions,
|
||||
taskLists,
|
||||
citations,
|
||||
tightLists=false,
|
||||
html,
|
||||
hybrid,
|
||||
relativeReferences=true,
|
||||
]{markdown}
|
||||
|
||||
\makeatletter
|
||||
|
||||
\ExplSyntaxOn
|
||||
|
||||
\iow_new:N \l_letter_csv_ior
|
||||
\tl_new:N \l_letter_csv_header_tl
|
||||
\seq_new:N \l_letter_tmp_seq
|
||||
\tl_new:N \l_letter_tmp_tl
|
||||
|
||||
\newcommand{\LoadTemplate}[1]{
|
||||
\input{template-#1.tex}
|
||||
}
|
||||
|
||||
\newcommand{\SetTemplatePreamble}[1]{%
|
||||
\gdef\TemplatePreamble{#1}
|
||||
}
|
||||
\newcommand{\SetTemplateBegin}[1]{%
|
||||
\gdef\TemplateBegin{#1}
|
||||
}
|
||||
\newcommand{\SetTemplateEnd}[1]{%
|
||||
\gdef\TemplateEnd{#1}
|
||||
}
|
||||
|
||||
\newcommand*\insertcsvdata[1]{\use:c {insertCSV#1}}
|
||||
|
||||
\newcommand*{\processCSVletter}{
|
||||
\tl_if_empty:NF \l_letter_csv_tl {
|
||||
\ior_open:Nn \l_letter_csv_ior {\l_letter_csv_tl}
|
||||
\ior_get:NN \l_letter_csv_ior \l_letter_csv_tmp_tl
|
||||
\seq_set_split:NnV \l_letter_header_seq {;} \l_letter_csv_tmp_tl
|
||||
\ior_str_map_inline:Nn \l_letter_csv_ior {
|
||||
\seq_set_split:Nnn \l_letter_tmp_seq {;} {##1}
|
||||
\int_step_variable:nNn {\seq_count:N \l_letter_tmp_seq} \l_tmpa_int {
|
||||
\cs_set:cpx {insertCSV\seq_item:Nn \l_letter_header_seq {\l_tmpa_int}} {\seq_item:Nn \l_letter_tmp_seq {\l_tmpa_int}}
|
||||
}
|
||||
\UseHook{markdownInput/begin}
|
||||
\tl_if_empty:NF \l_letter_csv_content_tl
|
||||
{\markdownInput{\l_letter_csv_content_tl}}
|
||||
\UseHook{markdownInput/end}
|
||||
}
|
||||
\ior_close:N \l_letter_csv_ior
|
||||
}
|
||||
}
|
||||
|
||||
\keys_define:nn {Markdown/Template/jekyllData} {
|
||||
unknown .code:n = {\exp_args:Nc \gdef {insert\l_keys_key_tl} {#1}},
|
||||
letter-csv .tl_set:N = \l_letter_csv_tl,
|
||||
letter-csv .initial:n = ,
|
||||
letter-content .tl_set:N = \l_letter_csv_content_tl,
|
||||
letter-content .initial:n=,
|
||||
}
|
||||
|
||||
\tl_new:N \l__markdown_sequence_tl
|
||||
|
||||
\markdownSetup{
|
||||
rendererPrototypes = {
|
||||
jekyllDataString = {\keys_set:nn {Markdown/Template/jekyllData}{{#1} = {#2}}},
|
||||
jekyllDataNumber = {\keys_set:nn {Markdown/Template/jekyllData}{{#1} = {#2}}},
|
||||
jekyllDataBoolean = {\keys_set:nn {Markdown/Template/jekyllData}{{#1} = {#2}}},
|
||||
jekyllDataEmpty = {\keys_set:nn {Markdown/Template/jekyllData}{{#1} = }},
|
||||
jekyllDataSequenceBegin = {
|
||||
\begingroup
|
||||
\renewcommand*{\markdownRendererJekyllDataString}[2]{
|
||||
\seq_if_exist:cF {g__ptxcd_#1_seq} {\seq_new:c {g__ptxcd_#1_seq}}
|
||||
\seq_gput_right:cn {g__ptxcd_#1_seq} {##2}
|
||||
}},
|
||||
jekyllDataSequenceEnd = {
|
||||
\endgroup
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
\def\insertauthor{
|
||||
\bool_set_false:N \l_tmpa_bool
|
||||
\seq_map_inline:Nn \g__ptxcd_author_seq {
|
||||
\bool_if:NTF \l_tmpa_bool {,\space} {\bool_set_true:N \l_tmpa_bool}
|
||||
\tl_if_in:nnTF {##1} {=} {
|
||||
\__ptxcd_author_afil:w ##1 \q_stop
|
||||
} {##1}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
\def\insertshortauthor{
|
||||
\seq_map_inline:Nn \g__ptxcd_author_seq {
|
||||
\keyval_parse:nn {\use:n } {\use_i:nn} {##1}
|
||||
}
|
||||
}
|
||||
|
||||
\cs_new:Npn \__ptxcd_author_afil:w #1 = #2 \q_stop {
|
||||
\tl_trim_spaces:n{#1}\thanks{\tl_trim_spaces:n {#2}}
|
||||
}
|
||||
|
||||
\renewcommand\markdownRendererJekyllDataBegin{\endgroup\markdownMakeOther}
|
||||
|
||||
\renewcommand\markdownRendererJekyllDataEnd{
|
||||
\LoadTemplate{\inserttemplate}
|
||||
\char_set_catcode_comment:N\%
|
||||
\TemplatePreamble
|
||||
\tl_if_empty:NT \l_letter_csv_tl {
|
||||
\AddToHook{markdownInput/end}{\TemplateEnd}
|
||||
\AddToHook{markdownInput/begin}{\TemplateBegin}
|
||||
}
|
||||
\begin{document}
|
||||
\UseHook{markdownInput/begin}
|
||||
\begingroup
|
||||
\char_set_catcode_other:N\%
|
||||
}
|
||||
|
||||
\NewMirroredHookPair{markdownInput/begin}{markdownInput/end}
|
||||
|
||||
\ExplSyntaxOff
|
||||
|
||||
\markdownInputPlainTeX{\MarkDownInputFile}%
|
||||
\UseHook{markdownInput/end}%
|
||||
|
||||
\markdownSetup{rendererPrototypes={
|
||||
backslash = {\\},
|
||||
}}
|
||||
|
||||
\AddToHook{markdownInput/end}{\TemplateEnd}
|
||||
\AddToHook{markdownInput/begin}{\TemplateBegin}
|
||||
|
||||
\processCSVletter
|
||||
|
||||
\end{document}
|
||||
91
papers/tex/pseudorust-lexer.py
Normal file
91
papers/tex/pseudorust-lexer.py
Normal file
@@ -0,0 +1,91 @@
|
||||
import re
|
||||
from pygments.lexers.rust import RustLexer
|
||||
from pygments.token import Error, _TokenType
|
||||
|
||||
class PseudoRustLexer(RustLexer):
|
||||
"""
|
||||
Lexer for Rust like Pseudo Code
|
||||
"""
|
||||
|
||||
name = 'PseudoRust'
|
||||
aliases = ['pseudorust']
|
||||
|
||||
"""
|
||||
Modify unprocessed tokens for string replacement without having to register a separate filter
|
||||
"""
|
||||
def get_tokens_unprocessed(self, text, stack=('root',)):
|
||||
"""
|
||||
Split ``text`` into (tokentype, text) pairs.
|
||||
|
||||
``stack`` is the initial stack (default: ``['root']``)
|
||||
"""
|
||||
replace_symbols = {
|
||||
'->' : '\U00002190',
|
||||
'<-' : '\U00002190',
|
||||
'->' : '\U00002192',
|
||||
'=>' : '\U000021d2',
|
||||
'|->' : '\U000021a6',
|
||||
'<<' : '\U0000226a',
|
||||
'>>' : '\U0000226b',
|
||||
'<=' : '\U00002264',
|
||||
'>=' : '\U00002265'
|
||||
}
|
||||
pattern = re.compile(r'(?<!\w)(' + '|'.join(re.escape(key) for key in replace_symbols.keys()) + r')(?!\w)')
|
||||
text = pattern.sub(lambda x: replace_symbols[x.group()], text)
|
||||
pos = 0
|
||||
tokendefs = self._tokens
|
||||
statestack = list(stack)
|
||||
statetokens = tokendefs[statestack[-1]]
|
||||
while 1:
|
||||
for rexmatch, action, new_state in statetokens:
|
||||
m = rexmatch(text, pos)
|
||||
if m:
|
||||
if action is not None:
|
||||
if type(action) is _TokenType:
|
||||
yield pos, action, m.group()
|
||||
else:
|
||||
yield from action(self, m)
|
||||
pos = m.end()
|
||||
if new_state is not None:
|
||||
# state transition
|
||||
if isinstance(new_state, tuple):
|
||||
for state in new_state:
|
||||
if state == '#pop':
|
||||
if len(statestack) > 1:
|
||||
statestack.pop()
|
||||
elif state == '#push':
|
||||
statestack.append(statestack[-1])
|
||||
else:
|
||||
statestack.append(state)
|
||||
elif isinstance(new_state, int):
|
||||
# pop, but keep at least one state on the stack
|
||||
# (random code leading to unexpected pops should
|
||||
# not allow exceptions)
|
||||
if abs(new_state) >= len(statestack):
|
||||
del statestack[1:]
|
||||
else:
|
||||
del statestack[new_state:]
|
||||
elif new_state == '#push':
|
||||
statestack.append(statestack[-1])
|
||||
else:
|
||||
assert False, "wrong state def: %r" % new_state
|
||||
statetokens = tokendefs[statestack[-1]]
|
||||
break
|
||||
else:
|
||||
# We are here only if all state tokens have been considered
|
||||
# and there was not a match on any of them.
|
||||
try:
|
||||
if text[pos] == '\n':
|
||||
# at EOL, reset state to "root"
|
||||
statestack = ['root']
|
||||
statetokens = tokendefs['root']
|
||||
yield pos, Whitespace, '\n'
|
||||
pos += 1
|
||||
continue
|
||||
yield pos, Error, text[pos]
|
||||
pos += 1
|
||||
except IndexError:
|
||||
break
|
||||
|
||||
|
||||
|
||||
113
papers/tex/rosenpass.pygstyle
Normal file
113
papers/tex/rosenpass.pygstyle
Normal file
@@ -0,0 +1,113 @@
|
||||
|
||||
\makeatletter
|
||||
\def\PYG@reset{\let\PYG@it=\relax \let\PYG@bf=\relax%
|
||||
\let\PYG@ul=\relax \let\PYG@tc=\relax%
|
||||
\let\PYG@bc=\relax \let\PYG@ff=\relax}
|
||||
\def\PYG@tok#1{\csname PYG@tok@#1\endcsname}
|
||||
\def\PYG@toks#1+{\ifx\relax#1\empty\else%
|
||||
\PYG@tok{#1}\expandafter\PYG@toks\fi}
|
||||
\def\PYG@do#1{\PYG@bc{\PYG@tc{\PYG@ul{%
|
||||
\PYG@it{\PYG@bf{\PYG@ff{#1}}}}}}}
|
||||
\def\PYG#1#2{\PYG@reset\PYG@toks#1+\relax+\PYG@do{#2}}
|
||||
|
||||
%\definecolor{rosenpass-pink}{RGB}{247, 4, 132}
|
||||
%\definecolor{rosenpass-orange}{RGB}{255, 166, 48}
|
||||
%\definecolor{rosenpass-gray}{RGB}{64, 63, 76}
|
||||
%\definecolor{rosenpass-lightblue}{RGB}{211, 243, 238}
|
||||
%\definecolor{rosenpass-blue}{RGB}{114, 161, 229}
|
||||
|
||||
\colorlet{rosenpass-comment}{rosenpass-gray!80}
|
||||
\colorlet{rosenpass-string}{rosenpass-pink}
|
||||
\colorlet{rosenpass-name}{rosenpass-blue}
|
||||
\colorlet{rosenpass-name-dark}{rosenpass-blue!75!black}
|
||||
|
||||
\@namedef{PYG@tok@w}{\def\PYG@tc##1{\textcolor[rgb]{0.73,0.73,0.73}{##1}}}
|
||||
\@namedef{PYG@tok@c}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor{rosenpass-comment}{##1}}}
|
||||
\@namedef{PYG@tok@cp}{\def\PYG@tc##1{\textcolor[rgb]{0.61,0.40,0.00}{##1}}}%unknown
|
||||
\@namedef{PYG@tok@k}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor{rosenpass-name-dark}{##1}}}
|
||||
\@namedef{PYG@tok@kp}{\def\PYG@tc##1{\textcolor{rosenpass-name-dark}{##1}}}
|
||||
\@namedef{PYG@tok@kt}{\def\PYG@tc##1{\textcolor[rgb]{0.69,0.00,0.25}{##1}}}%unknown
|
||||
\@namedef{PYG@tok@o}{\def\PYG@tc##1{\textcolor{rosenpass-gray}{##1}}}
|
||||
\@namedef{PYG@tok@ow}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
|
||||
\@namedef{PYG@tok@nb}{\def\PYG@tc##1{\textcolor{rosenpass-name-dark}{##1}}}
|
||||
% function
|
||||
\@namedef{PYG@tok@nf}{\def\PYG@tc##1{\textcolor{rosenpass-name}{##1}}}
|
||||
\@namedef{PYG@tok@nc}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor{rosenpass-name}{##1}}}
|
||||
\@namedef{PYG@tok@nn}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor{rosenpass-name}{##1}}}
|
||||
\@namedef{PYG@tok@ne}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor{rosenpass-string}{##1}}}% string color
|
||||
\@namedef{PYG@tok@nv}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
|
||||
\@namedef{PYG@tok@no}{\def\PYG@tc##1{\textcolor[rgb]{0.53,0.00,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@nl}{\def\PYG@tc##1{\textcolor[rgb]{0.46,0.46,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@ni}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.44,0.44,0.44}{##1}}}
|
||||
\@namedef{PYG@tok@na}{\def\PYG@tc##1{\textcolor[rgb]{0.41,0.47,0.13}{##1}}}
|
||||
\@namedef{PYG@tok@nt}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor{rosenpass-name-dark}{##1}}}
|
||||
\@namedef{PYG@tok@nd}{\def\PYG@tc##1{\textcolor[rgb]{0.67,0.13,1.00}{##1}}}
|
||||
\@namedef{PYG@tok@s}{\def\PYG@tc##1{\textcolor{rosenpass-string}{##1}}}
|
||||
\@namedef{PYG@tok@sd}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor{rosenpass-string}{##1}}}
|
||||
\@namedef{PYG@tok@si}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.64,0.35,0.47}{##1}}}
|
||||
\@namedef{PYG@tok@se}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.67,0.36,0.12}{##1}}}
|
||||
\@namedef{PYG@tok@sr}{\def\PYG@tc##1{\textcolor[rgb]{0.64,0.35,0.47}{##1}}}
|
||||
\@namedef{PYG@tok@ss}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
|
||||
\@namedef{PYG@tok@sx}{\def\PYG@tc##1{\textcolor{rosenpass-name-dark}{##1}}}
|
||||
\@namedef{PYG@tok@m}{\def\PYG@tc##1{\textcolor{rosenpass-gray}{##1}}}
|
||||
\@namedef{PYG@tok@gh}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
|
||||
\@namedef{PYG@tok@gu}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.50,0.00,0.50}{##1}}}
|
||||
\@namedef{PYG@tok@gd}{\def\PYG@tc##1{\textcolor[rgb]{0.63,0.00,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@gi}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.52,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@gr}{\def\PYG@tc##1{\textcolor[rgb]{0.89,0.00,0.00}{##1}}}
|
||||
\@namedef{PYG@tok@ge}{\let\PYG@it=\textit}
|
||||
\@namedef{PYG@tok@gs}{\let\PYG@bf=\textbf}
|
||||
\@namedef{PYG@tok@gp}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor[rgb]{0.00,0.00,0.50}{##1}}}
|
||||
\@namedef{PYG@tok@go}{\def\PYG@tc##1{\textcolor[rgb]{0.44,0.44,0.44}{##1}}}
|
||||
\@namedef{PYG@tok@gt}{\def\PYG@tc##1{\textcolor[rgb]{0.00,0.27,0.87}{##1}}}
|
||||
\@namedef{PYG@tok@err}{\def\PYG@bc##1{##1}}
|
||||
\@namedef{PYG@tok@kc}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor{rosenpass-name-dark}{##1}}}
|
||||
\@namedef{PYG@tok@kd}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor{rosenpass-name-dark}{##1}}}
|
||||
\@namedef{PYG@tok@kn}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor{rosenpass-name-dark}{##1}}}
|
||||
\@namedef{PYG@tok@kr}{\let\PYG@bf=\textbf\def\PYG@tc##1{\textcolor{rosenpass-name-dark}{##1}}}
|
||||
\@namedef{PYG@tok@bp}{\def\PYG@tc##1{\textcolor{rosenpass-name-dark}{##1}}}
|
||||
\@namedef{PYG@tok@fm}{\def\PYG@tc##1{\textcolor{rosenpass-name}{##1}}}
|
||||
\@namedef{PYG@tok@vc}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
|
||||
\@namedef{PYG@tok@vg}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
|
||||
\@namedef{PYG@tok@vi}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
|
||||
\@namedef{PYG@tok@vm}{\def\PYG@tc##1{\textcolor[rgb]{0.10,0.09,0.49}{##1}}}
|
||||
\@namedef{PYG@tok@sa}{\def\PYG@tc##1{\textcolor{rosenpass-string}{##1}}}
|
||||
\@namedef{PYG@tok@sb}{\def\PYG@tc##1{\textcolor{rosenpass-string}{##1}}}
|
||||
\@namedef{PYG@tok@sc}{\def\PYG@tc##1{\textcolor{rosenpass-string}{##1}}}
|
||||
\@namedef{PYG@tok@dl}{\def\PYG@tc##1{\textcolor{rosenpass-string}{##1}}}
|
||||
\@namedef{PYG@tok@s2}{\def\PYG@tc##1{\textcolor{rosenpass-string}{##1}}}
|
||||
\@namedef{PYG@tok@sh}{\def\PYG@tc##1{\textcolor{rosenpass-string}{##1}}}
|
||||
\@namedef{PYG@tok@s1}{\def\PYG@tc##1{\textcolor{rosenpass-string}{##1}}}
|
||||
\@namedef{PYG@tok@mb}{\def\PYG@tc##1{\textcolor{rosenpass-gray}{##1}}}
|
||||
\@namedef{PYG@tok@mf}{\def\PYG@tc##1{\textcolor{rosenpass-gray}{##1}}}
|
||||
\@namedef{PYG@tok@mh}{\def\PYG@tc##1{\textcolor{rosenpass-gray}{##1}}}
|
||||
\@namedef{PYG@tok@mi}{\def\PYG@tc##1{\textcolor{rosenpass-gray}{##1}}}
|
||||
\@namedef{PYG@tok@il}{\def\PYG@tc##1{\textcolor{rosenpass-gray}{##1}}}
|
||||
\@namedef{PYG@tok@mo}{\def\PYG@tc##1{\textcolor{rosenpass-gray}{##1}}}
|
||||
\@namedef{PYG@tok@ch}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor{rosenpass-comment}{##1}}}
|
||||
\@namedef{PYG@tok@cm}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor{rosenpass-comment}{##1}}}
|
||||
\@namedef{PYG@tok@cpf}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor{rosenpass-comment}{##1}}}
|
||||
\@namedef{PYG@tok@c1}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor{rosenpass-comment}{##1}}}
|
||||
\@namedef{PYG@tok@cs}{\let\PYG@it=\textit\def\PYG@tc##1{\textcolor{rosenpass-comment}{##1}}}
|
||||
|
||||
\def\PYGZbs{\char`\\}
|
||||
\def\PYGZus{\char`\_}
|
||||
\def\PYGZob{\char`\{}
|
||||
\def\PYGZcb{\char`\}}
|
||||
\def\PYGZca{\char`\^}
|
||||
\def\PYGZam{\char`\&}
|
||||
\def\PYGZlt{\char`\<}
|
||||
\def\PYGZgt{\char`\>}
|
||||
\def\PYGZsh{\char`\#}
|
||||
\def\PYGZpc{\char`\%}
|
||||
\def\PYGZdl{\char`\$}
|
||||
\def\PYGZhy{\char`\-}
|
||||
\def\PYGZsq{\char`\'}
|
||||
\def\PYGZdq{\char`\"}
|
||||
\def\PYGZti{\char`\~}
|
||||
% for compatibility with earlier versions
|
||||
\def\PYGZat{@}
|
||||
\def\PYGZlb{[}
|
||||
\def\PYGZrb{]}
|
||||
\makeatother
|
||||
|
||||
115
papers/tex/template-acmccs.tex
Normal file
115
papers/tex/template-acmccs.tex
Normal file
@@ -0,0 +1,115 @@
|
||||
\RequirePackage{fontspec}
|
||||
\csname disable@package@load\endcsname {fontenc}{}
|
||||
\csname disable@package@load\endcsname {libertine}{}
|
||||
\csname disable@package@load\endcsname {zi4}{}
|
||||
\csname disable@package@load\endcsname {newtxmath}{}
|
||||
|
||||
\documentclass[sigconf, anonymous,natbib=false]{acmart}
|
||||
|
||||
%TODO: add different modes, current setup from ACM CCS template
|
||||
\fancyhf{} % Remove fancy page headers
|
||||
\fancyhead[C]{Anonymous submission \#9999 to ACM CCS 2019} % TODO: replace 9999 with your paper number
|
||||
\fancyfoot[C]{\thepage}
|
||||
|
||||
\setcopyright{none} % No copyright notice required for submissions
|
||||
\acmConference[Anonymous Submission to ACM CCS 2019]{ACM Conference on Computer and Communications Security}{Due 15 May 2019}{London, TBD}
|
||||
\acmYear{2019}
|
||||
|
||||
\settopmatter{printacmref=false, printccs=true, printfolios=true} % We want page numbers on submissions
|
||||
%%%%%%
|
||||
|
||||
%Fallback definitions due to bad font choice in amsart
|
||||
\ifPDFTeX
|
||||
\DeclareUnicodeCharacter{2225}{\cat}
|
||||
\DeclareUnicodeCharacter{2264}{\ensuremath{\leq}}
|
||||
\DeclareUnicodeCharacter{2205}{\ensuremath{\varnothing}}
|
||||
\DeclareUnicodeCharacter{2212}{\ensuremath{-}}
|
||||
\fi
|
||||
|
||||
\makeatletter
|
||||
\def\@currentauthors{}
|
||||
\makeatother
|
||||
|
||||
\ExplSyntaxOn
|
||||
\hook_gput_code:nnn {cmd/markdownInput/before} {space-to-newline} {
|
||||
\hook_gput_code:nnn {env/aligned/begin}{space-to-newline}{\def\ {\\}}
|
||||
\hook_gput_code:nnn {env/align/begin}{space-to-newline}{\def\ {\\}}
|
||||
}
|
||||
|
||||
\hook_gput_code:nnn {cmd/markdownInput/after} {space-to-newline} {
|
||||
\hook_gremove_code:nn {env/aligned/begin} {space-to-newline}
|
||||
\hook_gremove_code:nn {env/align/begin} {space-to-newline}
|
||||
}
|
||||
\ExplSyntaxOff
|
||||
|
||||
\usepackage{minted}
|
||||
\markdownSetup{
|
||||
renderers={inputVerbatim=\inputminted[breaklines]{text}{#1}},
|
||||
}
|
||||
|
||||
\usepackage{libertinus}
|
||||
%font fallback
|
||||
\directlua{luaotfload.add_fallback
|
||||
("codefallback",
|
||||
{"NotoSansMono:mode=harf"}
|
||||
)}
|
||||
|
||||
\makeatletter
|
||||
\setmonofont{LibertinusMono}[
|
||||
RawFeature = {\libertinus@figurealign; \libertinus@figurestyle},
|
||||
Scale = \libertinusTT@scale,
|
||||
FakeStretch = \libertinusTT@stretch,
|
||||
UprightFont = *-Regular,
|
||||
ItalicFont = *-Regular,
|
||||
ItalicFeatures = {FakeSlant=0.2},
|
||||
SlantedFont = *-Regular,
|
||||
SlantedFeatures= {FakeSlant=0.2},
|
||||
BoldFont = *-Regular,
|
||||
BoldFeatures = {RawFeature={embolden=3}},
|
||||
BoldItalicFont = *-Regular,
|
||||
BoldItalicFeatures={FakeSlant=0.2,RawFeature={embolden=3}},
|
||||
Extension = .otf,
|
||||
RawFeature={fallback=codefallback}
|
||||
]
|
||||
\makeatother
|
||||
|
||||
\RequirePackage{unicode-math}
|
||||
|
||||
\RequirePackage[
|
||||
datamodel=acmdatamodel,
|
||||
style=acmnumeric, % use style=acmauthoryear for publications that require it
|
||||
]{biblatex}
|
||||
|
||||
\addbibresource{references.bib}
|
||||
|
||||
\SetTemplatePreamble{
|
||||
}
|
||||
|
||||
\SetTemplateBegin{
|
||||
% \maketitle
|
||||
\title{\inserttitle}
|
||||
|
||||
\begin{abstract}
|
||||
\insertabstract
|
||||
\end{abstract}
|
||||
|
||||
%%% TODO: replace this section with code generated by the tool at https://dl.acm.org/ccs.cfm
|
||||
%\begin{CCSXML}
|
||||
% <ccs2012>
|
||||
% <concept>
|
||||
% <concept_id>10002978.10003029.10011703</concept_id>
|
||||
% <concept_desc>Security and privacy~Usability in security and privacy</concept_desc>
|
||||
% <concept_significance>500</concept_significance>
|
||||
% </concept>
|
||||
% </ccs2012>
|
||||
%\end{CCSXML}
|
||||
|
||||
\ccsdesc{Security and privacy~Use https://dl.acm.org/ccs.cfm to generate actual concepts section for your paper}
|
||||
% -- end of section to replace with generated code
|
||||
|
||||
\keywords{template; formatting; pickling} % TODO: replace with your keywords
|
||||
|
||||
}
|
||||
|
||||
\SetTemplateEnd{
|
||||
}
|
||||
402
papers/tex/template-rosenpass.tex
Normal file
402
papers/tex/template-rosenpass.tex
Normal file
@@ -0,0 +1,402 @@
|
||||
\documentclass[english,abstract=true]{scrartcl}
|
||||
\usepackage{amssymb}
|
||||
\usepackage{mathtools}
|
||||
\usepackage{fontspec}
|
||||
|
||||
%font fallback
|
||||
\directlua{luaotfload.add_fallback
|
||||
("codefallback",
|
||||
{"NotoSansMono:mode=harf"}
|
||||
)}
|
||||
|
||||
\ExplSyntaxOn
|
||||
\makeatletter
|
||||
\setmonofont{NotoSansMono}[Scale=.9]
|
||||
|
||||
\setsansfont{Nunito}
|
||||
\renewcommand*{\familydefault}{\sfdefault}
|
||||
|
||||
\usepackage{unicode-math}
|
||||
|
||||
\hook_gput_code:nnn {cmd/markdownInput/before} {space-to-newline} {
|
||||
\hook_gput_code:nnn {env/aligned/begin}{space-to-newline}{\def\ {\\}}
|
||||
\hook_gput_code:nnn {env/align/begin}{space-to-newline}{\def\ {\\}}
|
||||
}
|
||||
|
||||
\hook_gput_code:nnn {cmd/markdownInput/after} {space-to-newline} {
|
||||
\hook_gremove_code:nn {env/aligned/begin} {space-to-newline}
|
||||
\hook_gremove_code:nn {env/align/begin} {space-to-newline}
|
||||
}
|
||||
|
||||
|
||||
\usepackage{minted}
|
||||
|
||||
\setminted{bgcolor=rosenpass-gray!20,breaklines}
|
||||
|
||||
\usemintedstyle{../tex/rosenpass}
|
||||
|
||||
\markdownSetup{
|
||||
renderers={
|
||||
inputVerbatim=\inputminted[breaklines]{text}{#1},
|
||||
inputFencedCode = {
|
||||
\if_predicate:w \tl_if_empty_p:n {#2}
|
||||
\catcode`\#=6\relax
|
||||
\inputminted{text}{#1}%
|
||||
\catcode`\#=12\relax
|
||||
\else:
|
||||
\catcode`\#=6\relax
|
||||
\inputminted{#2}{#1}%
|
||||
\catcode`\#=12\relax
|
||||
\fi:
|
||||
\AddToHookNext{para/begin}{\para_omit_indent:}
|
||||
},%
|
||||
headingOne={\__ptxcd_split_link_heading:nn {section} {#1}},
|
||||
headingTwo={\__ptxcd_split_link_heading:nn {subsection} {#1}},
|
||||
headingThree={\__ptxcd_split_link_heading:nn {subsubsection} {#1}},
|
||||
headingFour={\__ptxcd_split_link_heading:nn {paragraph} {#1}},
|
||||
headingFive={\__ptxcd_split_link_heading:nn {subparagraph} {#1}},
|
||||
ulEnd={\end{itemize} \AddToHookNext{para/begin}{\para_omit_indent:}},
|
||||
olEnd={\end{enumerate} \AddToHookNext{para/begin}{\para_omit_indent:}},
|
||||
image={
|
||||
\tl_set:Nn \l_tmpa_tl {#2}
|
||||
\regex_replace_once:nnN {\.[a-z]+\Z} {} \l_tmpa_tl
|
||||
\exp_args:NnV \__ptxcd_image:nn {#1} \l_tmpa_tl}
|
||||
}
|
||||
}
|
||||
|
||||
\cs_new:Nn \__ptxcd_split_link_heading:nn {
|
||||
\regex_split:nnNTF {\s*\cB\{\#(.+)\cE\}} {#2} \l_tmpa_seq {
|
||||
\exp_args:Nnx \use:c {#1} {\seq_item:Nn \l_tmpa_seq {1}}
|
||||
\label{\seq_item:Nn \l_tmpa_seq {2}}
|
||||
} {
|
||||
\use:c {#1} {#2}
|
||||
}
|
||||
}
|
||||
|
||||
\def\minted@opt@quote#1{
|
||||
\if_predicate:w \str_if_eq_p:nn { #1 } { pseudorust }
|
||||
tex/pseudorust-lexer.py:PseudoRustLexer~-x
|
||||
\else:
|
||||
\if_predicate:w \str_if_eq_p:nn { #1 } { cryptoverif }
|
||||
tex/cryptoverif-lexer.py:CryptoVerifLexer~-x
|
||||
\else:
|
||||
#1
|
||||
\fi:
|
||||
\fi:
|
||||
}
|
||||
\ExplSyntaxOff
|
||||
|
||||
\RedeclareSectionCommands[afterindent=false,runin=false,beforeskip=.5\baselineskip,afterskip=0pt,indent=0pt]{paragraph,subparagraph}
|
||||
|
||||
\IfFileExists{gitHeadInfo.gin}{\providecommand*{\GI@githeadinfo@file}{gitHeadInfo.gin}}{}
|
||||
\RequirePackage{gitinfo2}
|
||||
|
||||
\AddToHook{env/description/after}{
|
||||
\AddToHookNext{para/begin}{\OmitIndent}
|
||||
}
|
||||
|
||||
\AddToHook{env/itemize/after}{
|
||||
\AddToHookNext{para/begin}{\OmitIndent}
|
||||
}
|
||||
|
||||
\makeatother
|
||||
|
||||
|
||||
\usepackage{xcolor}
|
||||
|
||||
\definecolor{rosenpass-pink}{RGB}{247, 4, 132}
|
||||
\definecolor{rosenpass-orange}{RGB}{255, 166, 48}
|
||||
\definecolor{rosenpass-gray}{RGB}{64, 63, 76}
|
||||
\definecolor{rosenpass-lightblue}{RGB}{211, 243, 238}
|
||||
\definecolor{rosenpass-blue}{RGB}{114, 161, 229}
|
||||
|
||||
\usepackage{scrlayer-scrpage}
|
||||
\cfoot[]{}
|
||||
\ohead[]{\pagemark}
|
||||
|
||||
\ExplSyntaxOn
|
||||
|
||||
\ofoot[\__ptxcd_version_info:]{\__ptxcd_version_info:}
|
||||
\ifoot[\footnotesize\doclicenseText]{}
|
||||
|
||||
\ModifyLayers[nonfloatpage]{scrheadings.head.oneside}
|
||||
\ModifyLayers[nonfloatpage]{scrheadings.foot.oneside}
|
||||
|
||||
|
||||
\box_new:N \g__ptxcd_labelitemi_box
|
||||
\hbox_gset:Nn \g__ptxcd_labelitemi_box {\raisebox{.15\baselineskip}{\tiny$\blacktriangleright$}}
|
||||
|
||||
\cs_new:Nn \__ptxcd_version_info: {
|
||||
\bool_set_false:N \l_tmpa_bool
|
||||
\gitAbbrevHash{}~(\gitAuthorDate
|
||||
\clist_map_inline:Nn \gitTags {
|
||||
\exp_args:Nx \str_if_eq:nnT {\jobname-release} {test-whitepaper} {\bool_set_true:N \l_tmpa_bool\clist_map_break:}
|
||||
}
|
||||
\bool_if:NF \l_tmpa_bool {~--~draft}
|
||||
)
|
||||
}
|
||||
|
||||
\renewcommand*{\labelitemi}{\box_use:N \g__ptxcd_labelitemi_box}
|
||||
\ExplSyntaxOff
|
||||
|
||||
\usepackage[hidelinks]{hyperref}
|
||||
\usepackage{babel}
|
||||
|
||||
\RequirePackage[
|
||||
datamodel=acmdatamodel,
|
||||
style=numeric-comp, % use style=acmauthoryear for publications that require it
|
||||
backref=true,
|
||||
maxbibnames=999
|
||||
]{biblatex}
|
||||
|
||||
\DeclareFieldFormat{url}{\url{#1}}
|
||||
|
||||
\let\bibliofont\relax
|
||||
\addbibresource{references.bib}
|
||||
|
||||
\renewcommand*{\titlepagestyle}{plain}
|
||||
|
||||
\usepackage{tikz}
|
||||
\usetikzlibrary{decorations.pathreplacing}
|
||||
|
||||
\makeatletter
|
||||
\disable@package@load{csquotes}{\newcommand*{\enquote}[1]{“##1”}}
|
||||
\makeatother
|
||||
\usepackage[
|
||||
type={CC},
|
||||
modifier={by-sa},
|
||||
version={4.0},
|
||||
]{doclicense}
|
||||
|
||||
\ExplSyntaxOn
|
||||
\SetTemplatePreamble{
|
||||
\hypersetup{pdftitle=\inserttitle,pdfauthor=The~Rosenpass~Project}
|
||||
\title{\vspace*{-2.5cm}\includegraphics[width=4cm]{RosenPass-Logo}}
|
||||
\author{\csname insertauthor\endcsname}
|
||||
\subject{\csname insertsubject\endcsname}
|
||||
\date{\vspace{-1cm}}
|
||||
}
|
||||
\ExplSyntaxOff
|
||||
|
||||
%namepartpicturesetup
|
||||
\ExplSyntaxOn
|
||||
\int_new:N \l__ptxcd_namepart_int
|
||||
\fp_new:N \l__ptxcd_namepos_fp
|
||||
\def\namepartsep{1.4}
|
||||
\dim_new:N \l__ptxcd_namepart_sep_dim
|
||||
\dim_set:Nn \l__ptxcd_namepart_sep_dim {7mm}
|
||||
|
||||
\newcommand*{\namepart}[2][0]{
|
||||
\int_set:Nn \l__ptxcd_namepart_int {\clist_count:n {#2}}
|
||||
\begin{scope}[xshift=#1]
|
||||
\fp_set:Nn \l__ptxcd_namepos_fp {\l__ptxcd_namepart_int / 2}
|
||||
\keyval_parse:nnn {\__ptxcd_namepart_item:nn {}}{ \__ptxcd_namepart_item:nn } {#2}
|
||||
\end{scope}
|
||||
}
|
||||
|
||||
\newcommand*{\SingleNamePart}[4][0]{
|
||||
\node[rounded~corners,fill=rosenpass-lightblue] (#2) at (#1,-.7) {\ttfamily#3};
|
||||
\node[above] at (#2.north) {\footnotesize #4};
|
||||
}
|
||||
|
||||
\cs_new:Nn \__ptxcd_namepart_item:nn {
|
||||
\fp_sub:Nn \l__ptxcd_namepos_fp {1}
|
||||
\node[rounded~corners,fill=rosenpass-lightblue] (#1) at (0,\fp_use:N \l__ptxcd_namepos_fp * \namepartsep) {\ttfamily#1};
|
||||
\node[above] at (#1.north) {\footnotesize #2};
|
||||
}
|
||||
|
||||
\newenvironment{namepartpicture}{\par\medskip\begin{tikzpicture}}{\end{tikzpicture}\par\medskip\csname @afterheading\endcsname\AddToHookNext{para/begin}{\para_omit_indent:}}
|
||||
|
||||
\newcommand*{\namebraceleft}[2] {
|
||||
\draw[decorate]([xshift=-\l__ptxcd_namepart_sep_dim]#2.south~west)--([xshift=-\l__ptxcd_namepart_sep_dim]#1.north~west) ;
|
||||
}
|
||||
|
||||
\newcommand*{\namebraceright}[2]{
|
||||
\draw[decorate]([xshift=\l__ptxcd_namepart_sep_dim]#1.north~east) --([xshift=\l__ptxcd_namepart_sep_dim]#2.south~east);
|
||||
}
|
||||
|
||||
|
||||
%captions
|
||||
\makeatletter
|
||||
\renewcommand{\scr@makemultilinecaption}[3]{
|
||||
\colorbox{rosenpass-gray}{
|
||||
\parbox{\dim_eval:n {\linewidth-2\fboxsep}}{
|
||||
{
|
||||
\usekomafont{caption}
|
||||
{\usekomafont{captionlabel}#2}
|
||||
#3}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
\newlength{\saved@textwidth}
|
||||
|
||||
\keys_define:nn {ptxcd/setup-image} {
|
||||
landscape .bool_set:N = \l__ptxcd_image_landscape_bool,
|
||||
landscape .initial:n = false,
|
||||
landcsape .default:n = true,
|
||||
fullpage .bool_set:N = \l__ptxcd_image_fullpage_bool,
|
||||
fullpage .initial:n = false,
|
||||
fullpage .default:n = true,
|
||||
label .tl_set:N = \l__ptxcd_image_label_tl,
|
||||
label .initial:n =,
|
||||
width .dim_set:N = \l__ptxcd_image_width_dim,
|
||||
width .initial:n = \c_zero_dim
|
||||
}
|
||||
|
||||
\newcommand*{\setupimage}[1]{
|
||||
\keys_set:nn {ptxcd/setup-image} {
|
||||
#1
|
||||
}
|
||||
}
|
||||
|
||||
\RequirePackage{rotating}
|
||||
|
||||
\newlength\RemainingPageSidewaysObjectWidth
|
||||
|
||||
\def\@RemainingPageSidewaysObject#1{
|
||||
\setlength{\RemainingPageSidewaysObjectWidth}{\dimexpr\pagegoal-\pagetotal-2\baselineskip}
|
||||
\setlength{\saved@textwidth}{\textwidth}
|
||||
\begin{lrbox}\rot@float@box
|
||||
\begin{minipage}{\RemainingPageSidewaysObjectWidth}%
|
||||
\def\@captype{#1}%
|
||||
}
|
||||
\def\end@RemainingPageSidewaysObject{
|
||||
\end{minipage}\end{lrbox}%
|
||||
\stepcounter{r@tfl@t}%
|
||||
\rot@label{RF\ther@tfl@t}%
|
||||
\rot@pageref{RF\ther@tfl@t}{\R@@page}%
|
||||
\vfill
|
||||
\vbox to \RemainingPageSidewaysObjectWidth {%
|
||||
\setkeys{Grot}{units=360}%
|
||||
\if@rot@twoside
|
||||
\else
|
||||
\let\R@@page\rot@LR
|
||||
\fi
|
||||
\ifthenelse{\isodd{\R@@page}}{%
|
||||
\if@rot@twoside
|
||||
\rot@mess@toks\expandafter{\the\rot@mess@toks (right hand page)}%
|
||||
\fi
|
||||
\vfill
|
||||
\@@line{%
|
||||
\hskip\rotFPtop
|
||||
\rotatebox{90}{\box\rot@float@box}%
|
||||
\hskip\rotFPbot
|
||||
}%
|
||||
}{%
|
||||
\if@rot@twoside
|
||||
\rot@mess@toks\expandafter{\the\rot@mess@toks (left hand page)}%
|
||||
\fi
|
||||
\@@line{%
|
||||
\hskip\rotFPbot
|
||||
\rotatebox{-90}{\box\rot@float@box}%
|
||||
\hskip\rotFPtop
|
||||
}%
|
||||
\vfill
|
||||
}%
|
||||
\rot@message{\the\rot@mess@toks}
|
||||
}%
|
||||
}
|
||||
|
||||
\newenvironment{RemainingPageSidewaysTable}{\@RemainingPageSidewaysObject{table}}{\end@RemainingPageSidewaysObject}
|
||||
\newenvironment{RemainingPageSidewaysFigure}{\@RemainingPageSidewaysObject{figure}}{\end@RemainingPageSidewaysObject}
|
||||
|
||||
|
||||
\cs_new:Nn \__ptxcd_image:nn {
|
||||
\bool_if:NTF \l__ptxcd_image_landscape_bool {
|
||||
\setlength{\saved@textwidth}{\textwidth}
|
||||
\bool_if:NTF \l__ptxcd_image_fullpage_bool {
|
||||
\begin{sidewaysfigure}
|
||||
\begingroup
|
||||
\let\par\relax
|
||||
{\raisebox{-\height}{\includegraphics[height=\saved@textwidth]{#2}}}
|
||||
\makebox[.3\linewidth][l]{\quad
|
||||
\begin{turn}{-90}
|
||||
\captionof{figure}{#1}
|
||||
\tl_if_empty:NF \l__ptxcd_image_label_tl {\exp_args:NV \label \l__ptxcd_image_label_tl}
|
||||
\end{turn}}
|
||||
\endgroup
|
||||
\AddToHookNext{shipout/after}{
|
||||
\AddToHookNext{shipout/before}{\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate~90}}
|
||||
\AddToHookNext{shipout/after}{\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate~0}}
|
||||
}
|
||||
\end{sidewaysfigure}
|
||||
}{
|
||||
\begin{RemainingPageSidewaysFigure}
|
||||
\thispagestyle{empty}
|
||||
\begingroup
|
||||
\let\par\relax
|
||||
\raisebox{-\height}{\includegraphics[height=\saved@textwidth]{#2}}\quad
|
||||
\rlap{
|
||||
\begin{turn}{-90}
|
||||
\captionof{figure}{#1}\tl_if_empty:NF \l__ptxcd_image_label_tl {\exp_args:NV \label \l__ptxcd_image_label_tl}
|
||||
\end{turn}}
|
||||
\endgroup
|
||||
\end{RemainingPageSidewaysFigure}
|
||||
}
|
||||
} {
|
||||
\dim_compare:nNnT {\l__ptxcd_image_width_dim} = {\c_zero_dim} {\dim_set:Nn \l__ptxcd_image_width_dim {\linewidth}}
|
||||
\captionof{figure}{#1\tl_if_empty:NF \l__ptxcd_image_label_tl {\exp_args:NV \label \l__ptxcd_image_label_tl}}\addvspace{1ex}\@afterheading
|
||||
\centerline{\includegraphics[width=\dim_use:N \l__ptxcd_image_width_dim ]{#2}}
|
||||
}
|
||||
\bool_gset_false:N \l__ptxcd_image_landscape_bool
|
||||
\bool_gset_false:N \l__ptxcd_image_fullpage_bool
|
||||
\tl_clear:N \l__ptxcd_image_label_tl
|
||||
\dim_zero:N \l__ptxcd_image_width_dim
|
||||
}
|
||||
|
||||
\setkomafont{caption}{\color{white}}
|
||||
\setkomafont{captionlabel}{}
|
||||
|
||||
\renewcommand*{\@makecaption}[2]{
|
||||
\bool_if:NTF \l__ptxcd_image_landscape_bool
|
||||
{
|
||||
\captionbox{
|
||||
\parbox{\dim_eval:n {\saved@textwidth-2\fboxsep}}{
|
||||
\centering
|
||||
{
|
||||
\usekomafont{caption}
|
||||
{\usekomafont{captionlabel}#1\captionformat}
|
||||
#2}
|
||||
\par
|
||||
}
|
||||
}
|
||||
}
|
||||
{\captionbox{\parbox{\dim_eval:n {\linewidth-2\fboxsep}}{
|
||||
\centering
|
||||
{
|
||||
\usekomafont{caption}
|
||||
{\usekomafont{captionlabel}#1\captionformat}
|
||||
#2}
|
||||
\par
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
\makeatother
|
||||
\ExplSyntaxOff
|
||||
% end of namepartpicturesetup
|
||||
|
||||
\newcommand{\captionbox}[1]{{\setlength{\fboxsep}{.5ex}\colorbox{rosenpass-gray}{#1}}}
|
||||
|
||||
\makeatletter
|
||||
\renewenvironment{abstract}{
|
||||
\small
|
||||
\begin{center}\normalfont\sectfont\nobreak\abstractname\@endparpenalty\@M\end{center}%
|
||||
}{
|
||||
\par
|
||||
}
|
||||
\makeatother
|
||||
|
||||
\SetTemplateBegin{
|
||||
\maketitle
|
||||
\begin{abstract}
|
||||
\noindent\csname insertabstract\endcsname
|
||||
\end{abstract}
|
||||
\tableofcontents
|
||||
\clearpage
|
||||
}
|
||||
|
||||
\SetTemplateEnd{
|
||||
}
|
||||
Reference in New Issue
Block a user