From 06c4678f4e89507329bb787550a714bffeae5693 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Ke=C3=9Fler=20=28via=20gitlab=20runner=29?= Date: Tue, 26 Oct 2021 07:45:37 +0000 Subject: [PATCH] add various shortlabels / enumerate styles to enumerate package Build branch master (9b279f6) from kesslermaximilian/LatexPackages --- build_info.json | 10 +++++----- wip/mkessler-enumerate.sty | 41 +++++++++++++++++++++++++++++++++++--- 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/build_info.json b/build_info.json index 838eed4..87fdcd9 100644 --- a/build_info.json +++ b/build_info.json @@ -1,8 +1,8 @@ { "build_time": "", "source files": { - "version": "v2.2.2-19", - "commit": "7116da1450351cf44b1c93f3bcb0b2875de25ba6", + "version": "v2.2.2-20", + "commit": "9b279f65fd45d99ffd45ca6131b07c306e15215e", "dirty": false }, "pytex": { @@ -24,9 +24,9 @@ { "name": "mkessler-enumerate.sty", "source file": "enumerate.pysty", - "build time": "2021/10/24 08:36", - "source version": "v2.2.2-2", - "source commit hash": "0e520739a3ac07d81f5d9dba14a955a4b05d1851", + "build time": "2021/10/26 07:45", + "source version": "v2.2.2-20", + "source commit hash": "9b279f65fd45d99ffd45ca6131b07c306e15215e", "pytex version": "v1.0.0-18", "pytex commit hash": "126d420b7a6ed2d4b2a42d534ab2e12344869643", "dirty": false diff --git a/wip/mkessler-enumerate.sty b/wip/mkessler-enumerate.sty index 2a8c96b..d12f702 100644 --- a/wip/mkessler-enumerate.sty +++ b/wip/mkessler-enumerate.sty @@ -27,7 +27,7 @@ % % Build details: % PyTeX version: v1.0.0-18 (commit 126d420) -% Source code version: v2.2.2-2 (commit 0e52073) +% Source code version: v2.2.2-20 (commit 9b279f6) % % This LaTeX package is free software and distributed under the MIT License. You % may use it freely for your purposes. The latest version of the package can be @@ -39,11 +39,46 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \NeedsTeXFormat{LaTeX2e} -\ProvidesPackage{mkessler-enumerate}[2021/10/24 - Simple enumeration package wrapper. Handles custom number setting and beamer class.] +\ProvidesPackage{mkessler-enumerate}[2021/10/26 - Simple enumeration package wrapper. Handles custom number setting and beamer class.] \@ifclassloaded{beamer}{}{ - \usepackage[shortlabels]{enumitem} + \RequirePackage[shortlabels]{enumitem} + \RequirePackage{tikz} \newcommand\setItemnumber[1]{\setcounter{enum\romannumeral\@enumdepth}{\numexpr#1-1\relax}} + + \def\mkessler@enumerate@drawcircle#1{ + \tikz[baseline=(char.base)]{ + \node[shape=circle,draw,inner sep=2pt] (char) {#1}; + } + } + + \def\mkessler@enumerate@circled{ + \protect\mkessler@enumerate@drawcircle{\arabic*} + } + \def\mkessler@enumerate@property{ + (\roman*) + } + \def\mkessler@enumerate@equivalent{ + (\arabic*) + } + \def\mkessler@enumerate@holds{ + \arabic*) + } + + \SetEnumerateShortLabel{c}{\mkessler@enumerate@circled} + \SetEnumerateShortLabel{p}{\mkessler@enumerate@property} + \SetEnumerateShortLabel{e}{\mkessler@enumerate@equivalent} + \SetEnumerateShortLabel{h}{\mkessler@enumerate@holds} + + \SetEnumitemValue{label}{circled}{\mkessler@enumerate@circled} + \SetEnumitemValue{label}{property}{\mkessler@enumerate@property} + \SetEnumitemValue{label}{equivalent}{\mkessler@enumerate@equivalent} + \SetEnumitemValue{label}{holds}{\mkessler@enumerate@holds} + + \SetEnumitemKey{property}{label=property} + \SetEnumitemKey{equivalent}{label=equivalent} + \SetEnumitemKey{holds}{label=holds} + \SetEnumitemKey{circled}{label=circled} }