You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
82 lines
1.9 KiB
TeX
82 lines
1.9 KiB
TeX
\NeedsTeXFormat{LaTeX2e}[2022-06-01]
|
|
\DeclareCurrentRelease{} {2023-10-09}
|
|
|
|
\RequirePackage{expl3}
|
|
\ProvidesExplPackage{cheatsheet} {2023/10/09} {alpha}
|
|
{LaTeX package that provides simple commands to put informations of varying formats (tables, math, listings, lists, ...) into visually appealing boxes, like sticky notes.}
|
|
|
|
%
|
|
% package options
|
|
%
|
|
|
|
% \keys_define:nn {cheatsheet}
|
|
% {
|
|
% columns .tl_set:N = \l__cheatsheetboxes_columns_tl
|
|
% }
|
|
|
|
%
|
|
% required packages
|
|
%
|
|
|
|
\RequirePackage{multicol}
|
|
\RequirePackage{rotating}
|
|
%\RequirePackage{tabularray}
|
|
|
|
%
|
|
% optional packages interoperability
|
|
%
|
|
|
|
% \AtBeginDocument{
|
|
% \@ifpackageloaded{xcolor}{\RequirePackage{ninecolors}}{}
|
|
% \@ifpackageloaded{hyperref}{
|
|
% \newenvironment{tblrNoHyper}{\NoHyper}{\endNoHyper}
|
|
% }{
|
|
% \newenvironment{tblrNoHyper}{}{}
|
|
% }
|
|
% }
|
|
|
|
%
|
|
% cheat sheet environment
|
|
%
|
|
|
|
\int_new:N \l__cheatsheet_rotdeg_int
|
|
\bool_new:N \l__cheatsheet_rotate_bool
|
|
|
|
\NewDocumentEnvironment { cheatsheet }
|
|
{ O{} b }
|
|
{%
|
|
\newpage
|
|
|
|
\int_set:Nn \l__cheatsheet_rotdeg_int {0}
|
|
\bool_set_false:N \l__cheatsheet_rotate_bool
|
|
|
|
\keys_set:nn { cheatsheet/cheatsheet } { #1 }
|
|
|
|
\bool_if:nT { \l__cheatsheet_clearhf_bool }
|
|
{ \thispagestyle{empty} }
|
|
|
|
\bool_if:nT { \l__cheatsheet_rotate_bool }
|
|
{ \begin{turn}{ \number \l__cheatsheet_rotdeg_int } }
|
|
|
|
#2
|
|
|
|
\bool_if:nT { \l__cheatsheet_rotate_bool }
|
|
{ \end{turn} }
|
|
}
|
|
{ }
|
|
|
|
|
|
\keys_define:nn { cheatsheet/cheatsheet }
|
|
{
|
|
, columns .int_set:N = \l__cheatsheet_columns_int
|
|
, columns .default:n = 2
|
|
, rotate .code:n = {%
|
|
\int_set:Nn \l__cheatsheet_rotdeg_int { \int_mod:nn {#1} {360} }
|
|
\bool_set_true:N \l__cheatsheet_rotate_bool
|
|
}
|
|
, clearhf .bool_set:N = \l__cheatsheet_clearhf_bool
|
|
, clearhf .default:n = false
|
|
}
|
|
|
|
\endinput
|