diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..09902dd --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,22 @@ +FROM ghcr.io/tudalgo/algotex:latest + +# install pre-commit +RUN apt-get update \ + && apt-get -y install pre-commit sudo + +# setup non-root user +ARG USERNAME=vscode +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +# Create the user +RUN groupadd --gid $USER_GID $USERNAME \ + && useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \ + # Add sudo support. + && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ + && chmod 0440 /etc/sudoers.d/$USERNAME \ + # set the default shell to bash rather than sh + && chsh -s /bin/bash $USERNAME + +# set the default user. +USER $USERNAME diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5c9cfb6..0d4c320 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,9 @@ { "name": "latex", - "image": "ghcr.io/tudalgo/algotex:latest", + "build": { + "dockerfile": "Dockerfile" + }, + "initializeCommand": "docker pull ghcr.io/tudalgo/algotex:latest", "customizations": { "vscode": { "extensions": [ @@ -10,9 +13,11 @@ // Other helpers "shardulm94.trailing-spaces", "stkb.rewrap", // rewrap comments after n characters on one line + "dangmai.workspace-default-settings", // Other "vscode-icons-team.vscode-icons", - "draivin.hsnips" + "draivin.hsnips", + "valentjn.vscode-ltex" ], "settings": { // General settings @@ -21,23 +26,15 @@ "latex-workshop.linting.chktex.enabled": true, "latex-workshop.linting.chktex.exec.path": "chktex", "latex-workshop.latex.clean.subfolder.enabled": true, + "files.insertFinalNewline": true, "latex-workshop.latex.autoClean.run": "onBuilt", "editor.formatOnSave": true, - "files.associations": { - "*.tex": "latex", - "*.sty": "latex-expl3", - "*.cls": "latex-expl3", - "*.def": "latex", - "*.aux": "latex", - "*.toc": "latex", - "*.pygstyle": "latex", - "*.pygtex": "latex" - }, "latex-workshop.latexindent.path": "latexindent", "latex-workshop.latexindent.args": [ "-c", "%DIR%/", "%TMPFILE%", + "-l", "-y=defaultIndent: '%INDENT%'" ], "latex-workshop.latex.tools": [ diff --git a/.gitignore b/.gitignore index a6cb395..1a81f23 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,8 @@ ### VS-Code ### -/.vscode/ +.vscode/* +!.vscode/extensions.json +!.vscode/settings.default.json +!.vscode/*.code-snippets .VSCodeCounter/ ### Intellij ### @@ -106,6 +109,7 @@ comp/ ## Bibliography auxiliary files (bibtex/biblatex/biber): *.bbl +*.bbl-SAVE-ERROR *.bcf *.blg *-blx.aux @@ -372,3 +376,6 @@ TSWLatexianTemp* # option is specified. Footnotes are the stored in a file with suffix Notes.bib. # Uncomment the next line to have this generated file ignored. #*Notes.bib +.secrets +options.cfg +svg-inkscape/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 25d7c63..2c17662 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,7 +18,7 @@ repos: hooks: - id: autopep8 - repo: https://github.com/editorconfig-checker/editorconfig-checker.python - rev: '2.7.3' # pick a git hash / tag to point to + rev: '3.0.3' # pick a git hash / tag to point to hooks: - id: editorconfig-checker exclude_types: [tex,python] diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..7f7948c --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,7 @@ +{ + "recommendations": [ + "James-Yu.latex-workshop", + "dangmai.workspace-default-settings", + "valentjn.vscode-ltex" + ] +} diff --git a/.vscode/latex.code-snippets b/.vscode/latex.code-snippets new file mode 100644 index 0000000..7abd042 --- /dev/null +++ b/.vscode/latex.code-snippets @@ -0,0 +1,60 @@ +{ + "task": { + "prefix": "\\task", + "body": [ + "\\begin{task}[points=${1:auto}]{${2:Aufgabentitel}}", + "\t$0", + "\\end{task}" + ], + "description": "Create A Task Environment", + "scope": "latex" + }, + "subtask": { + "prefix": "\\subtask", + "body": [ + "\\begin{subtask*}[points=${1:1}]{${2:Aufgabentitel}}", + "\t$0", + "\\end{subtask*}" + ], + "description": "Create A Subtask Environment", + "scope": "latex" + }, + "inlinejava": { + "prefix": [ + "\\inlinejava", + ], + "body": "\\inlinejava{$0}", + "description": "Displays java code inline", + "scope": "latex" + }, + "Def Box": { + "prefix": "\\defBox", + "body": [ + "\\begin{defBox}", + "\t$0", + "\\end{defBox}" + ], + "description": "Create An Definition Box (accentcolor Stripe, light accentcolor Background)", + "scope": "latex" + }, + "Info Box": { + "prefix": "\\infoBox", + "body": [ + "\\begin{infoBox}", + "\t$0", + "\\end{infoBox}" + ], + "description": "Create An Info Box (accentcolor Stripe, no Background)", + "scope": "latex" + }, + "Gray Info Box": { + "prefix": "\\grayInfoBox", + "body": [ + "\\begin{grayInfoBox}", + "\t$0", + "\\end{grayInfoBox}" + ], + "description": "Create A Gray Info Box (gray Stripe, gray Background)", + "scope": "latex" + }, +} diff --git a/.vscode/settings.default.json b/.vscode/settings.default.json new file mode 100644 index 0000000..3f3325b --- /dev/null +++ b/.vscode/settings.default.json @@ -0,0 +1,33 @@ +{ + "latex-workshop.latexindent.args": [ + "-c", + "%DIR%/", + "%TMPFILE%", + "-l=%WORKSPACE_FOLDER%/latexindent.yaml", + "-y=defaultIndent: '%INDENT%'" + ], + "latex-workshop.latex.verbatimEnvs": [ + "verbatim", + "lstlisting", + "minted", + "codeBlock" + ], + "files.associations": { + "*.sty": "latex-expl3", + "*.cls": "latex-expl3", + "*.def": "latex", + "*.aux": "latex", + "*.toc": "latex", + "*.pygstyle": "latex", + "*.pygtex": "latex" + }, + "grammarly.selectors": [ + { + "language": "latex", + "scheme": "file" + } + ], + "latex-workshop.bibtex-format.tab": "4 spaces", + "ltex.language": "de-DE", + "files.insertFinalNewline": true +} diff --git a/contrib/.vscode/extensions.json b/contrib/.vscode/extensions.json deleted file mode 100644 index 89e32a7..0000000 --- a/contrib/.vscode/extensions.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "recommendations": [ - "James-Yu.latex-workshop" - ] -} diff --git a/contrib/.vscode/settings.json b/contrib/.vscode/settings.json deleted file mode 100644 index 072a282..0000000 --- a/contrib/.vscode/settings.json +++ /dev/null @@ -1,208 +0,0 @@ -/** -Diese Einstellungen dienen als "template" und dürfen lokal -überschrieben werden. - -Um das Tracking für diese Datei zu deaktivieren, kann fol- -gender Befehl (im Hauptordner des Repos) verwendet werden: - -git update-index --assume-unchanged .vscode/settings.json - -Wieder Rückgängig machen lässt es folgenden Befehl: - -git update-index --no-assume-unchanged .vscode/settings.json -*/ -{ - "latex-workshop.latexindent.args": [ - "-c", - "%DIR%/", - "%TMPFILE%", - "-l=%WORKSPACE_FOLDER%/latexindent.yaml", - // "-m", - "-y=defaultIndent: '%INDENT%'" - ], - "latex-workshop.latex.verbatimEnvs": [ - "verbatim", - "lstlisting", - "minted", - "codeBlock" - ], - "files.associations": { - "*.sty": "latex-expl3", - "*.cls": "latex-expl3", - "*.def": "latex", - "*.aux": "latex", - "*.toc": "latex", - "*.pygstyle": "latex", - "*.pygtex": "latex" - }, - "latex-workshop.latex.tools": [ - { - "name": "latexmk", - "command": "latexmk", - "args": [ - "--shell-escape", - "-synctex=1", - "-interaction=nonstopmode", - "-file-line-error", - "-pdf", - "-outdir=%OUTDIR%", - "%DOC%" - ], - "env": {} - }, - { - "name": "lualatexmk", - "command": "latexmk", - "args": [ - "--shell-escape", - "-synctex=1", - "-interaction=nonstopmode", - "-file-line-error", - "-lualatex", - "-outdir=%OUTDIR%", - "%DOC%" - ], - "env": { - "DARK_MODE": "1", - "SOLUTION": "1" - } - }, - { - "name": "xelatexmk", - "command": "latexmk", - "args": [ - "--shell-escape", - "-synctex=1", - "-interaction=nonstopmode", - "-file-line-error", - "-xelatex", - "-outdir=%OUTDIR%", - "%DOC%" - ], - "env": {} - }, - { - "name": "latexmk_rconly", - "command": "latexmk", - "args": [ - "%DOC%" - ], - "env": {} - }, - { - "name": "pdflatex", - "command": "pdflatex", - "args": [ - "--shell-escape", - "-synctex=1", - "-interaction=nonstopmode", - "-file-line-error", - "%DOC%" - ], - "env": {} - }, - { - "name": "bibtex", - "command": "bibtex", - "args": [ - "%DOCFILE%" - ], - "env": {} - }, - { - "name": "rnw2tex", - "command": "Rscript", - "args": [ - "-e", - "knitr::opts_knit$set(concordance = TRUE); knitr::knit('%DOCFILE_EXT%')" - ], - "env": {} - }, - { - "name": "jnw2tex", - "command": "julia", - "args": [ - "-e", - "using Weave; weave(\"%DOC_EXT%\", doctype=\"tex\")" - ], - "env": {} - }, - { - "name": "jnw2texmintex", - "command": "julia", - "args": [ - "-e", - "using Weave; weave(\"%DOC_EXT%\", doctype=\"texminted\")" - ], - "env": {} - }, - { - "name": "tectonic", - "command": "tectonic", - "args": [ - "--synctex", - "--keep-logs", - "%DOC%.tex" - ], - "env": {} - } - ], - "latex-workshop.latex.recipes": [ - { - "name": "latexmk 🔃", - "tools": [ - "latexmk" - ] - }, - { - "name": "latexmk (latexmkrc)", - "tools": [ - "latexmk_rconly" - ] - }, - { - "name": "latexmk (lualatex)", - "tools": [ - "lualatexmk" - ] - }, - { - "name": "latexmk (xelatex)", - "tools": [ - "xelatexmk" - ] - }, - { - "name": "pdflatex ➞ bibtex ➞ pdflatex × 2", - "tools": [ - "pdflatex", - "bibtex", - "pdflatex", - "pdflatex" - ] - }, - { - "name": "Compile Rnw files", - "tools": [ - "rnw2tex", - "latexmk" - ] - }, - { - "name": "Compile Jnw files", - "tools": [ - "jnw2tex", - "latexmk" - ] - }, - { - "name": "tectonic", - "tools": [ - "tectonic" - ] - } - ], - "latex-workshop.latex.recipe.default": "latexmk (lualatex)", - "autoHide.autoHidePanel": false, - "autoHide.autoHideSideBar": false, -}