pretty_urls: trailing_index:false# Set to false to remove trailing 'index.html' from permalinks trailing_html:false# Set to false to remove trailing '.html' from permalinks
# See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks exclude:"{{package_name}}|.all-contributorsrc" default_stages: [commit]
# download images if DOWNLOAD: for url in re.findall( r"https://cdn-ak.f.st-hatena.com/images/fotolife/m/\w+/\d{8}/\d{14}.(?:png|jpg)", content_new, ): dest = DEST_DIR / url.split("/")[-1]
# download only if not exists ifnot dest.exists(): # create directory if not exists dest.parent.mkdir(parents=True, exist_ok=True)
# download image r = requests.get(url, timeout=10) if r.status_code == 200: dest.write_bytes(r.content) else: # do not replace url if download failed continue
# replace url # need "/" at the beginning to make it relative path content_new = content_new.replace( url, "/" + dest.relative_to(SOURCE_DIR).as_posix() )
# replace only if content is changed if content != content_new: path.write_text(content_new, encoding="utf-8")
.latexmkrcが適切に読み込まれていない場合、LaTex Compilerの出力を見ると、-interaction=nonstopmodeが指定されていないために途中で止まっているかもしれません。その場合は、LaTeX WorkshopのウィンドウからTerminate current compilationを押します。
{ "latex-workshop.latex.recipes":[ { "name":"cluttex", "tools":["cluttex"] }, { "name":"latexmk", "tools":["latexmk"] } ], "$comment":"LaTeX Workshop calls commands from the directory of the main tex file, not the root of the project. See https://github.com/James-Yu/LaTeX-Workshop/wiki/Compile#placeholders for more info.", "latex-workshop.latex.tools":[ { "name":"cluttex", "command":"cluttex", "args":["--engine=xelatex","--biber","%DOC%"], "env":{} }, { "name":"latexmk", "command":"latexmk", "args":[ "-r", "%WORKSPACE_FOLDER%/.latexmkrc", "-outdir=%OUTDIR%", "%DOC%" ], "env":{} } ], "editor.wordWrap":"on", "latex-workshop.latex.autoBuild.cleanAndRetry.enabled":false, "latex-workshop.latex.autoBuild.run":"onSave" }
# See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks exclude:"CHANGELOG.md|.copier-answers.yml" default_stages: [commit]
ci: autofix_commit_msg:"chore(pre-commit.ci): auto fixes" autoupdate_commit_msg:"chore(pre-commit.ci): pre-commit autoupdate"
repos: -repo:https://github.com/commitizen-tools/commitizen rev:v3.2.2 hooks: -id:commitizen stages: [commit-msg] -repo:https://github.com/pre-commit/pre-commit-hooks rev:v4.4.0 hooks: -id:check-added-large-files -id:check-builtin-literals -id:check-case-conflict -id:check-docstring-first -id:check-merge-conflict -id:check-json -id:check-toml -id:check-xml -id:check-yaml -id:detect-private-key # - id: end-of-file-fixer # - id: trailing-whitespace -repo:https://github.com/pre-commit/mirrors-prettier rev:v2.7.1 hooks: -id:prettier args: ["--tab-width", "2"] -repo:https://github.com/jonasbb/pre-commit-latex-hooks rev:v1.4.0 hooks: -id:american-eg-ie -id:cleveref-capitalization -id:csquotes -id:ensure-labels-for-sections -id:no-space-in-cite -id:tilde-cite # args: # [ # # If present only check that there is a \label{} but not the value # "--ignore-label-content", # ] -id:cleveref-instead-of-autoref -repo:https://github.com/cmhughes/latexindent.pl.git rev:V3.23.4 hooks: # - id: latexindent # - id: latexindent-conda -id:latexindent-docker args: ---overwriteIfDifferent ---replacement ---local ---modifylinebreaks ---silent -repo:https://github.com/FlamingTempura/bibtex-tidy rev:v1.9.0 hooks: -id:bibtex-tidy args: [--no-align]
d = dict(make_item(env, env) for env in envs + theorems) d.update(dict([make_item("begin", "${1:env}")])) Path("latex.code-snippets").write_text(json.dumps(d, indent=4))