diff --git a/.github/workflows/build_paper.yml b/.github/workflows/build_paper.yml index fa25d74..ac30341 100644 --- a/.github/workflows/build_paper.yml +++ b/.github/workflows/build_paper.yml @@ -16,20 +16,21 @@ jobs: build: # The type of runner that the job will run on runs-on: ubuntu-latest - container: - # Most recent version of texlive image has broken minted/pygments - image: ghcr.io/xu-cheng/texlive-full:20221101 # Steps represent a sequence of tasks that will be executed as part of the job steps: # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - uses: actions/checkout@v3 + - name: Compile draft - run: | - latexmk -shell-escape -pdf draft + uses: xu-cheng/latex-action@master + with: + root_file: draft.tex + - name: Compile paper - run: | - latexmk -shell-escape -pdf paper + uses: xu-cheng/latex-action@master + with: + root_file: paper.tex - name: Format Python files with yapf id: autoyapf diff --git a/paper.tex b/paper.tex index 95d73dc..6ae5198 100644 --- a/paper.tex +++ b/paper.tex @@ -50,11 +50,6 @@ \usepackage[T1]{fontenc} \usepackage{microtype} -\usepackage{minted} -\usemintedstyle{colorful} -\newminted[mlir]{tools/MLIRLexer.py:MLIRLexerOnlyOps -x}{mathescape} -\newminted[xdsl]{tools/MLIRLexer.py:MLIRLexer -x}{mathescape, style=murphy} - \usepackage{xargs} \usepackage{lipsum} \usepackage{xparse} @@ -66,6 +61,10 @@ \input{tex/setup.tex} \input{tex/acm.tex} +\usemintedstyle{colorful} +\newminted[mlir]{tools/MLIRLexer.py:MLIRLexerOnlyOps}{customlexer, mathescape} +\newminted[xdsl]{tools/MLIRLexer.py:MLIRLexer}{customlexer, mathescape, style=murphy} + % We use the following color scheme % % This scheme is both print-friendly and colorblind safe for diff --git a/tex/setup.tex b/tex/setup.tex index de3b16e..962fe98 100644 --- a/tex/setup.tex +++ b/tex/setup.tex @@ -125,3 +125,43 @@ \expandafter\newcommand\csname #1\endcsname[2][]{##1}% }% \fi + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% Add minted and support costum lexers +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\usepackage{minted} +\makeatletter +\ifwindows + \renewcommand{\minted@optlistcl@quote}[2]{% + \ifstrempty{#2}{\detokenize{#1}}{\detokenize{#1="#2"}}} +\else + \renewcommand{\minted@optlistcl@quote}[2]{% + \ifstrempty{#2}{\detokenize{#1}}{\detokenize{#1='#2'}}} +\fi + +% similar to \minted@def@optcl@switch +\newcommand{\minted@def@optcl@novalue}[2]{% + \define@booleankey{minted@opt@g}{#1}% + {\minted@addto@optlistcl{\minted@optlistcl@g}{#2}{}% + \@namedef{minted@opt@g:#1}{true}} + {\@namedef{minted@opt@g:#1}{false}} + \define@booleankey{minted@opt@g@i}{#1}% + {\minted@addto@optlistcl{\minted@optlistcl@g@i}{#2}{}% + \@namedef{minted@opt@g@i:#1}{true}} + {\@namedef{minted@opt@g@i:#1}{false}} + \define@booleankey{minted@opt@lang}{#1}% + {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang}{#2}{}% + \@namedef{minted@opt@lang\minted@lang:#1}{true}} + {\@namedef{minted@opt@lang\minted@lang:#1}{false}} + \define@booleankey{minted@opt@lang@i}{#1}% + {\minted@addto@optlistcl@lang{minted@optlistcl@lang\minted@lang @i}{#2}{}% + \@namedef{minted@opt@lang\minted@lang @i:#1}{true}} + {\@namedef{minted@opt@lang\minted@lang @i:#1}{false}} + \define@booleankey{minted@opt@cmd}{#1}% + {\minted@addto@optlistcl{\minted@optlistcl@cmd}{#2}{}% + \@namedef{minted@opt@cmd:#1}{true}} + {\@namedef{minted@opt@cmd:#1}{false}} +} + +\minted@def@optcl@novalue{customlexer}{-x} +\makeatother diff --git a/tools/create-video.py b/tools/create-video.py index 881e219..dabd409 100755 --- a/tools/create-video.py +++ b/tools/create-video.py @@ -201,7 +201,9 @@ def createImage(data): shutil.copyfile("Makefile", dirname + "/Makefile") shutil.copyfile(".latexmkrc", dirname + "/.latexmkrc") - run(['make', '-C', dirname, f"{base_filename}.pdf"], stdout=DEVNULL, stderr=STDOUT) + cmd = ['make', '-C', dirname, f"{base_filename}.pdf"] + print(" ".join(cmd)) + #run(['make', '-C', dirname, f"{base_filename}.pdf"], stdout=STDOUT, stderr=STDOUT) createImageOfPaper(dirname + f"/{base_filename}.pdf") plotStatistics(commit, dirname + "/statistics.png", branch, count) run(['convert', dirname + f"/{base_filename}.pdf-full.png", '-resize', '3840x2160',