diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index 21d00d8..22c692d 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -1,34 +1,50 @@ name: Build and publish to gh-pages on: push: + branches: + - main pull_request: schedule: - - cron: '1 2 2,16 * *' + - cron: '1 2 5 * *' workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +permissions: + contents: write + jobs: - build_latex: + build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: latexmk l2kurz - uses: dante-ev/latex-action@master + - uses: actions/checkout@v4 + - name: Install TeX Live + uses: zauguin/install-texlive@v3 with: - root_file: l2kurz.tex - args: - - name: make ctan - run: make ctan + package_file: tl_packages + - run: pdflatex l2kurz + - run: bibtex l2kurz + - run: pdflatex l2kurz + - run: pdflatex l2kurz - name: Gather build artifacts - run: mkdir build && cp -r README.md l2kurz.pdf .github/_config.yml l2kurz-ctan.tgz build/ - - name: Gather build artifats - uses: actions/upload-artifact@v2 + run: mkdir build && cp -r README.md l2kurz.pdf .github/_config.yml build/ + - name: Upload build artifats + uses: actions/upload-artifact@v4 with: name: build path: build - - name: Deploy - if: github.ref == 'refs/heads/master' - uses: crazy-max/ghaction-github-pages@v2 + - name: Upload to gh-pages branch + if: > + (github.repository == 'dante-ev/l2kurz') && + (github.ref == 'refs/heads/main') + uses: crazy-max/ghaction-github-pages@v4 with: target_branch: gh-pages build_dir: build env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Keep alive + if: ${{ always() }} + uses: gautamkrishnar/keepalive-workflow@v2 diff --git a/.github/workflows/keep-alive.yml b/.github/workflows/keep-alive.yml deleted file mode 100644 index 12a138d..0000000 --- a/.github/workflows/keep-alive.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Keep workflows enabled -on: - schedule: - - cron: "0 0 * * *" - workflow_dispatch: -permissions: - contents: write -jobs: - keep-alive: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - ref: 'keep-alive' - - uses: gautamkrishnar/keepalive-workflow@v1 diff --git a/eingabefile.tex b/eingabefile.tex index 9c7da87..333c44c 100644 --- a/eingabefile.tex +++ b/eingabefile.tex @@ -42,14 +42,14 @@ \subsection{\LaTeX-Befehle und Gruppen} verwenden. % PG: würde ich drin lassen -%\renewcommand{\today}{31.~Mai 2012} % to make sure that the +\renewcommand{\today}{31.~Mai 2012} % to make sure that the % line breaks look good, regardless of the date of printing. %MD: obeylines zu besseren Darstellung eingefuegt %MD: Redefinition von \today lokal halten -\begin{LTXexample}[firstline=4] -\renewcommand*\today{% - \the\numexpr\year-1978\relax.~Mai \the\year} -\obeylines +%\renewcommand*\today{% +% \the\numexpr\year-1978\relax.~Mai \the\year} +%\obeylines +\begin{LTXexample} Heute ist der \today. Oder: Heute ist der \today . Falsch ist: diff --git a/l2kurz.tex b/l2kurz.tex index 7c2dc76..73d0bbb 100644 --- a/l2kurz.tex +++ b/l2kurz.tex @@ -15,7 +15,6 @@ \typeout{ Copyright 1987 H.Partl, E.Schlegl, I.Hyna } \documentclass[11pt,a4paper,DIV=calc,footinclude=false]{scrartcl} -\NeedsTeXFormat{LaTeX2e} % für die Bearbeitung ist ein großer rechter Rand von Vorteil %\geometry{% @@ -27,6 +26,25 @@ \usepackage[USenglish,ngerman]{babel} +\usepackage{ifluatex} + +\ifluatex + \usepackage{fontspec} +\else + \usepackage[T1]{fontenc} +\fi + +\usepackage{lmodern} +\usepackage{hvlogos} +\usepackage{textcomp,ragged2e,csquotes} +\usepackage{latexsym} +\usepackage{graphicx} +\usepackage[ngerman]{varioref} +\usepackage{array,longtable,tabularx,booktabs} +\usepackage{enumitem} + +\usepackage{amsmath} + % EN: Character protrusion and font expansion. See http://www.ctan.org/tex-archive/macros/latex/contrib/microtype/ % DE: Optischer Randausgleich und Grauwerktkorrektur % Falls bei einer Silbentrennung ploetzlich eine ganze Zeile fehlt (passiert unter Windows XP mit MikTex 2.5 und foxit reader als pdfreader oder \usepackage{pdfcprot} @@ -40,18 +58,6 @@ % In the standard configuration, this template is always in the final mode, so this option only makes a difference if "pros" use the draft mode ]{microtype} -\usepackage[utf8]{inputenc} -\usepackage[T1]{fontenc} -\usepackage{lmodern} -\usepackage{dtk-logos} -\usepackage{textcomp,ragged2e,csquotes} -\usepackage{latexsym} -\usepackage{graphicx} -\usepackage[ngerman]{varioref} -\usepackage{array,longtable,tabularx,booktabs} -\usepackage{enumitem} - -\usepackage{amsmath} \usepackage{caption} \makeatletter @@ -69,38 +75,48 @@ \usepackage[normalem]{ulem} \usepackage{showexpl} -\makeatletter -\let\LTXexample\@undefined -\let\endLTXexample\@undefined -\let\LTXexample@\@undefined - -\lstnewenvironment{LTXexample}[1][] -{% - \@temptokena{#1}% - \begingroup - \advance\c@ltxexample\@ne \advance\c@lstlisting\@ne - \expandafter\lstset\expandafter{\SX@explpreset,#1}% - \edef\x{\endgroup - \def\noexpand\SX@codefile{\SX@codefile}% - \def\noexpand\SX@graphicname{\SX@graphicname}% - \def\noexpand\SX@graphicparam{\SX@graphicparam}}% - \x - \xdef\SX@@explpreset{\the\@temptokena,codefile=\SX@codefile, - graphic={[\SX@graphicparam]{\SX@graphicname}}}% - \setbox\@tempboxa=\hbox\bgroup% Warum noetig? - \def\lst@literate{}% - \lstset{extendedchars=true,inputencoding=latin1}% - \lst@BeginWriteFile{\SX@codefile}% + + +\usepackage[realmainfile]{currfile} +\usepackage{tcolorbox} +\tcbuselibrary{listings} + +% TODO: Change this to "/tcb/text and listing", tcolorbox Section 17.8 "Common Option Keys of all Libraries" +\newcount\LTGbeginlineexample +\newcount\LTGendlineexample +\renewenvironment{LTXexample}% +{\LTGbeginlineexample=\numexpr\inputlineno+1\relax}% +{\LTGendlineexample=\numexpr\inputlineno-1\relax% +% +\tcbinputlisting{% + listing only, + %text and listing, + listing file=\currfilepath, + colback=green!5!white, + colframe=green!25, + coltitle=black!90, + coltext=black!90, + left=8mm, + title=Entsprechender \LaTeX{}-Quelltext von \texttt{\currfilepath}, + listing options={% + frame=none, + language={[LaTeX]TeX}, + escapeinside={}, + firstline=\the\LTGbeginlineexample, + lastline=\the\LTGendlineexample, + firstnumber=\the\LTGbeginlineexample, + basewidth=.5em, + aboveskip=0mm, + belowskip=0mm, + numbers=left, + xleftmargin=0mm, + numberstyle=\tiny, + numbersep=8pt% + } } -{% - \lst@EndWriteFile\egroup - \inputencoding{utf8}% - \lstset{extendedchars=true,inputencoding=utf8}% - \SX@put@code@result } -\makeatother -\usepackage[hyperref,dvipsnames]{xcolor} +\usepackage[dvipsnames]{xcolor} \definecolor{darkblue}{rgb}{0,0,.5} % für todo-notes, kann später raus @@ -152,34 +168,34 @@ % \usepackage[textsize=footnotesize]{todonotes} % Zum Schluss laden: -\usepackage[unicode, pdfpagelabels,pageanchor=false, linktoc=all]{hyperref} +\usepackage[unicode, pdfpagelabels, pageanchor=false, linktoc=all]{hyperref} -\usepackage{hyperxmp} +%\usepackage{hyperxmp} \hypersetup{% pdftitle={LaTeX2e-Kurzbeschreibung}, - pdfauthor={Marco Daniel, Patrick Gundlach, Walter Schmidt et al.}, + %pdfauthor={Marco Daniel, Patrick Gundlach, Walter Schmidt et al.}, % pdfcopyright={Copyright (C) 2017, . This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License}, pdfsubject={LaTeX Kurzanleitung}, pdfkeywords={LaTeX, TeX, DANTE e.V.},%ggf. anpassen %pdflicenseurl={http://creativecommons.org/licenses/by-sa/4.0/}, - pdfcaptionwriter={}, - pdfcontactaddress={}, - pdfcontactcity={}, - pdfcontactpostcode={}, - pdfcontactcountry={Germany}, - pdfcontactphone={}, - pdfcontactemail={}, - pdfcontacturl={}, + %pdfcaptionwriter={}, + %pdfcontactaddress={}, + %pdfcontactcity={}, + %pdfcontactpostcode={}, + %pdfcontactcountry={Germany}, + %pdfcontactphone={}, + %pdfcontactemail={}, + %pdfcontacturl={}, pdflang={de}, - pdfmetalang={de}, + %pdfmetalang={de}, breaklinks=true, - bookmarks=true, % show bookmarks bar + % bookmarks=true, % show bookmarks bar pdftoolbar=true, % show Acrobat’s toolbar pdfmenubar=true, % show Acrobat’s menu pdffitwindow=false, % window fit to page when opened pdfstartview={FitH}, % fits the width of the page to the window - pdfcreator={Creator}, % creator of the document - pdfproducer={Producer}, % producer of the document + %pdfcreator={Creator}, % creator of the document + %pdfproducer={Producer}, % producer of the document pdfnewwindow=true, % links in new window colorlinks=true, % false: boxed links; true: colored links linkcolor=darkblue, % color of internal links @@ -188,8 +204,6 @@ urlcolor=darkblue % color of external links } - - % % Seitenzahlen oben, aber keine Kopfzeile % diff --git a/tl_packages b/tl_packages new file mode 100644 index 0000000..4e937c9 --- /dev/null +++ b/tl_packages @@ -0,0 +1,54 @@ +scheme-basic + +bigintcalc +bitset +hologo +iftex +infwarerr +intcalc +kvdefinekeys +ltxcmds +pdfescape +pdftexcmds +ulem +uniquecounter +amsmath +auxhook +bookmark +booktabs +caption +csquotes +currfile +dantelogo +enumitem +environ +etoolbox +fetamont +filehook +float +graphics +hvlogos +hycolor +hyperref +koma-script +kvoptions +kvsetkeys +listings +microtype +pgf +ragged2e +refcount +rerunfilecheck +showexpl +tools +trimspaces +url +varwidth +babel +babel-german +iftex +epstopdf +tcolorbox +xcolor +dehyph +din1505