diff --git a/.github/workflows/build-latex-diff.yml b/.github/workflows/build-latex-diff.yml index e14e237..4fe7cc4 100644 --- a/.github/workflows/build-latex-diff.yml +++ b/.github/workflows/build-latex-diff.yml @@ -3,8 +3,12 @@ on: pull_request: types: [opened, synchronize, reopened] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + jobs: - build_latex: + build_latex_diff: runs-on: ubuntu-latest env: PAPER: ${{ github.event.repository.name }} @@ -18,12 +22,13 @@ jobs: id: compileLaTeXdiff uses: xu-cheng/latex-action@v3 with: + texlive_version: 2023 root_file: | ${{ env.PAPER }}-diff${{ env.MAIN }}.tex working_directory: paper extra_system_packages: "git patch" latexmk_shell_escape: true - pre_compile: git config --global --add safe.directory /github/workspace && latexdiff-vc --git --flatten --disable-auto-mbox --exclude-safecmd="Cref,Cref\*,hspace" -r ${{ env.MAIN }} ${{ env.PAPER }}.tex + pre_compile: git config --global --add safe.directory /github/workspace && latexdiff-vc --git --flatten --disable-auto-mbox --exclude-safecmd="Cref,Cref\*,hspace" --allow-spaces --no-links -r ${{ env.MAIN }} ${{ env.PAPER }}.tex env: TEXINPUTS: ".:$PWD/../latex-styles-master/styles//:" BSTINPUTS: ".:$PWD/../latex-styles-master/styles/common" @@ -31,14 +36,14 @@ jobs: continue-on-error: true - name: Upload PDF if: steps.compileLaTeXdiff.outcome == 'success' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Success--Here-is-the-Diff-PDF path: | paper/${{ env.PAPER }}-diff${{ env.MAIN }}.pdf - name: Upload build logs if: steps.compileLaTeXdiff.outcome == 'failure' - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: Diff-Build-Failed--Here-are-the-Logs path: | diff --git a/.github/workflows/build-latex.yml b/.github/workflows/build-latex.yml index 144a14e..21f4482 100644 --- a/.github/workflows/build-latex.yml +++ b/.github/workflows/build-latex.yml @@ -7,6 +7,10 @@ on: pull_request: types: [opened, synchronize, reopened] +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + jobs: build_latex: runs-on: ubuntu-latest @@ -21,6 +25,7 @@ jobs: id: compileLaTeXdocument uses: xu-cheng/latex-action@v3 with: + texlive_version: 2023 root_file: | ${{ env.PAPER }}.tex working_directory: paper @@ -33,15 +38,15 @@ jobs: BIBINPUTS: ".:$PWD/../latex-styles-master/share" continue-on-error: true - name: Upload PDF - if: steps.compileLaTeXdocument.outcome == 'success' && github.event_name != 'push' - uses: actions/upload-artifact@v3 + if: steps.compileLaTeXdocument.outcome == 'success' + uses: actions/upload-artifact@v4 with: name: Success--Here-is-the-PDF path: | paper/${{ env.PAPER }}.pdf - name: Upload build logs - if: steps.compileLaTeXdocument.outcome == 'failure' && github.event_name != 'push' - uses: actions/upload-artifact@v3 + if: steps.compileLaTeXdocument.outcome == 'failure' + uses: actions/upload-artifact@v4 with: name: Build-Failed--Here-are-the-Logs path: | diff --git a/.github/workflows/build-referee-response.yml b/.github/workflows/build-referee-response.yml new file mode 100644 index 0000000..014e715 --- /dev/null +++ b/.github/workflows/build-referee-response.yml @@ -0,0 +1,51 @@ +name: Build response-to-referees +on: + push: + branches: + - master + - main + paths: ['paper/response-to-referees.tex'] + pull_request: + types: [opened, synchronize, reopened] + paths: ['paper/response-to-referees.tex'] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + # ok to cancel concurrent builds on main; this pdf is not part of releases + cancel-in-progress: true + +jobs: + build_latex: + runs-on: ubuntu-latest + steps: + - name: Set up Git repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Compile LaTeX document + id: compileLaTeXdocument + uses: xu-cheng/latex-action@v3 + with: + root_file: | + response-to-referees.tex + working_directory: paper + extra_system_packages: "git patch" + latexmk_shell_escape: true + pre_compile: git config --global --add safe.directory /github/workspace + - name: Upload PDF + if: steps.compileLaTeXdocument.outcome == 'success' && github.event_name != 'push' + uses: actions/upload-artifact@v4 + with: + name: Success--Here-is-the-response-to-referees-PDF + path: | + paper/response-to-referees.pdf + - name: Upload build logs + if: steps.compileLaTeXdocument.outcome == 'failure' && github.event_name != 'push' + uses: actions/upload-artifact@v4 + with: + name: Build-Response-Failed--Here-are-the-Logs + path: | + **/*.log + - name: Fail job if build failed + if: steps.compileLaTeXdocument.outcome == 'failure' + run: exit 1 diff --git a/.github/workflows/indent.yml b/.github/workflows/indent.yml new file mode 100644 index 0000000..fb35aa0 --- /dev/null +++ b/.github/workflows/indent.yml @@ -0,0 +1,37 @@ +name: indent + +on: + push: + branches: + - 'main' + - 'master' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + indent: + runs-on: macos-latest + steps: + - name: Checking out repository + uses: actions/checkout@v4 + - name: Install latexindent and bibtool + run: brew install latexindent bib-tool + - name: Run latexindent + id: run-latexindent + run: | + shopt -s nullglob # allow empty loops below + for f in *.tex; do latexindent -l ./localSettings.yaml -m -r -w $f; done + rm -f *.bak[0-9] indent.log + - name: Run bibtool + id: run-bibtool + run: | + shopt -s nullglob # allow empty loops below + cd paper + for f in *.bib; do + bibtool -R -r braces.rsc -r field.rsc -r improve.rsc -r sort_fld.rsc -r ./local.rsc -i $f -o _out_$f + mv _out_$f $f + done + - name: Create Pull Request + uses: peter-evans/create-pull-request@v7 diff --git a/.github/workflows/latexindent.yml b/.github/workflows/latexindent.yml deleted file mode 100644 index 4717509..0000000 --- a/.github/workflows/latexindent.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: latexindent - -on: - push: - branches: - - 'main' - - 'master' - -jobs: - build: - runs-on: macos-latest - steps: - - name: Checking out repository - uses: actions/checkout@v3 - - name: Install latexindent - run: brew install latexindent - - name: Run latexindent - id: run-latexindent - run: | - shopt -s nullglob # allow empty loops below - cd paper - for f in *.tex; do latexindent -l ./localSettings.yaml -m -r -w $f; done - # for f in *.bib; do latexindent -l ./localSettings.yaml -m -r -w $f; done - rm *.bak[0-9] - - name: Create Pull Request - uses: peter-evans/create-pull-request@v4 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 958740b..5c40844 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -6,6 +6,10 @@ on: - master - main +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-latest @@ -24,7 +28,7 @@ jobs: result-encoding: string script: | const fs = require('fs'); - return "
\nChktex output\n\n```\n" + fs.readFileSync("${{ github.workspace }}/chktex_output.txt", "utf8").toString() + "\n```\n
"; + return "Chktex output: \n```\n" + fs.readFileSync("${{ github.workspace }}/chktex_output.txt", "utf8").toString() + "```"; - name: Comment in PR uses: thollander/actions-comment-pull-request@v2 with: diff --git a/.github/workflows/pr-comment.yml b/.github/workflows/pr-comment.yml index 7c61ee6..f9072e8 100644 --- a/.github/workflows/pr-comment.yml +++ b/.github/workflows/pr-comment.yml @@ -1,7 +1,7 @@ name: add artifact links to pr on: workflow_run: - workflows: ["Build LaTeX document", "Build LaTeX diff document"] + workflows: ["Build LaTeX document", "Build LaTeX diff document", "Build response-to-referees"] types: [completed] jobs: @@ -10,8 +10,7 @@ jobs: runs-on: [ubuntu-latest] steps: - name: add artifact links to pull request and related issues step - if: github.event_name != 'push' - uses: veitbjarsch/artifacts-url-comments@v1.1.0 + uses: veitbjarsch/artifacts-url-comments@main env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: diff --git a/paper/response-to-referees.tex b/paper/response-to-referees.tex new file mode 100644 index 0000000..bd5ca2c --- /dev/null +++ b/paper/response-to-referees.tex @@ -0,0 +1,109 @@ +\documentclass[11pt]{article} + +\usepackage{microtype} +\usepackage{amsmath,amssymb} +\usepackage{mathtools,bbm} +\usepackage[hidelinks]{hyperref} +\usepackage[svgnames]{xcolor} +\usepackage{enumitem} +\usepackage[margin=1.2in]{geometry} +\usepackage{mdframed} + +\newmdenv[ + linecolor=black, + topline=false,bottomline=false,rightline=true, + linewidth=2pt, + backgroundcolor=gray!10!white +]{answer} + +\usepackage[textwidth=.95\marginparwidth, + backgroundcolor=lightgray, + linecolor=orange, + textsize=scriptsize]{todonotes} + +\makeatletter +\@mparswitchfalse % Place todo notes in wide margin. +\def\listtodoname{Todo List} +\def\listoftodos{% + \section*{\listtodoname}\mbox{~}\par + \@starttoc{tdo} + } +\makeatother + +\newcommand{\smarttodo}[2][]{% + \todo[caption={\protect\hypertarget{todo}{} #2}, #1]{\hyperlink{todo}{#2} +}} + +% \usepackage[number]{natbib} +% \bibpunct{(}{)}{;}{a}{,}{,} +% \newcommand*{\doi}[1]{DOI: \href{http://dx.doi.org/\detokenize{#1}}{\detokenize{#1}}} +% \renewcommand*{\url}[1]{\href{\detokenize{#1}}{\texttt{\detokenize{#1}}}} + +\begin{document} + +\begin{center} \Large + Title line 1 +\\ Title line 2 +\\[6pt] \large Author1, Author2 +\\[6pt] \today +\\[12pt]\Large \bf Response to reviewers +\end{center} + +\noindent We thank the reviewers for their careful reading of our manuscript and their insightful and constructive comments. We followed the suggestions in almost every instance. Our responses are summarized below. + +\section*{Reviewer 1 comments} + +\begin{enumerate}[label={\color{black}R1.\arabic*}] + \item\label{R1:comment1} Referee comment. + + \begin{answer} + Our answer. + \end{answer} + + \item Referee comment. + + \begin{answer} + Our answer can refer to~\ref{R1:comment1}. + \end{answer} + +\end{enumerate} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section*{Reviewer 2 comments} + +\begin{enumerate}[label={\color{black}R2.\arabic*}] + + \item\label{R2:comment1} Referee comment. + + \begin{answer} + Our answer. + \end{answer} + + \item Referee comment. + + \begin{answer} + Our answer can refer to~\ref{R2:comment1}. + \end{answer} + +\end{enumerate} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section*{Other changes} + +\begin{enumerate}[label={\color{black}O.\arabic*}] + + \item Description of other change. + +\end{enumerate} + +% \frenchspacing +% \bibliographystyle{abbrvnat} +% \bibliography{abbrv} + +\end{document} +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: