summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/lualatex/ideavault/ideavault.sty
blob: 07d6000645712754f6fde811665231f7e3879038 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
% ideavault.sty
% Copyright 2024 Tomasz M. Czarkowski
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
% of this license or any later version.
% The latest version of this license is in
%   https://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2008 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Tomasz M. Czarkowski
%
% This work consists of the files ideavault.sty and ideavault-lua.lua


\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{ideavault}[1.0.1]
\RequirePackage[open,openlevel=2,atend]{bookmark}
\RequirePackage{xargs}
\RequirePackage{luacode}
\RequirePackage{xpatch}
\RequirePackage{mdframed}
% Magic that lets mdframed nest more than 3 times
\makeatletter
\xpatchcmd{\mdf@preenvsetting}
  {\mdf@envdepth >\tw@}
  {\mdf@envdepth >20}
  {}
  {}
\makeatother
\RequirePackage{needspace}

\directlua{require("ideavault-lua")}

% #1: prefix
% #2: name
% #3: content
% #4: dependencies
% #5: tags
% #6: weight
\newcommandx{\createIdea}[6][1=default, 4=,5=,6=-1]{\luadirect{createIdea(\luastringN{#1}, \luastringN{#2}, \luastringN{#3}, {#4}, {#5}, #6)}}

% #1: prefix
% #2: style
% #3: name
\newcommandx{\printIdea}[3][1=default, 2=lcf]{\luadirect{ideaVault:printIdea(\luastringN{#1}, \luastringN{#3}, \luastringN{#2})}}

% #1: prefix
% #2: style
\newcommandx{\printAllWithPrefix}[2][1=default, 2=lcf]{\luadirect{ideaVault:printAllWithPrefix(\luastringN{#1}, \luastringN{#2})}}

% #1: prefix
% #2: style
% #3: tag
\newcommandx{\printAllWithTag}[3][1=default, 2=lcf]{\luadirect{ideaVault:printAllWithTag(\luastringN{#1}, \luastringN{#3}, \luastringN{#2})}}

% Internal commands for managing bookmark depth
\newcounter{bookmarkDepth}
\newcommand{\bookDown}{\stepcounter{bookmarkDepth}}
\newcommand{\bookUp}{\addtocounter{bookmarkDepth}{-1}}
\newcommand{\bookSet}[1]{\setcounter{bookmarkDepth}{#1}}
\newcommand{\bookDepth}{\arabic{bookmarkDepth}}

\endinput