| 1 |
%%%============================================================================== |
| 2 |
%% Copyright 2025-present by Alceu Frigeri |
| 3 |
%% |
| 4 |
%% This work may be distributed and/or modified under the conditions of |
| 5 |
%% |
| 6 |
%% * The [LaTeX Project Public License](http://www.latex-project.org/lppl.txt) , |
| 7 |
%% version 1.3c (or later) , and/or |
| 8 |
%% * The [GNU Affero General Public License](https://www.gnu.org/licenses/agpl-3.0.html) , |
| 9 |
%% version 3 (or later) |
| 10 |
%% |
| 11 |
%% This work has the LPPL maintenance status *maintained*. |
| 12 |
%% |
| 13 |
%% The Current Maintainer of this work is Alceu Frigeri |
| 14 |
%% |
| 15 |
%% This is version {1.2} {2025/11/06} |
| 16 |
%% |
| 17 |
%% The list of files that compose this work can be found in the README.md file at |
| 18 |
%% https://ctan.org/pkg/tikzcalendarnotes |
| 19 |
%% |
| 20 |
%%%============================================================================== |
| 21 |
\NeedsTeXFormat{LaTeX2e}[2022/06/01] |
| 22 |
|
| 23 |
\ProvidesExplPackage |
| 24 |
{tikzcalendarnotes} |
| 25 |
{2025/11/06} |
| 26 |
{1.2} |
| 27 |
{tikzcalendarnotes - calendar marks and notes} |
| 28 |
|
| 29 |
%%%%%%% |
| 30 |
%%% |
| 31 |
%%% Just an attempt of having my package's info in a regular way |
| 32 |
%%% \Pkginfograb_set:nn {<pkg-name>} { props} for each and all. |
| 33 |
%%% |
| 34 |
%%%%%%% |
| 35 |
\RequirePackage{pkginfograb} |
| 36 |
\pkginfograb_set:nn { tikzcalendarnotes } |
| 37 |
{ |
| 38 |
name = {tikzcalendarnotes} , |
| 39 |
prefix = {tikzcalendarnotes} , |
| 40 |
date = {2025/11/06} , |
| 41 |
version = {1.2} , |
| 42 |
description = {tikzcalendarnotes~ - ~calendar~ marks~ and~ notes} |
| 43 |
} |
| 44 |
%%%%%%% |
| 45 |
%%% End of cut-n-paste |
| 46 |
%%%%%%% |
| 47 |
|
| 48 |
%\RequirePackage{etoolbox} |
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
%%%%%%%%%%%%%%%%%% |
| 53 |
%%%%%%%%%%%%%%%%%% |
| 54 |
%% |
| 55 |
%% |
| 56 |
%% |
| 57 |
%%%%%%%%%%%%%%%%%% |
| 58 |
%%%%%%%%%%%%%%%%%% |
| 59 |
|
| 60 |
\cs_generate_variant:Nn \msg_error:nnnn {neee ,nVne} |
| 61 |
|
| 62 |
|
| 63 |
\msg_new:nnnn {tikzcalendarnotes} {dataset already defined} |
| 64 |
{ |
| 65 |
(ID:#1)~Dataset~ '#2'~already~defined! |
| 66 |
} |
| 67 |
{ |
| 68 |
You~tried~to~create~an~already~defined~Dataset:~'#2'. |
| 69 |
~Error~Code~ ID:<#1>. |
| 70 |
} |
| 71 |
|
| 72 |
\msg_new:nnnn {tikzcalendarnotes} {invalid dataset} |
| 73 |
{ |
| 74 |
(ID:#1)~Invalid~Dataset:~ '#2' |
| 75 |
} |
| 76 |
{ |
| 77 |
You~tried~to~use~an~invalid~Dataset:~'#2'. |
| 78 |
~Error~Code~ ID:<#1>. |
| 79 |
} |
| 80 |
|
| 81 |
|
| 82 |
\msg_new:nnnn {tikzcalendarnotes} {date not set} |
| 83 |
{ |
| 84 |
(ID:#1)~missing~date~key:~ '#2' |
| 85 |
} |
| 86 |
{ |
| 87 |
You~should~set~a~date~before:~'#2'. |
| 88 |
~Error~Code~ ID:<#1>. |
| 89 |
} |
| 90 |
|
| 91 |
\msg_new:nnnn {tikzcalendarnotes} {range not set} |
| 92 |
{ |
| 93 |
(ID:#1)~missing~from/to~keys:~ '#2' |
| 94 |
} |
| 95 |
{ |
| 96 |
You~should~set~from/to~keys~before:~'#2'. |
| 97 |
~Error~Code~ ID:<#1>. |
| 98 |
} |
| 99 |
|
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
|
| 104 |
%%%%%%%%%%%%%%%%%% |
| 105 |
%%%%%%%%%%%%%%%%%% |
| 106 |
%% |
| 107 |
%% |
| 108 |
%% |
| 109 |
%%%%%%%%%%%%%%%%%% |
| 110 |
%%%%%%%%%%%%%%%%%% |
| 111 |
|
| 112 |
\tl_new:N \l__tikzcalendarnotes_msg_submodule_tl |
| 113 |
|
| 114 |
\seq_new:N \l__tikzcalendarnotes_dataset_seq |
| 115 |
\tl_new:N \l__tikzcalendarnotes_active_dataset_tl |
| 116 |
|
| 117 |
\bool_new:N \l__tikzcalendarnotes_date_set_flag_bool |
| 118 |
\bool_new:N \l__tikzcalendarnotes_hldates_set_flag_bool |
| 119 |
\bool_new:N \l__tikzcalendarnotes_from_set_flag_bool |
| 120 |
\bool_new:N \l__tikzcalendarnotes_to_set_flag_bool |
| 121 |
\bool_new:N \l__tikzcalendarnotes_date_case_bool |
| 122 |
\bool_new:N \l__tikzcalendarnotes_hldates_case_bool |
| 123 |
\bool_new:N \l__tikzcalendarnotes_range_case_bool |
| 124 |
\bool_new:N \l__tikzcalendarnotes_cntweek_case_bool |
| 125 |
\bool_new:N \l__tikzcalendarnotes_nocntweek_case_bool |
| 126 |
|
| 127 |
\bool_new:N \l__tikzcalendarnotes_keep_counters_pgfkey_bool |
| 128 |
|
| 129 |
\bool_new:N \l__tikzcalendarnotes_year_policy_set_bool |
| 130 |
\bool_new:N \l__tikzcalendarnotes_year_label_set_bool |
| 131 |
|
| 132 |
\tl_new:N \l__tikzcalendarnotes_dayspacing_Xshift_key_tl |
| 133 |
\tl_new:N \l__tikzcalendarnotes_weekspacing_Yshift_key_tl |
| 134 |
\tl_new:N \l__tikzcalendarnotes_inter_month_space_key_tl %matrix column spacing |
| 135 |
|
| 136 |
|
| 137 |
\tl_new:N \l__tikzcalendarnotes_hl_color_key_tl |
| 138 |
|
| 139 |
|
| 140 |
\int_new:N \l__tikzcalendarnotes_year_int |
| 141 |
\int_new:N \l__tikzcalendarnotes_month_int |
| 142 |
\int_new:N \l__tikzcalendarnotes_cnta_int |
| 143 |
\int_new:N \l__tikzcalendarnotes_cntb_int |
| 144 |
|
| 145 |
|
| 146 |
\tl_new:N \l__tikzcalendarnotes_tmpa_tl |
| 147 |
\tl_new:N \l__tikzcalendarnotes_tmpb_tl |
| 148 |
|
| 149 |
\int_new:N \l__tikzcalendarnotes_tmpa_int |
| 150 |
|
| 151 |
\bool_new:N \l__tikzcalendarnotes_tmpa_bool |
| 152 |
\bool_new:N \l__tikzcalendarnotes_tmpb_bool |
| 153 |
|
| 154 |
\clist_new:N \l__tikzcalendarnotes_tmpa_clist |
| 155 |
|
| 156 |
\coffin_new:N \l__tikzcalendarnotes_tmpa_coffin |
| 157 |
|
| 158 |
|
| 159 |
\tl_new:N \l__tikzcalendarnotes_begin_iso_tl |
| 160 |
|
| 161 |
|
| 162 |
\tl_new:N \l__tikzcalendarnotes_remark_tmp_tl |
| 163 |
\tl_new:N \l__tikzcalendarnotes_dateref_tmp_tl |
| 164 |
\tl_new:N \l__tikzcalendarnotes_from_key_tl |
| 165 |
\tl_new:N \l__tikzcalendarnotes_to_key_tl |
| 166 |
\tl_new:N \l__tikzcalendarnotes_cnt_ifdate_temp_tl |
| 167 |
\tl_new:N \l__tikzcalendarnotes_cnt_pgfcalifdate_temp_tl |
| 168 |
|
| 169 |
\bool_new:N \g__tikzcalendarnotes_firstdraw_bool |
| 170 |
|
| 171 |
\tl_new:N \l__tikzcalendarnotes_TXshift_tmp_tl |
| 172 |
\tl_new:N \l__tikzcalendarnotes_TYshift_tmp_tl |
| 173 |
|
| 174 |
|
| 175 |
\tl_new:N \l__tikzcalendarnotes_TXshift_scaled_tl |
| 176 |
\tl_new:N \l__tikzcalendarnotes_TYshift_scaled_tl |
| 177 |
|
| 178 |
|
| 179 |
\tl_new:N \l__tikzcalendarnotes_radius_tmp_tl |
| 180 |
\tl_new:N \l__tikzcalendarnotes_radius_scaled_tl |
| 181 |
\tl_new:N \l__tikzcalendarnotes_radius_adj_pgfkey_tl |
| 182 |
\tl_new:N \l__tikzcalendarnotes_ref_fontsize_tl |
| 183 |
|
| 184 |
|
| 185 |
\tl_new:N \l__tikzcalendarnotes_weeklist_starts_on_tl |
| 186 |
\tl_new:N \l__tikzcalendarnotes_weeklist_ends_on_tl |
| 187 |
\int_new:N \l__tikzcalendarnotes_weeklist_delta_int |
| 188 |
\int_new:N \l__tikzcalendarnotes_weeklist_starts_on_int |
| 189 |
|
| 190 |
|
| 191 |
|
| 192 |
|
| 193 |
\tl_new:N \l__tikzcalendarnotes_day_A_tl |
| 194 |
\tl_new:N \l__tikzcalendarnotes_day_B_tl |
| 195 |
\tl_new:N \l__tikzcalendarnotes_day_C_tl |
| 196 |
\tl_new:N \l__tikzcalendarnotes_day_D_tl |
| 197 |
\tl_new:N \l__tikzcalendarnotes_day_E_tl |
| 198 |
\tl_new:N \l__tikzcalendarnotes_day_F_tl |
| 199 |
\tl_new:N \l__tikzcalendarnotes_day_G_tl |
| 200 |
|
| 201 |
\tl_new:N \l__tikzcalendarnotes_day_A_style_tl |
| 202 |
\tl_new:N \l__tikzcalendarnotes_day_B_style_tl |
| 203 |
\tl_new:N \l__tikzcalendarnotes_day_C_style_tl |
| 204 |
\tl_new:N \l__tikzcalendarnotes_day_D_style_tl |
| 205 |
\tl_new:N \l__tikzcalendarnotes_day_E_style_tl |
| 206 |
\tl_new:N \l__tikzcalendarnotes_day_F_style_tl |
| 207 |
\tl_new:N \l__tikzcalendarnotes_day_G_style_tl |
| 208 |
|
| 209 |
|
| 210 |
%%%%%%%%%%%%%%%%%% |
| 211 |
%%%%%%%%%%%%%%%%%% |
| 212 |
%% |
| 213 |
%% |
| 214 |
%% |
| 215 |
%%%%%%%%%%%%%%%%%% |
| 216 |
%%%%%%%%%%%%%%%%%% |
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
%%%%%%%%%%%%%%%%%% |
| 221 |
%%%%%%%%%%%%%%%%%% |
| 222 |
%% |
| 223 |
%% |
| 224 |
%% |
| 225 |
%%%%%%%%%%%%%%%%%% |
| 226 |
%%%%%%%%%%%%%%%%%% |
| 227 |
|
| 228 |
\cs_generate_variant:Nn \dim_to_decimal:n {e} |
| 229 |
|
| 230 |
\keys_define:nn {tikzcalendarnotes } |
| 231 |
{ |
| 232 |
year .usage:n = general , |
| 233 |
year .tl_set:N = \l__tikzcalendarnotes_year_key_tl , |
| 234 |
year .default:n = {\year} , |
| 235 |
|
| 236 |
starting~ at .usage:n = general , |
| 237 |
starting~ at .tl_set:N = \l__tikzcalendarnotes_starting_at_key_tl , |
| 238 |
starting~ at .default:n = {1} , |
| 239 |
|
| 240 |
number~ of~ months .usage:n = general , |
| 241 |
number~ of~ months .tl_set:N = \l__tikzcalendarnotes_nmonths_key_tl , |
| 242 |
number~ of~ months .default:n = {12} , |
| 243 |
|
| 244 |
per~ line .usage:n = general , |
| 245 |
per~ line .tl_set:N = \l__tikzcalendarnotes_perline_key_tl , |
| 246 |
per~ line .default:n = {3} , |
| 247 |
|
| 248 |
with~ notes .usage:n = general , |
| 249 |
with~ notes .code:n = |
| 250 |
{ |
| 251 |
\tl_set:Nn \l__tikzcalendarnotes_dayspacing_Xshift_key_tl |
| 252 |
{25} % was 14ex |
| 253 |
\tl_set:Nn \l__tikzcalendarnotes_weekspacing_Yshift_key_tl |
| 254 |
{36} |
| 255 |
\bool_set_false:N \l__tikzcalendarnotes_compact_key_bool |
| 256 |
\tl_set:Nn \l__tikzcalendarnotes_inter_month_space_key_tl |
| 257 |
{20} % was 14ex |
| 258 |
} , |
| 259 |
with~ notes .value_forbidden:n = true , |
| 260 |
|
| 261 |
without~ notes .usage:n = general , |
| 262 |
without~ notes .code:n = |
| 263 |
{ |
| 264 |
\tl_set:Nn \l__tikzcalendarnotes_dayspacing_Xshift_key_tl |
| 265 |
{15} |
| 266 |
\tl_set:Nn \l__tikzcalendarnotes_weekspacing_Yshift_key_tl |
| 267 |
{17} |
| 268 |
\bool_set_true:N \l__tikzcalendarnotes_compact_key_bool |
| 269 |
\tl_set:Nn \l__tikzcalendarnotes_inter_month_space_key_tl |
| 270 |
{5} %was 7ex |
| 271 |
} , |
| 272 |
without~ notes .value_forbidden:n = true , |
| 273 |
|
| 274 |
compact .usage:n = general , |
| 275 |
compact .meta:n = { without~ notes } , |
| 276 |
compact .value_forbidden:n = true , |
| 277 |
|
| 278 |
day~ spacing .usage:n = general , |
| 279 |
day~ spacing .tl_set:N = \l__tikzcalendarnotes_dayspacing_Xshift_key_tl , |
| 280 |
day~ spacing .value_required:n = true , |
| 281 |
|
| 282 |
week~ spacing .usage:n = general , |
| 283 |
week~ spacing .tl_set:N = \l__tikzcalendarnotes_weekspacing_Yshift_key_tl , |
| 284 |
week~ spacing .value_required:n = true , |
| 285 |
|
| 286 |
month~ spacing .usage:n = general , |
| 287 |
month~ spacing .tl_set:N = \l__tikzcalendarnotes_inter_month_space_key_tl , |
| 288 |
month~ spacing .value_required:n = true , |
| 289 |
|
| 290 |
data~ set .usage:n = general , |
| 291 |
data~ set .tl_set:N = \l__tikzcalendarnotes_dataset_key_tl , |
| 292 |
data~ set .default:n = {default} , |
| 293 |
|
| 294 |
name .usage:n = general , |
| 295 |
name .tl_set:N = \l__tikzcalendarnotes_cal_name_key_tl , |
| 296 |
name .default:n = {cal} , |
| 297 |
|
| 298 |
defaults .usage:n = general , |
| 299 |
defaults .meta:n = |
| 300 |
{ |
| 301 |
year , starting~ at , number~ of~ months , per~ line , compact , data~ set , |
| 302 |
name , |
| 303 |
} , |
| 304 |
defaults .value_forbidden:n = true , |
| 305 |
} |
| 306 |
|
| 307 |
|
| 308 |
\cs_generate_variant:Nn \prop_put_from_keyval:Nn {ce} |
| 309 |
\keys_define:nn {tikzcalendarnotes / base set } |
| 310 |
{ |
| 311 |
north~ east .usage:n = general , |
| 312 |
north~ east .code:n = |
| 313 |
{ |
| 314 |
\__tikzcalendarnotes_keycode:nnn {keys~10}{north~east} |
| 315 |
{ |
| 316 |
\prop_put_from_keyval:ce |
| 317 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ \l__tikzcalendarnotes_date_tl _prop} |
| 318 |
{ |
| 319 |
remark posref = north~ east , |
| 320 |
remark anchor = south~ west , |
| 321 |
TX shift = -\exp_not:N\l__tikzcalendarnotes_TXshift_scaled_tl , |
| 322 |
TY shift = -\exp_not:N\l__tikzcalendarnotes_TYshift_scaled_tl , |
| 323 |
date ref = \l__tikzcalendarnotes_to_key_tl , |
| 324 |
} |
| 325 |
} |
| 326 |
} , |
| 327 |
north~ east .value_forbidden:n = true , |
| 328 |
|
| 329 |
north~ west .usage:n = general , |
| 330 |
north~ west .code:n = |
| 331 |
{ |
| 332 |
\__tikzcalendarnotes_keycode:nnn {keys~09}{north~west} |
| 333 |
{ |
| 334 |
\prop_put_from_keyval:ce |
| 335 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ \l__tikzcalendarnotes_date_tl _prop} |
| 336 |
{ |
| 337 |
remark posref = north~ west , |
| 338 |
remark anchor = south~ east , |
| 339 |
TX shift = \exp_not:N\l__tikzcalendarnotes_TXshift_scaled_tl , |
| 340 |
TY shift = -\exp_not:N\l__tikzcalendarnotes_TYshift_scaled_tl , |
| 341 |
date ref = \l__tikzcalendarnotes_from_key_tl , |
| 342 |
} |
| 343 |
} |
| 344 |
} , |
| 345 |
north~ west .value_forbidden:n = true , |
| 346 |
|
| 347 |
south~ east .usage:n = general , |
| 348 |
south~ east .code:n = |
| 349 |
{ |
| 350 |
\__tikzcalendarnotes_keycode:nnn {keys~08}{south~east} |
| 351 |
{ |
| 352 |
\prop_put_from_keyval:ce |
| 353 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ \l__tikzcalendarnotes_date_tl _prop} |
| 354 |
{ |
| 355 |
remark posref = south~ east , |
| 356 |
remark anchor = north~ west , |
| 357 |
TX shift = -\exp_not:N\l__tikzcalendarnotes_TXshift_scaled_tl , |
| 358 |
TY shift = \exp_not:N\l__tikzcalendarnotes_TYshift_scaled_tl , |
| 359 |
date ref = \l__tikzcalendarnotes_to_key_tl , |
| 360 |
} |
| 361 |
} |
| 362 |
} , |
| 363 |
south~ east .value_forbidden:n = true , |
| 364 |
|
| 365 |
south~ west .usage:n = general , |
| 366 |
south~ west .code:n = |
| 367 |
{ |
| 368 |
\__tikzcalendarnotes_keycode:nnn {keys~07}{south~west} |
| 369 |
{ |
| 370 |
\prop_put_from_keyval:ce |
| 371 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ \l__tikzcalendarnotes_date_tl _prop} |
| 372 |
{ |
| 373 |
remark posref = south~ west , |
| 374 |
remark anchor = north~ east , |
| 375 |
TX shift = \exp_not:N\l__tikzcalendarnotes_TXshift_scaled_tl , |
| 376 |
TY shift = \exp_not:N\l__tikzcalendarnotes_TYshift_scaled_tl , |
| 377 |
date ref = \l__tikzcalendarnotes_from_key_tl , |
| 378 |
} |
| 379 |
} |
| 380 |
} , |
| 381 |
south~ west .value_forbidden:n = true , |
| 382 |
|
| 383 |
remark .usage:n = general , |
| 384 |
remark .code:n = |
| 385 |
{ |
| 386 |
\__tikzcalendarnotes_keycode:nnnn {keys~06}{remark=#1} |
| 387 |
{remark}{#1} |
| 388 |
} , |
| 389 |
remark .value_required:n = true , |
| 390 |
|
| 391 |
notes .usage:n = general , |
| 392 |
notes .code:n = |
| 393 |
{ |
| 394 |
\__tikzcalendarnotes_keycode:nnnn {keys~05}{notes=#1} |
| 395 |
{notes}{#1} |
| 396 |
} , |
| 397 |
notes .value_required:n = true , |
| 398 |
|
| 399 |
round .usage:n = general , |
| 400 |
round .code:n = |
| 401 |
{ |
| 402 |
\__tikzcalendarnotes_keycode:nnnn {keys~04}{round} |
| 403 |
{round}{round} |
| 404 |
} , |
| 405 |
round .value_forbidden:n = true , |
| 406 |
|
| 407 |
square .usage:n = general , |
| 408 |
square .code:n = |
| 409 |
{ |
| 410 |
\__tikzcalendarnotes_keycode:nnnn {keys~03}{square} |
| 411 |
{square}{square} |
| 412 |
} , |
| 413 |
square .value_forbidden:n = true , |
| 414 |
|
| 415 |
color .usage:n = general , |
| 416 |
color .code:n = |
| 417 |
{ |
| 418 |
\__tikzcalendarnotes_keycode:nnnn {keys~02}{color=#1} |
| 419 |
{day color}{#1} |
| 420 |
} , |
| 421 |
color .value_required:n = true , |
| 422 |
|
| 423 |
remark~ style .usage:n = general , |
| 424 |
remark~ style .code:n = |
| 425 |
{ |
| 426 |
\__tikzcalendarnotes_keycode:nnnn {keys~01}{remark~ style=#1} |
| 427 |
{remark style}{#1} |
| 428 |
} , |
| 429 |
remark~ style .value_required:n = true , |
| 430 |
|
| 431 |
note~ style .usage:n = general , |
| 432 |
note~ style .code:n = |
| 433 |
{ |
| 434 |
\__tikzcalendarnotes_keycode:nnnn {keys~11}{note~ style=#1} |
| 435 |
{note style}{#1} |
| 436 |
} , |
| 437 |
note~ style .value_required:n = true , |
| 438 |
|
| 439 |
mark~ style .usage:n = general , |
| 440 |
mark~ style .code:n = |
| 441 |
{ |
| 442 |
\__tikzcalendarnotes_keycode:nnnn {keys~00}{mark~ style=#1} |
| 443 |
{draw style}{#1} |
| 444 |
} , |
| 445 |
mark~ style .value_required:n = true , |
| 446 |
|
| 447 |
} |
| 448 |
|
| 449 |
\keys_define:nn {} |
| 450 |
{ |
| 451 |
tikzcalendarnotes / date set .inherit:n = |
| 452 |
{ tikzcalendarnotes / base set } |
| 453 |
} |
| 454 |
|
| 455 |
\keys_define:nn {tikzcalendarnotes / date set } |
| 456 |
{ |
| 457 |
date .usage:n = general , |
| 458 |
date .code:n = |
| 459 |
{ |
| 460 |
\bool_set_true:N \l__tikzcalendarnotes_date_set_flag_bool |
| 461 |
\__tikzcalendarnotes_try_insert_date:nn |
| 462 |
{#1} |
| 463 |
{} |
| 464 |
} , |
| 465 |
date .value_required:n = true , |
| 466 |
} |
| 467 |
|
| 468 |
\keys_define:nn {tikzcalendarnotes / hl dates set } |
| 469 |
{ |
| 470 |
dates .usage:n = general , |
| 471 |
dates .code:n = |
| 472 |
{ |
| 473 |
\bool_set_true:N \l__tikzcalendarnotes_hldates_set_flag_bool |
| 474 |
\bool_set_true:N \l__tikzcalendarnotes_date_set_flag_bool |
| 475 |
|
| 476 |
\clist_map_inline:nn {#1} |
| 477 |
{ |
| 478 |
\__tikzcalendarnotes_try_insert_date:nV |
| 479 |
{##1} |
| 480 |
\l__tikzcalendarnotes_hl_color_key_tl |
| 481 |
} |
| 482 |
} , |
| 483 |
dates .value_required:n = true , |
| 484 |
|
| 485 |
color .usage:n = general , |
| 486 |
color .tl_set:N = \l__tikzcalendarnotes_hl_color_key_tl , |
| 487 |
color .value_required:n = true , |
| 488 |
} |
| 489 |
|
| 490 |
|
| 491 |
|
| 492 |
\keys_define:nn {} |
| 493 |
{ |
| 494 |
tikzcalendarnotes / range set .inherit:n = |
| 495 |
{ tikzcalendarnotes / base set } |
| 496 |
} |
| 497 |
|
| 498 |
\keys_define:nn {tikzcalendarnotes / range set } |
| 499 |
{ |
| 500 |
from .usage:n = general , |
| 501 |
from .code:n = |
| 502 |
{ |
| 503 |
\tl_set:Nn \l__tikzcalendarnotes_from_key_tl |
| 504 |
{#1} |
| 505 |
\bool_set_true:N \l__tikzcalendarnotes_from_set_flag_bool |
| 506 |
} , |
| 507 |
from .value_required:n = true , |
| 508 |
|
| 509 |
to .usage:n = general , |
| 510 |
to .code:n = |
| 511 |
{ |
| 512 |
\tl_set:Nn \l__tikzcalendarnotes_to_key_tl |
| 513 |
{#1} |
| 514 |
\bool_set_true:N \l__tikzcalendarnotes_to_set_flag_bool |
| 515 |
} , |
| 516 |
to .value_required:n = true , |
| 517 |
} |
| 518 |
|
| 519 |
\keys_define:nn {tikzcalendarnotes / no cnt week set } |
| 520 |
{ |
| 521 |
from .usage:n = general , |
| 522 |
from .code:n = |
| 523 |
{ |
| 524 |
\tl_set:Nn \l__tikzcalendarnotes_from_key_tl |
| 525 |
{#1} |
| 526 |
\bool_set_true:N \l__tikzcalendarnotes_from_set_flag_bool |
| 527 |
} , |
| 528 |
from .value_required:n = true , |
| 529 |
|
| 530 |
to .usage:n = general , |
| 531 |
to .code:n = |
| 532 |
{ |
| 533 |
\tl_set:Nn \l__tikzcalendarnotes_to_key_tl |
| 534 |
{#1} |
| 535 |
\bool_set_true:N \l__tikzcalendarnotes_to_set_flag_bool |
| 536 |
} , |
| 537 |
to .value_required:n = true , |
| 538 |
} |
| 539 |
|
| 540 |
\keys_define:nn {tikzcalendarnotes / cnt week set } |
| 541 |
{ |
| 542 |
from .usage:n = general , |
| 543 |
from .code:n = |
| 544 |
{ |
| 545 |
\tl_set:Nn \l__tikzcalendarnotes_from_key_tl |
| 546 |
{#1} |
| 547 |
\bool_set_true:N \l__tikzcalendarnotes_from_set_flag_bool |
| 548 |
} , |
| 549 |
from .value_required:n = true , |
| 550 |
|
| 551 |
to .usage:n = general , |
| 552 |
to .code:n = |
| 553 |
{ |
| 554 |
\tl_set:Nn \l__tikzcalendarnotes_to_key_tl |
| 555 |
{#1} |
| 556 |
\bool_set_true:N \l__tikzcalendarnotes_to_set_flag_bool |
| 557 |
} , |
| 558 |
to .value_required:n = true , |
| 559 |
|
| 560 |
up .usage:n = general , |
| 561 |
up .code:n = |
| 562 |
{ |
| 563 |
\__tikzcalendarnotes_keycode:nnn {keys~11}{up} |
| 564 |
{ |
| 565 |
\__tikzcalendarnotes_try_insert_cntweek:VV |
| 566 |
\l__tikzcalendarnotes_from_key_tl |
| 567 |
\l__tikzcalendarnotes_to_key_tl |
| 568 |
\prop_put_from_keyval:cn |
| 569 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ \l__tikzcalendarnotes_date_tl _prop} |
| 570 |
{ |
| 571 |
cnt posref = north~ west , |
| 572 |
cnt anchor = south~ east , |
| 573 |
TX shift = \l__tikzcalendarnotes_TXshift_scaled_tl , |
| 574 |
TY shift = -\l__tikzcalendarnotes_TYshift_scaled_tl , |
| 575 |
} |
| 576 |
} |
| 577 |
} , |
| 578 |
up .value_forbidden:n = true , |
| 579 |
|
| 580 |
down .usage:n = general , |
| 581 |
down .code:n = |
| 582 |
{ |
| 583 |
\__tikzcalendarnotes_keycode:nnn {keys~12}{down} |
| 584 |
{ |
| 585 |
\__tikzcalendarnotes_try_insert_cntweek:VV |
| 586 |
\l__tikzcalendarnotes_from_key_tl |
| 587 |
\l__tikzcalendarnotes_to_key_tl |
| 588 |
\prop_put_from_keyval:cn |
| 589 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ \l__tikzcalendarnotes_date_tl _prop} |
| 590 |
{ |
| 591 |
cnt posref = south~ west , |
| 592 |
cnt anchor = north~ east , |
| 593 |
TX shift = \l__tikzcalendarnotes_TXshift_scaled_tl , |
| 594 |
TY shift = \l__tikzcalendarnotes_TYshift_scaled_tl , |
| 595 |
} |
| 596 |
} |
| 597 |
} , |
| 598 |
down .value_forbidden:n = true , |
| 599 |
|
| 600 |
center .usage:n = general , |
| 601 |
center .code:n = |
| 602 |
{ |
| 603 |
\__tikzcalendarnotes_keycode:nnn {keys~13}{center} |
| 604 |
{ |
| 605 |
\__tikzcalendarnotes_try_insert_cntweek:VV |
| 606 |
\l__tikzcalendarnotes_from_key_tl |
| 607 |
\l__tikzcalendarnotes_to_key_tl |
| 608 |
\prop_put_from_keyval:cn |
| 609 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ \l__tikzcalendarnotes_date_tl _prop} |
| 610 |
{ |
| 611 |
cnt posref = west , |
| 612 |
cnt anchor = east , |
| 613 |
TX shift = \l__tikzcalendarnotes_TXshift_scaled_tl , |
| 614 |
TY shift = 0 pt , |
| 615 |
} |
| 616 |
} |
| 617 |
} , |
| 618 |
center .value_forbidden:n = true , |
| 619 |
|
| 620 |
color .usage:n = general , |
| 621 |
color .code:n = |
| 622 |
{ |
| 623 |
\__tikzcalendarnotes_keycode:nnn {keys~13}{color=#1} |
| 624 |
{ |
| 625 |
\__tikzcalendarnotes_try_insert_cntweek:VV |
| 626 |
\l__tikzcalendarnotes_from_key_tl |
| 627 |
\l__tikzcalendarnotes_to_key_tl |
| 628 |
\prop_put:cnn |
| 629 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ \l__tikzcalendarnotes_date_tl _prop} |
| 630 |
{color} {color=#1} |
| 631 |
} |
| 632 |
} , |
| 633 |
color .value_required:n = true , |
| 634 |
|
| 635 |
starting~ at .usage:n = general , |
| 636 |
starting~ at .code:n = |
| 637 |
{ |
| 638 |
\__tikzcalendarnotes_keycode:nnn {keys~14}{starting~ at=#1} |
| 639 |
{ |
| 640 |
\__tikzcalendarnotes_try_insert_cntweek:VV |
| 641 |
\l__tikzcalendarnotes_from_key_tl |
| 642 |
\l__tikzcalendarnotes_to_key_tl |
| 643 |
\int_gset:cn {g__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ \l__tikzcalendarnotes_from_key_tl : \l__tikzcalendarnotes_to_key_tl _cnt _int} |
| 644 |
{#1 - 1} |
| 645 |
} |
| 646 |
} , |
| 647 |
starting~ at .value_required:n = true , |
| 648 |
} |
| 649 |
|
| 650 |
|
| 651 |
%%%%%%%%%%%%%%%%%% |
| 652 |
%%%%%%%%%%%%%%%%%% |
| 653 |
%% |
| 654 |
%% |
| 655 |
%% |
| 656 |
%%%%%%%%%%%%%%%%%% |
| 657 |
%%%%%%%%%%%%%%%%%% |
| 658 |
|
| 659 |
|
| 660 |
\cs_new_protected:Npn \__tikzcalendarnotes_keycode:nnnn #1#2#3#4 |
| 661 |
{ |
| 662 |
\bool_if:nTF |
| 663 |
{\l__tikzcalendarnotes_date_set_flag_bool || \l__tikzcalendarnotes_from_set_flag_bool && \l__tikzcalendarnotes_to_set_flag_bool} |
| 664 |
{ |
| 665 |
\bool_if:NT \l__tikzcalendarnotes_range_case_bool |
| 666 |
{ |
| 667 |
\__tikzcalendarnotes_try_insert_range:VV |
| 668 |
\l__tikzcalendarnotes_from_key_tl |
| 669 |
\l__tikzcalendarnotes_to_key_tl |
| 670 |
} |
| 671 |
\prop_put:cnn {l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ \l__tikzcalendarnotes_date_tl _prop} |
| 672 |
{#3} {#4} |
| 673 |
} |
| 674 |
{ |
| 675 |
\msg_error:nVne {tikzcalendarnotes}{\l__tikzcalendarnotes_msg_submodule_tl}{#1}{#2} |
| 676 |
} |
| 677 |
} |
| 678 |
|
| 679 |
\cs_new_protected:Npn \__tikzcalendarnotes_keycode:nnn #1#2#3 |
| 680 |
{ |
| 681 |
\bool_if:nTF |
| 682 |
{\l__tikzcalendarnotes_date_set_flag_bool || \l__tikzcalendarnotes_from_set_flag_bool && \l__tikzcalendarnotes_to_set_flag_bool} |
| 683 |
{ |
| 684 |
\bool_if:NT \l__tikzcalendarnotes_range_case_bool |
| 685 |
{ |
| 686 |
\__tikzcalendarnotes_try_insert_range:VV |
| 687 |
\l__tikzcalendarnotes_from_key_tl |
| 688 |
\l__tikzcalendarnotes_to_key_tl |
| 689 |
} |
| 690 |
#3 |
| 691 |
} |
| 692 |
{ |
| 693 |
\msg_error:nVne {tikzcalendarnotes}{\l__tikzcalendarnotes_msg_submodule_tl}{#1}{#2} |
| 694 |
} |
| 695 |
} |
| 696 |
|
| 697 |
\cs_generate_variant:Nn \tl_set:Nn {Ne} |
| 698 |
\cs_generate_variant:Nn \tl_gset:Nn {Ne} |
| 699 |
|
| 700 |
|
| 701 |
\makeatletter |
| 702 |
\cs_new_protected:Npn \__tikzcalendarnotes_set_dim_constants: |
| 703 |
{ |
| 704 |
\tl_set:Ne \l__tikzcalendarnotes_ref_fontsize_tl {\f@size} |
| 705 |
|
| 706 |
\tl_set:Ne \l__tikzcalendarnotes_TXshift_scaled_tl |
| 707 |
{ |
| 708 |
\fp_eval:n {0.6 * \l__tikzcalendarnotes_ref_fontsize_tl + 2pt} pt |
| 709 |
} |
| 710 |
\tl_set:Ne \l__tikzcalendarnotes_TYshift_scaled_tl |
| 711 |
{ |
| 712 |
\fp_eval:n {0.35 * \l__tikzcalendarnotes_ref_fontsize_tl + 0.5pt} pt |
| 713 |
} |
| 714 |
|
| 715 |
\tl_set:Ne \l__tikzcalendarnotes_radius_scaled_tl |
| 716 |
{ |
| 717 |
\fp_eval:n {(5.75pt * \l__tikzcalendarnotes_ref_fontsize_tl) / 10pt } pt |
| 718 |
} |
| 719 |
} |
| 720 |
\makeatother |
| 721 |
|
| 722 |
|
| 723 |
|
| 724 |
|
| 725 |
\cs_new_protected:Npn \__tikzcalendarnotes_reset_defaults: |
| 726 |
{ |
| 727 |
\bool_set_false:N \l__tikzcalendarnotes_date_set_flag_bool |
| 728 |
\bool_set_false:N \l__tikzcalendarnotes_hldates_set_flag_bool |
| 729 |
\bool_set_false:N \l__tikzcalendarnotes_from_set_flag_bool |
| 730 |
\bool_set_false:N \l__tikzcalendarnotes_to_set_flag_bool |
| 731 |
\bool_set_false:N \l__tikzcalendarnotes_date_case_bool |
| 732 |
\bool_set_false:N \l__tikzcalendarnotes_hldates_case_bool |
| 733 |
\bool_set_false:N \l__tikzcalendarnotes_range_case_bool |
| 734 |
\bool_set_false:N \l__tikzcalendarnotes_cntweek_case_bool |
| 735 |
\bool_set_false:N \l__tikzcalendarnotes_nocntweek_case_bool |
| 736 |
|
| 737 |
\tl_set:Nn \l__tikzcalendarnotes_hl_color_key_tl |
| 738 |
{lightgray} |
| 739 |
} |
| 740 |
|
| 741 |
|
| 742 |
|
| 743 |
%%%%%%%%%%%%%%%%%% |
| 744 |
%%%%%%%%%%%%%%%%%% |
| 745 |
%% |
| 746 |
%% |
| 747 |
%% |
| 748 |
%%%%%%%%%%%%%%%%%% |
| 749 |
%%%%%%%%%%%%%%%%%% |
| 750 |
|
| 751 |
\cs_new_protected:Npn \__tikzcalendarnotes_markdraw:nnn #1#2#3 |
| 752 |
{ |
| 753 |
\draw [#1] |
| 754 |
(#3.center) |
| 755 |
++(-#2 , -#2) |
| 756 |
rectangle |
| 757 |
++(2*#2 , 2*#2) ; |
| 758 |
} |
| 759 |
|
| 760 |
\cs_generate_variant:Nn \__tikzcalendarnotes_markdraw:nnn {eee} |
| 761 |
|
| 762 |
\cs_new_protected:Npn \__tikzcalendarnotes_markdraw_range:nnnn #1#2#3#4 |
| 763 |
{ |
| 764 |
\draw [#1] |
| 765 |
(#3.center) |
| 766 |
++(-#2 , #2) coordinate(A) |
| 767 |
(#4.center) |
| 768 |
++( #2 , -#2) |
| 769 |
rectangle (A) ; |
| 770 |
} |
| 771 |
|
| 772 |
\cs_generate_variant:Nn \__tikzcalendarnotes_markdraw_range:nnnn {eeee} |
| 773 |
|
| 774 |
|
| 775 |
%%%%%%%%%%%%%%%%%% |
| 776 |
%%%%%%%%%%%%%%%%%% |
| 777 |
%% |
| 778 |
%% |
| 779 |
%% |
| 780 |
%%%%%%%%%%%%%%%%%% |
| 781 |
%%%%%%%%%%%%%%%%%% |
| 782 |
|
| 783 |
|
| 784 |
\cs_new_protected:Npn \__tikzcalendarnotes_new_dataset:n #1 |
| 785 |
{ |
| 786 |
\seq_if_exist:cTF {l__tikzcalendarnotes_ #1 _dataset_seq} |
| 787 |
{ |
| 788 |
\msg_warning:nnne |
| 789 |
{tikzcalendarnotes}{dataset already defined} |
| 790 |
{new~01}{#1} |
| 791 |
} |
| 792 |
{ |
| 793 |
\seq_new:c {l__tikzcalendarnotes_ #1 _dataset_seq} |
| 794 |
\seq_new:c {l__tikzcalendarnotes_ #1 _range_seq} |
| 795 |
\seq_put_right:Nn \l__tikzcalendarnotes_dataset_seq {#1} |
| 796 |
\seq_new:c {l__tikzcalendarnotes_ #1 _cnt week_seq} |
| 797 |
\seq_new:c {l__tikzcalendarnotes_ #1 _no cntweek_seq} |
| 798 |
\bool_new:c {l__tikzcalendarnotes_ #1 _cnt flag_bool} %for the 1st of every month |
| 799 |
\tl_new:c {l__tikzcalendarnotes_ #1 _cnt hack_tl} %for the 1st of every month |
| 800 |
} |
| 801 |
} |
| 802 |
|
| 803 |
\cs_new_protected:Npn \__tikzcalendarnotes_select_dataset:n #1 |
| 804 |
{ |
| 805 |
\seq_if_exist:cTF {l__tikzcalendarnotes_ #1 _dataset_seq} |
| 806 |
{ |
| 807 |
\tl_set:Nn \l__tikzcalendarnotes_active_dataset_tl {#1} |
| 808 |
} |
| 809 |
{ |
| 810 |
\msg_error:nnne |
| 811 |
{tikzcalendarnotes}{invalid dataset} |
| 812 |
{select~01}{#1} |
| 813 |
} |
| 814 |
} |
| 815 |
|
| 816 |
\__tikzcalendarnotes_new_dataset:n {default} |
| 817 |
\__tikzcalendarnotes_select_dataset:n {default} |
| 818 |
|
| 819 |
|
| 820 |
%%%%%%%%%%%%%%%%%% |
| 821 |
%%%%%%%%%%%%%%%%%% |
| 822 |
%% |
| 823 |
%% |
| 824 |
%% |
| 825 |
%%%%%%%%%%%%%%%%%% |
| 826 |
%%%%%%%%%%%%%%%%%% |
| 827 |
|
| 828 |
|
| 829 |
|
| 830 |
\cs_new_protected:Npn \__tikzcalendarnotes_try_insert_date:nn #1#2 |
| 831 |
{ |
| 832 |
\prop_if_exist:cF {l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ #1 _prop} |
| 833 |
{ |
| 834 |
\prop_new:c {l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ #1 _prop} |
| 835 |
\seq_put_right:cn |
| 836 |
{ l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _dataset_seq } |
| 837 |
{ #1 } |
| 838 |
%defaults |
| 839 |
\prop_put_from_keyval:cn |
| 840 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ #1 _prop} |
| 841 |
{ |
| 842 |
remark posref = north~ east , |
| 843 |
remark anchor = south~ west , |
| 844 |
TX shift = -\l__tikzcalendarnotes_TXshift_scaled_tl , |
| 845 |
TY shift = -\l__tikzcalendarnotes_TYshift_scaled_tl , |
| 846 |
date ref = #1 , |
| 847 |
} |
| 848 |
} |
| 849 |
\tl_set:Nn \l__tikzcalendarnotes_date_tl {#1} |
| 850 |
|
| 851 |
\tl_if_blank:nF {#2} |
| 852 |
{ |
| 853 |
\prop_put:cnn |
| 854 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ \l__tikzcalendarnotes_date_tl _prop} |
| 855 |
{day color} {#2} |
| 856 |
} |
| 857 |
|
| 858 |
} |
| 859 |
|
| 860 |
\cs_generate_variant:Nn \__tikzcalendarnotes_try_insert_date:nn {nV} |
| 861 |
|
| 862 |
\cs_new_protected:Npn \__tikzcalendarnotes_try_insert_range:nn #1#2 |
| 863 |
{ |
| 864 |
\prop_if_exist:cF {l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ #1 : #2 _range _prop} |
| 865 |
{ |
| 866 |
\prop_new:c {l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ #1 : #2 _range _prop} |
| 867 |
\seq_put_right:cn |
| 868 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _range_seq} |
| 869 |
{#1 : #2 _range} |
| 870 |
\tl_set:Nn \l__tikzcalendarnotes_date_tl |
| 871 |
{#1 : #2 _range} |
| 872 |
|
| 873 |
\prop_put_from_keyval:cn |
| 874 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ #1 : #2 _range _prop} |
| 875 |
{ |
| 876 |
from = #1 , |
| 877 |
to = #2 , |
| 878 |
remark posref = north~ east , |
| 879 |
remark anchor = south~ west , |
| 880 |
TX shift = -\l__tikzcalendarnotes_TXshift_scaled_tl , |
| 881 |
TY shift = -\l__tikzcalendarnotes_TYshift_scaled_tl , |
| 882 |
date ref = #2 , |
| 883 |
} |
| 884 |
} |
| 885 |
|
| 886 |
} |
| 887 |
|
| 888 |
\cs_generate_variant:Nn \__tikzcalendarnotes_try_insert_range:nn {VV} |
| 889 |
|
| 890 |
|
| 891 |
|
| 892 |
\cs_new_protected:Npn \__tikzcalendarnotes_try_insert_no_cntweek:nn #1#2 |
| 893 |
{ |
| 894 |
\prop_if_exist:cF {l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ #1 : #2 _ncnt _prop} |
| 895 |
{ |
| 896 |
\prop_new:c {l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ #1 : #2 _ncnt _prop} |
| 897 |
\seq_put_right:cn |
| 898 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _nocntweek_seq} |
| 899 |
{#1 : #2 _ncnt } |
| 900 |
|
| 901 |
\prop_put_from_keyval:cn |
| 902 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ #1 : #2 _ncnt _prop} |
| 903 |
{ |
| 904 |
from = #1 , |
| 905 |
to = #2 , |
| 906 |
} |
| 907 |
} |
| 908 |
\tl_set:Nn \l__tikzcalendarnotes_date_tl |
| 909 |
{#1 : #2 _ncnt } |
| 910 |
} |
| 911 |
|
| 912 |
\cs_generate_variant:Nn \__tikzcalendarnotes_try_insert_no_cntweek:nn {VV} |
| 913 |
|
| 914 |
|
| 915 |
|
| 916 |
\cs_new_protected:Npn \__tikzcalendarnotes_try_insert_cntweek:nn #1#2 |
| 917 |
{ |
| 918 |
\prop_if_exist:cF {l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ #1 : #2 _cnt _prop} |
| 919 |
{ |
| 920 |
\prop_new:c {l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ #1 : #2 _cnt _prop} |
| 921 |
\seq_put_right:cn |
| 922 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _cntweek_seq} |
| 923 |
{#1 : #2 _cnt} |
| 924 |
|
| 925 |
% the counter is global because months are typed in consecutive scopes, and not in a single go... |
| 926 |
\int_new:c {g__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ #1 : #2 _cnt _int} |
| 927 |
|
| 928 |
\prop_put_from_keyval:cn |
| 929 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ #1 : #2 _cnt _prop} |
| 930 |
{ |
| 931 |
from = #1 , |
| 932 |
to = #2 , |
| 933 |
cnt posref = west , |
| 934 |
cnt anchor = east , |
| 935 |
TX shift = \l__tikzcalendarnotes_TXshift_scaled_tl , |
| 936 |
TY shift = 0pt , |
| 937 |
color = , |
| 938 |
} |
| 939 |
} |
| 940 |
\tl_set:Nn \l__tikzcalendarnotes_date_tl |
| 941 |
{#1 : #2 _cnt} |
| 942 |
} |
| 943 |
|
| 944 |
\cs_generate_variant:Nn \__tikzcalendarnotes_try_insert_cntweek:nn {VV} |
| 945 |
|
| 946 |
|
| 947 |
|
| 948 |
%%%%%%%%%%%%%%%%%% |
| 949 |
%%%%%%%%%%%%%%%%%% |
| 950 |
%% |
| 951 |
%% |
| 952 |
%% |
| 953 |
%%%%%%%%%%%%%%%%%% |
| 954 |
%%%%%%%%%%%%%%%%%% |
| 955 |
|
| 956 |
|
| 957 |
\cs_new_protected:Npn \__tikzcalendarnotes_month_matrix:nnnn #1#2#3#4 %year ,first ,n months ,per line |
| 958 |
{ |
| 959 |
\int_set:Nn \l__tikzcalendarnotes_year_int {#1} |
| 960 |
\int_set:Nn \l__tikzcalendarnotes_month_int {#2} |
| 961 |
\int_set:Nn \l__tikzcalendarnotes_cnta_int {0} |
| 962 |
\int_set:Nn \l__tikzcalendarnotes_cntb_int {0} |
| 963 |
\tl_set:Nn \l__tikzcalendarnotes_tmpb_tl {} |
| 964 |
|
| 965 |
|
| 966 |
\int_while_do:nNnn {\l__tikzcalendarnotes_cnta_int} < {#3} |
| 967 |
{ |
| 968 |
\tl_put_right:Ne \l__tikzcalendarnotes_tmpb_tl |
| 969 |
{ |
| 970 |
\exp_not:N \calendar[ |
| 971 |
day~ xshift=\l__tikzcalendarnotes_dayspacing_Xshift_key_tl pt, |
| 972 |
day~ yshift=\l__tikzcalendarnotes_weekspacing_Yshift_key_tl pt, |
| 973 |
name=\l__tikzcalendarnotes_cal_name_key_tl , |
| 974 |
dates=\int_use:N\l__tikzcalendarnotes_year_int - \int_use:N\l__tikzcalendarnotes_month_int -01 |
| 975 |
~ to ~ |
| 976 |
\int_use:N\l__tikzcalendarnotes_year_int - \int_use:N\l__tikzcalendarnotes_month_int -last |
| 977 |
] ; |
| 978 |
} |
| 979 |
\int_incr:N \l__tikzcalendarnotes_cnta_int |
| 980 |
\int_compare:nNnTF {\l__tikzcalendarnotes_cnta_int} = {#3} |
| 981 |
{ |
| 982 |
\tl_put_right:Nn \l__tikzcalendarnotes_tmpb_tl { \\ } |
| 983 |
} |
| 984 |
{ |
| 985 |
\int_incr:N \l__tikzcalendarnotes_cntb_int |
| 986 |
\int_compare:nNnTF {\l__tikzcalendarnotes_cntb_int} < {#4} |
| 987 |
{ |
| 988 |
\tl_put_right:Nn \l__tikzcalendarnotes_tmpb_tl { ~ \pgfmatrixnextcell ~ } |
| 989 |
} |
| 990 |
{ |
| 991 |
\tl_put_right:Nn \l__tikzcalendarnotes_tmpb_tl { \\ } |
| 992 |
\int_set:Nn \l__tikzcalendarnotes_cntb_int {0} |
| 993 |
} |
| 994 |
\int_incr:N \l__tikzcalendarnotes_month_int |
| 995 |
\int_compare:nNnTF {\l__tikzcalendarnotes_month_int} < {13} |
| 996 |
{} |
| 997 |
{ |
| 998 |
\int_set:Nn \l__tikzcalendarnotes_month_int {1} |
| 999 |
\int_incr:N \l__tikzcalendarnotes_year_int |
| 1000 |
} |
| 1001 |
} |
| 1002 |
} |
| 1003 |
|
| 1004 |
\l__tikzcalendarnotes_tmpb_tl |
| 1005 |
} |
| 1006 |
|
| 1007 |
|
| 1008 |
\makeatletter |
| 1009 |
\cs_new_eq:NN \__tikzcalendarnotes_tikz_xshift \tikz@lib@cal@xshift |
| 1010 |
\makeatother |
| 1011 |
|
| 1012 |
\cs_new_protected:Npn \__tikzcalendarnotes_ifdate_case_counting_tl_set:NNNnnnn #1#2#3#4#5#6#7 |
| 1013 |
{ |
| 1014 |
\bool_if:NF \l__tikzcalendarnotes_keep_counters_pgfkey_bool |
| 1015 |
{ \int_gzero:N #2 } |
| 1016 |
|
| 1017 |
\tl_put_right:Nn #1 |
| 1018 |
{ |
| 1019 |
\ifdate{#7} |
| 1020 |
{ |
| 1021 |
\int_gincr:N #2 |
| 1022 |
\draw (\pgfcalendarsuggestedname.#4) |
| 1023 |
++(#6) |
| 1024 |
node[#5](){ \int_use:N #2 } ; |
| 1025 |
\tl_gput_right:Nn #3 |
| 1026 |
{ |
| 1027 |
\draw (\pgfcalendarsuggestedname.#4 |- \l__tikzcalendarnotes_cal_name_key_tl - \pgfcalendarifdateyear - \pgfcalendarifdatemonth - 01.#4) |
| 1028 |
++(#6) |
| 1029 |
node[#5](){ \int_use:N #2 } ; |
| 1030 |
} |
| 1031 |
} |
| 1032 |
{} |
| 1033 |
} |
| 1034 |
} |
| 1035 |
|
| 1036 |
\cs_generate_variant:Nn \__tikzcalendarnotes_ifdate_case_counting_tl_set:NNNnnnn {NccVeee} |
| 1037 |
|
| 1038 |
|
| 1039 |
\cs_new_protected:Npn \__tikzcalendarnotes_pgfcalifdate_case_counting_tl_set:NNNnnnn #1#2#3#4#5#6#7 |
| 1040 |
{ |
| 1041 |
|
| 1042 |
\tl_put_right:Nn #1 |
| 1043 |
{ |
| 1044 |
\pgfcalendarifdate{##1}{#7} |
| 1045 |
{ |
| 1046 |
\int_compare:nNnT {\int_use:N #2} = {0} |
| 1047 |
{ \int_gincr:N #2 } |
| 1048 |
\tl_gput_right:Nn #3 |
| 1049 |
{ |
| 1050 |
\draw (\pgfcalendarsuggestedname.#4 |- \l__tikzcalendarnotes_cal_name_key_tl - \pgfcalendarifdateyear - \pgfcalendarifdatemonth - 01.#4) |
| 1051 |
++(#6) |
| 1052 |
node[#5](){ \int_use:N #2 } ; |
| 1053 |
} |
| 1054 |
} |
| 1055 |
{} |
| 1056 |
} |
| 1057 |
} |
| 1058 |
\cs_generate_variant:Nn \__tikzcalendarnotes_pgfcalifdate_case_counting_tl_set:NNNnnnn {NccVeee} |
| 1059 |
|
| 1060 |
|
| 1061 |
\cs_generate_variant:Nn \use:n {V} |
| 1062 |
|
| 1063 |
\cs_new_protected:Npn \__tikzcalendarnotes_ifdate_case_no_tl_set:Nnn #1#2#3 |
| 1064 |
{ |
| 1065 |
\tl_set:Nn #1 |
| 1066 |
{ |
| 1067 |
\ifdate{#3} |
| 1068 |
{} |
| 1069 |
{ #2 } |
| 1070 |
} |
| 1071 |
} |
| 1072 |
|
| 1073 |
\cs_generate_variant:Nn \__tikzcalendarnotes_ifdate_case_no_tl_set:Nnn {NVe} |
| 1074 |
|
| 1075 |
|
| 1076 |
|
| 1077 |
|
| 1078 |
\cs_new_protected:Npn \__tikzcalendarnotes_pgfcalifdate_case_no_tl_set:Nnn #1#2#3 |
| 1079 |
{ |
| 1080 |
\tl_set:Nn #1 |
| 1081 |
{ |
| 1082 |
\pgfcalendarifdate{##1}{#3} |
| 1083 |
{} |
| 1084 |
{ #2 } |
| 1085 |
} |
| 1086 |
} |
| 1087 |
|
| 1088 |
\cs_generate_variant:Nn \__tikzcalendarnotes_pgfcalifdate_case_no_tl_set:Nnn {NVe} |
| 1089 |
|
| 1090 |
|
| 1091 |
\cs_new_protected:Npn \__tikzcalendarnotes_shift_adjust_tl_set:Nn #1#2 |
| 1092 |
{ |
| 1093 |
\fp_compare:nNnTF {#1} < {0} |
| 1094 |
{ |
| 1095 |
\tl_set:Ne #1 |
| 1096 |
{ |
| 1097 |
\fp_eval:n {#1 + (#2)} pt |
| 1098 |
} |
| 1099 |
} |
| 1100 |
{ |
| 1101 |
\tl_set:Ne #1 |
| 1102 |
{ |
| 1103 |
\fp_eval:n {#1 - (#2)} pt |
| 1104 |
} |
| 1105 |
} |
| 1106 |
} |
| 1107 |
|
| 1108 |
\cs_generate_variant:Nn \__tikzcalendarnotes_shift_adjust_tl_set:Nn {NV} |
| 1109 |
|
| 1110 |
\cs_new_protected:Npn \__tikzcalendarnotes_append_pgfcalifdate_test:n #1 |
| 1111 |
{ |
| 1112 |
\pgfkeys |
| 1113 |
{ |
| 1114 |
tikz , |
| 1115 |
@calnotes@cnt@if@/.append~ code = {#1} , |
| 1116 |
} |
| 1117 |
} |
| 1118 |
\cs_generate_variant:Nn \__tikzcalendarnotes_append_pgfcalifdate_test:n {V} |
| 1119 |
|
| 1120 |
|
| 1121 |
\cs_new_protected:Npn \__tikzcalendarnotes_set_ifdate_before_day:nn #1#2 |
| 1122 |
{ |
| 1123 |
\pgfkeys |
| 1124 |
{ |
| 1125 |
tikz, |
| 1126 |
@calnotes@cnt@if@/.code = {} , |
| 1127 |
execute~ before~ day~ scope = |
| 1128 |
{ |
| 1129 |
\ifdate{equals = #1} |
| 1130 |
{ |
| 1131 |
\pgfkeys |
| 1132 |
{ tikz, |
| 1133 |
@calnotes@cnt@if@ = |
| 1134 |
{ |
| 1135 |
#1+ - \int_eval:n {\pgfcalendarcurrentweekday + #2} |
| 1136 |
} |
| 1137 |
} |
| 1138 |
} |
| 1139 |
{} |
| 1140 |
} |
| 1141 |
} |
| 1142 |
} |
| 1143 |
\cs_generate_variant:Nn \__tikzcalendarnotes_set_ifdate_before_day:nn {Ve} |
| 1144 |
|
| 1145 |
|
| 1146 |
|
| 1147 |
|
| 1148 |
|
| 1149 |
|
| 1150 |
% #1 l__tikzcalendarnotes_ ##1 _cnt flag_bool |
| 1151 |
% #2 l__tikzcalendarnotes_ ##1 _cnt hack_tl |
| 1152 |
% #3 \l__tikzcalendarnotes_cnt_ifdate_temp_tl |
| 1153 |
% |
| 1154 |
% #1 => #3 |
| 1155 |
% #2 => #1 |
| 1156 |
% #3 => #2 |
| 1157 |
% |
| 1158 |
\cs_new_protected:Npn \__tikzcalendarnotes_append_tikz_ifdate_after_day:NNn #1#2#3 |
| 1159 |
{ |
| 1160 |
\pgfkeys |
| 1161 |
{tikz , |
| 1162 |
execute~ after~ day~ scope= |
| 1163 |
{ |
| 1164 |
\ifdate{\l__tikzcalendarnotes_weeklist_starts_on_tl} |
| 1165 |
{ |
| 1166 |
\bool_if:NT #1 |
| 1167 |
{ |
| 1168 |
\tl_use:N #2 |
| 1169 |
\bool_set_false:N #1 |
| 1170 |
} |
| 1171 |
\tl_gclear:N #2 |
| 1172 |
#3 |
| 1173 |
} |
| 1174 |
{ |
| 1175 |
\ifdate{day~ of~ month = 1} |
| 1176 |
{ \bool_set_true:N #1 } |
| 1177 |
{} |
| 1178 |
} |
| 1179 |
} |
| 1180 |
} |
| 1181 |
} |
| 1182 |
|
| 1183 |
\cs_generate_variant:Nn \__tikzcalendarnotes_append_tikz_ifdate_after_day:NNn {ccV} |
| 1184 |
|
| 1185 |
|
| 1186 |
\cs_new_protected:Npn \__tikzcalendarnotes_append_every_calendar_if:nn #1#2 |
| 1187 |
{ |
| 1188 |
\pgfkeys |
| 1189 |
{ |
| 1190 |
tikz , |
| 1191 |
every~ calendar/.append~ style= |
| 1192 |
{ |
| 1193 |
if = { (#1) [#2] } |
| 1194 |
} |
| 1195 |
} |
| 1196 |
|
| 1197 |
} |
| 1198 |
\cs_generate_variant:Nn \__tikzcalendarnotes_append_every_calendar_if:nn {ee} |
| 1199 |
|
| 1200 |
|
| 1201 |
\prg_generate_conditional_variant:Nnn \fp_compare:nNn {V} {T, F, TF} |
| 1202 |
|
| 1203 |
\cs_new_protected:Npn \__tikzcalendarnotes_set_ifdates:n #1 |
| 1204 |
{ |
| 1205 |
\__tikzcalendarnotes_set_ifdate_before_day:Ve |
| 1206 |
\l__tikzcalendarnotes_begin_iso_tl |
| 1207 |
{\int_use:N \l__tikzcalendarnotes_weeklist_delta_int} |
| 1208 |
|
| 1209 |
|
| 1210 |
\clist_set:Nn \l__tikzcalendarnotes_tmpa_clist {#1} |
| 1211 |
\clist_map_inline:Nn \l__tikzcalendarnotes_tmpa_clist |
| 1212 |
{ |
| 1213 |
\tl_clear:N \l__tikzcalendarnotes_cnt_ifdate_temp_tl |
| 1214 |
\tl_clear:N \l__tikzcalendarnotes_cnt_pgfcalifdate_temp_tl |
| 1215 |
\__tikzcalendarnotes_select_dataset:n {##1} |
| 1216 |
\tl_clear:c {l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _cnt hack_tl} |
| 1217 |
\seq_map_inline:cn { l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _dataset_seq} |
| 1218 |
{ |
| 1219 |
\prop_get:cnNT |
| 1220 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ ####1 _prop} |
| 1221 |
{day color} \l__tikzcalendarnotes_daycolor_tmp_tl |
| 1222 |
{ |
| 1223 |
\__tikzcalendarnotes_append_every_calendar_if:ee |
| 1224 |
{equals=####1} |
| 1225 |
{color=\l__tikzcalendarnotes_daycolor_tmp_tl} |
| 1226 |
} |
| 1227 |
} |
| 1228 |
|
| 1229 |
\seq_map_inline:cn { l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _range_seq} |
| 1230 |
{ |
| 1231 |
\prop_get:cnNT |
| 1232 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ ####1 _prop} |
| 1233 |
{day color} \l__tikzcalendarnotes_daycolor_tmp_tl |
| 1234 |
{ |
| 1235 |
\prop_get:cnN |
| 1236 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ ####1 _prop} |
| 1237 |
{from} \l__tikzcalendarnotes_from_tmp_tl |
| 1238 |
\prop_get:cnN |
| 1239 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ ####1 _prop} |
| 1240 |
{to} \l__tikzcalendarnotes_to_tmp_tl |
| 1241 |
|
| 1242 |
\__tikzcalendarnotes_append_every_calendar_if:ee |
| 1243 |
{between=\l__tikzcalendarnotes_from_tmp_tl and \l__tikzcalendarnotes_to_tmp_tl} |
| 1244 |
{color=\l__tikzcalendarnotes_daycolor_tmp_tl} |
| 1245 |
} |
| 1246 |
} |
| 1247 |
|
| 1248 |
\seq_map_inline:cn { l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ cnt week_seq} |
| 1249 |
{ |
| 1250 |
\prop_map_inline:cn {l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ ####1 _prop} |
| 1251 |
{ |
| 1252 |
\tl_set:cn {l__tikzcalendarnotes_ ########1 _tmp_tl} {########2} |
| 1253 |
} |
| 1254 |
|
| 1255 |
\__tikzcalendarnotes_shift_adjust_tl_set:NV |
| 1256 |
\l__tikzcalendarnotes_TXshift_tmp_tl |
| 1257 |
\l__tikzcalendarnotes_remark_Xshift_adj_pgfkey_tl |
| 1258 |
|
| 1259 |
|
| 1260 |
\fp_compare:VNnF \l__tikzcalendarnotes_TYshift_tmp_tl = {0} |
| 1261 |
{ |
| 1262 |
\__tikzcalendarnotes_shift_adjust_tl_set:NV |
| 1263 |
\l__tikzcalendarnotes_TYshift_tmp_tl |
| 1264 |
\l__tikzcalendarnotes_remark_Yshift_adj_pgfkey_tl |
| 1265 |
} |
| 1266 |
|
| 1267 |
|
| 1268 |
\__tikzcalendarnotes_ifdate_case_counting_tl_set:NccVeee |
| 1269 |
\l__tikzcalendarnotes_cnt_ifdate_temp_tl |
| 1270 |
{g__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ ####1 _int} |
| 1271 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _cnt hack_tl} |
| 1272 |
\l__tikzcalendarnotes_cntposref_tmp_tl |
| 1273 |
{anchor=\l__tikzcalendarnotes_cntanchor_tmp_tl , every~ counter , \l__tikzcalendarnotes_color_tmp_tl} |
| 1274 |
{0.7*\l__tikzcalendarnotes_TXshift_tmp_tl , 1.5*\l__tikzcalendarnotes_TYshift_tmp_tl} |
| 1275 |
{between = \l__tikzcalendarnotes_from_tmp_tl+-6 and \l__tikzcalendarnotes_to_tmp_tl} |
| 1276 |
|
| 1277 |
\__tikzcalendarnotes_pgfcalifdate_case_counting_tl_set:NccVeee |
| 1278 |
\l__tikzcalendarnotes_cnt_pgfcalifdate_temp_tl |
| 1279 |
{g__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ ####1 _int} |
| 1280 |
{l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _cnt hack_tl} |
| 1281 |
\l__tikzcalendarnotes_cntposref_tmp_tl |
| 1282 |
{anchor=\l__tikzcalendarnotes_cntanchor_tmp_tl , every~ counter , \l__tikzcalendarnotes_color_tmp_tl} |
| 1283 |
{0.7*\l__tikzcalendarnotes_TXshift_tmp_tl , 1.5*\l__tikzcalendarnotes_TYshift_tmp_tl} |
| 1284 |
{between = \l__tikzcalendarnotes_from_tmp_tl+-6 and \l__tikzcalendarnotes_to_tmp_tl} |
| 1285 |
|
| 1286 |
} % end of cntweek for this <dataset> |
| 1287 |
|
| 1288 |
\seq_map_inline:cn { l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ no cnt week_seq} |
| 1289 |
{ |
| 1290 |
\prop_map_inline:cn {l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ ####1 _prop} |
| 1291 |
{ |
| 1292 |
\tl_set:cn {l__tikzcalendarnotes_ ########1 _tmp_tl} {########2} |
| 1293 |
} |
| 1294 |
|
| 1295 |
\__tikzcalendarnotes_ifdate_case_no_tl_set:NVe |
| 1296 |
\l__tikzcalendarnotes_cnt_ifdate_temp_tl |
| 1297 |
\l__tikzcalendarnotes_cnt_ifdate_temp_tl |
| 1298 |
{between = \l__tikzcalendarnotes_from_tmp_tl+-6 and \l__tikzcalendarnotes_to_tmp_tl} |
| 1299 |
|
| 1300 |
\__tikzcalendarnotes_pgfcalifdate_case_no_tl_set:NVe |
| 1301 |
\l__tikzcalendarnotes_cnt_pgfcalifdate_temp_tl |
| 1302 |
\l__tikzcalendarnotes_cnt_pgfcalifdate_temp_tl |
| 1303 |
{between = \l__tikzcalendarnotes_from_tmp_tl+-6 and \l__tikzcalendarnotes_to_tmp_tl} |
| 1304 |
|
| 1305 |
} % end of no cntweek for this dataset |
| 1306 |
|
| 1307 |
\tl_if_empty:NF \l__tikzcalendarnotes_cnt_ifdate_temp_tl |
| 1308 |
{ |
| 1309 |
\__tikzcalendarnotes_append_tikz_ifdate_after_day:ccV |
| 1310 |
{l__tikzcalendarnotes_ ##1 _cnt flag_bool} |
| 1311 |
{l__tikzcalendarnotes_ ##1 _cnt hack_tl} |
| 1312 |
\l__tikzcalendarnotes_cnt_ifdate_temp_tl |
| 1313 |
|
| 1314 |
\__tikzcalendarnotes_append_pgfcalifdate_test:V |
| 1315 |
\l__tikzcalendarnotes_cnt_pgfcalifdate_temp_tl |
| 1316 |
} |
| 1317 |
|
| 1318 |
} % end of clist <datasets> |
| 1319 |
|
| 1320 |
|
| 1321 |
} |
| 1322 |
|
| 1323 |
\cs_generate_variant:Nn \__tikzcalendarnotes_set_ifdates:n {V} |
| 1324 |
|
| 1325 |
|
| 1326 |
%% from https://tex.stackexchange.com/questions/37709/how-can-i-know-if-a-node-is-already-defined/37713#37713 |
| 1327 |
%% yickes |
| 1328 |
%% non portable, error prone if the underlining pgf scheme changes... :/ |
| 1329 |
%% |
| 1330 |
\makeatletter |
| 1331 |
\cs_new_protected:Npn \__tikzcalendarnotes_setflag_ifdatenode_exist:Nn #1#2 |
| 1332 |
{ |
| 1333 |
\cs_if_exist:cTF {pgf@sh@ns@ \l__tikzcalendarnotes_cal_name_key_tl - #2} |
| 1334 |
{ |
| 1335 |
\tl_if_eq:cNTF {pgf@sh@pi@ \l__tikzcalendarnotes_cal_name_key_tl - #2} \pgfpictureid |
| 1336 |
{ \bool_set_true:N #1 } |
| 1337 |
{ \bool_set_false:N #1 } |
| 1338 |
} |
| 1339 |
{ \bool_set_false:N #1 } |
| 1340 |
} |
| 1341 |
\makeatother |
| 1342 |
|
| 1343 |
\cs_generate_variant:Nn \__tikzcalendarnotes_setflag_ifdatenode_exist:Nn {NV} |
| 1344 |
|
| 1345 |
|
| 1346 |
\cs_new_protected:Npn \__tizecalendarnotes_notes_typeset:nn #1#2 |
| 1347 |
{ |
| 1348 |
\vcoffin_set:Nnn \l__tikzcalendarnotes_tmpa_coffin |
| 1349 |
{\fp_eval:n{#1 - 0.75em}pt} {#2} |
| 1350 |
\coffin_typeset:Nnnnn \l__tikzcalendarnotes_tmpa_coffin |
| 1351 |
{l}{t} |
| 1352 |
{0pt}{0pt} |
| 1353 |
} |
| 1354 |
|
| 1355 |
\cs_new_protected:Npn \__tikzcalendarnotes_draw_notes:n #1 |
| 1356 |
{ |
| 1357 |
\tl_set:Ne \l__tikzcalendarnotes_radius_tmp_tl |
| 1358 |
{ |
| 1359 |
\fp_eval:n {\l__tikzcalendarnotes_radius_scaled_tl + \l__tikzcalendarnotes_radius_adj_pgfkey_tl} pt |
| 1360 |
} |
| 1361 |
|
| 1362 |
\clist_set:Nn \l__tikzcalendarnotes_tmpa_clist {#1} |
| 1363 |
\clist_map_inline:Nn \l__tikzcalendarnotes_tmpa_clist |
| 1364 |
{ |
| 1365 |
\__tikzcalendarnotes_select_dataset:n {##1} |
| 1366 |
\seq_map_inline:cn { l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _dataset_seq} |
| 1367 |
{ |
| 1368 |
\__tikzcalendarnotes_setflag_ifdatenode_exist:Nn \l__tikzcalendarnotes_tmpa_bool {####1} |
| 1369 |
|
| 1370 |
\bool_if:NT \l__tikzcalendarnotes_tmpa_bool |
| 1371 |
{ |
| 1372 |
\tl_clear:N \l__tikzcalendarnotes_drawstyle_tmp_tl |
| 1373 |
\tl_clear:N \l__tikzcalendarnotes_round_tmp_tl |
| 1374 |
\tl_clear:N \l__tikzcalendarnotes_square_tmp_tl |
| 1375 |
\tl_clear:N \l__tikzcalendarnotes_remark_tmp_tl |
| 1376 |
\tl_clear:N \l__tikzcalendarnotes_remarkstyle_tmp_tl |
| 1377 |
\tl_clear:N \l__tikzcalendarnotes_notes_tmp_tl |
| 1378 |
\tl_clear:N \l__tikzcalendarnotes_notestyle_tmp_tl |
| 1379 |
|
| 1380 |
\prop_map_inline:cn {l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ ####1 _prop} |
| 1381 |
{ |
| 1382 |
\tl_set:cn {l__tikzcalendarnotes_ ########1 _tmp_tl} {########2} |
| 1383 |
} |
| 1384 |
|
| 1385 |
\tl_if_empty:NF \l__tikzcalendarnotes_round_tmp_tl |
| 1386 |
{ |
| 1387 |
\__tikzcalendarnotes_markdraw:eee |
| 1388 |
{ |
| 1389 |
every~ mark , |
| 1390 |
rounded~ corners=\l__tikzcalendarnotes_radius_tmp_tl , |
| 1391 |
\l__tikzcalendarnotes_drawstyle_tmp_tl |
| 1392 |
} |
| 1393 |
{\l__tikzcalendarnotes_radius_tmp_tl} |
| 1394 |
{\l__tikzcalendarnotes_cal_name_key_tl - ####1} |
| 1395 |
} |
| 1396 |
|
| 1397 |
\tl_if_empty:NF \l__tikzcalendarnotes_square_tmp_tl |
| 1398 |
{ |
| 1399 |
\__tikzcalendarnotes_markdraw:eee |
| 1400 |
{ |
| 1401 |
every~ mark , |
| 1402 |
\l__tikzcalendarnotes_drawstyle_tmp_tl |
| 1403 |
} |
| 1404 |
{\l__tikzcalendarnotes_radius_tmp_tl} |
| 1405 |
{\l__tikzcalendarnotes_cal_name_key_tl - ####1} |
| 1406 |
} |
| 1407 |
|
| 1408 |
\tl_if_empty:NF \l__tikzcalendarnotes_remark_tmp_tl |
| 1409 |
{ |
| 1410 |
|
| 1411 |
\__tikzcalendarnotes_shift_adjust_tl_set:NV |
| 1412 |
\l__tikzcalendarnotes_TXshift_tmp_tl |
| 1413 |
\l__tikzcalendarnotes_remark_Xshift_adj_pgfkey_tl |
| 1414 |
|
| 1415 |
|
| 1416 |
\__tikzcalendarnotes_shift_adjust_tl_set:NV |
| 1417 |
\l__tikzcalendarnotes_TYshift_tmp_tl |
| 1418 |
\l__tikzcalendarnotes_remark_Yshift_adj_pgfkey_tl |
| 1419 |
|
| 1420 |
\use:e |
| 1421 |
{ |
| 1422 |
\exp_not:N\draw |
| 1423 |
(\l__tikzcalendarnotes_cal_name_key_tl - ####1 . \l__tikzcalendarnotes_remarkposref_tmp_tl) |
| 1424 |
++(\l__tikzcalendarnotes_TXshift_tmp_tl , \l__tikzcalendarnotes_TYshift_tmp_tl) |
| 1425 |
node |
| 1426 |
[anchor=\l__tikzcalendarnotes_remarkanchor_tmp_tl , every~ remark , \l__tikzcalendarnotes_remarkstyle_tmp_tl] |
| 1427 |
(\l__tikzcalendarnotes_cal_name_key_tl - ####1 - remark) |
| 1428 |
{ \l__tikzcalendarnotes_remark_tmp_tl } ; |
| 1429 |
} |
| 1430 |
} |
| 1431 |
|
| 1432 |
\bool_if:NF \l__tikzcalendarnotes_compact_key_bool |
| 1433 |
{ |
| 1434 |
\tl_if_empty:NF \l__tikzcalendarnotes_notes_tmp_tl |
| 1435 |
{ |
| 1436 |
|
| 1437 |
\tl_set:Nn \l__tikzcalendarnotes_TYshift_tmp_tl |
| 1438 |
{\l__tikzcalendarnotes_TYshift_scaled_tl} |
| 1439 |
|
| 1440 |
\__tikzcalendarnotes_shift_adjust_tl_set:NV |
| 1441 |
\l__tikzcalendarnotes_TYshift_tmp_tl |
| 1442 |
\l__tikzcalendarnotes_remark_Yshift_adj_pgfkey_tl |
| 1443 |
|
| 1444 |
\use:e |
| 1445 |
{ |
| 1446 |
\exp_not:N\draw |
| 1447 |
(\l__tikzcalendarnotes_cal_name_key_tl - ####1 . south~ west) |
| 1448 |
++(0pt,\l__tikzcalendarnotes_TYshift_tmp_tl) |
| 1449 |
node |
| 1450 |
[anchor=north~ west , every~ note , \l__tikzcalendarnotes_notestyle_tmp_tl] |
| 1451 |
(\l__tikzcalendarnotes_cal_name_key_tl - ####1 - note) |
| 1452 |
{ |
| 1453 |
\exp_not:N\__tizecalendarnotes_notes_typeset:nn |
| 1454 |
{ \l__tikzcalendarnotes_dayspacing_Xshift_key_tl } |
| 1455 |
{\exp_not:N\noindent \l__tikzcalendarnotes_notes_tmp_tl } |
| 1456 |
|
| 1457 |
} ; |
| 1458 |
} |
| 1459 |
} |
| 1460 |
} |
| 1461 |
} |
| 1462 |
} |
| 1463 |
|
| 1464 |
|
| 1465 |
|
| 1466 |
\seq_map_inline:cn { l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _range_seq} |
| 1467 |
{ |
| 1468 |
\tl_clear:N \l__tikzcalendarnotes_drawstyle_tmp_tl |
| 1469 |
\tl_clear:N \l__tikzcalendarnotes_round_tmp_tl |
| 1470 |
\tl_clear:N \l__tikzcalendarnotes_square_tmp_tl |
| 1471 |
\tl_clear:N \l__tikzcalendarnotes_remark_tmp_tl |
| 1472 |
\tl_clear:N \l__tikzcalendarnotes_remarkstyle_tmp_tl |
| 1473 |
|
| 1474 |
\prop_map_inline:cn {l__tikzcalendarnotes_ \l__tikzcalendarnotes_active_dataset_tl _ ####1 _prop} |
| 1475 |
{ |
| 1476 |
\tl_set:cn {l__tikzcalendarnotes_ ########1 _tmp_tl} {########2} |
| 1477 |
} |
| 1478 |
|
| 1479 |
\__tikzcalendarnotes_setflag_ifdatenode_exist:NV |
| 1480 |
\l__tikzcalendarnotes_tmpa_bool |
| 1481 |
\l__tikzcalendarnotes_from_tmp_tl |
| 1482 |
|
| 1483 |
\__tikzcalendarnotes_setflag_ifdatenode_exist:NV |
| 1484 |
\l__tikzcalendarnotes_tmpb_bool |
| 1485 |
\l__tikzcalendarnotes_to_tmp_tl |
| 1486 |
|
| 1487 |
\bool_lazy_and:nnT {\l__tikzcalendarnotes_tmpa_bool} {\l__tikzcalendarnotes_tmpb_bool} |
| 1488 |
{ |
| 1489 |
\tl_if_empty:NF \l__tikzcalendarnotes_round_tmp_tl |
| 1490 |
{ |
| 1491 |
\__tikzcalendarnotes_markdraw_range:eeee |
| 1492 |
{ |
| 1493 |
every~ mark , |
| 1494 |
rounded~ corners=\l__tikzcalendarnotes_radius_tmp_tl , |
| 1495 |
\l__tikzcalendarnotes_drawstyle_tmp_tl |
| 1496 |
} |
| 1497 |
{\l__tikzcalendarnotes_radius_tmp_tl} |
| 1498 |
{\l__tikzcalendarnotes_cal_name_key_tl - \l__tikzcalendarnotes_from_tmp_tl} |
| 1499 |
{\l__tikzcalendarnotes_cal_name_key_tl - \l__tikzcalendarnotes_to_tmp_tl} |
| 1500 |
} |
| 1501 |
|
| 1502 |
\tl_if_empty:NF \l__tikzcalendarnotes_square_tmp_tl |
| 1503 |
{ |
| 1504 |
\__tikzcalendarnotes_markdraw_range:eeee |
| 1505 |
{ |
| 1506 |
every~ mark , |
| 1507 |
\l__tikzcalendarnotes_drawstyle_tmp_tl |
| 1508 |
} |
| 1509 |
{\l__tikzcalendarnotes_radius_tmp_tl} |
| 1510 |
{\l__tikzcalendarnotes_cal_name_key_tl - \l__tikzcalendarnotes_from_tmp_tl} |
| 1511 |
{\l__tikzcalendarnotes_cal_name_key_tl - \l__tikzcalendarnotes_to_tmp_tl} |
| 1512 |
} |
| 1513 |
} |
| 1514 |
|
| 1515 |
\__tikzcalendarnotes_setflag_ifdatenode_exist:NV |
| 1516 |
\l__tikzcalendarnotes_tmpa_bool |
| 1517 |
\l__tikzcalendarnotes_dateref_tmp_tl |
| 1518 |
|
| 1519 |
\bool_if:NT \l__tikzcalendarnotes_tmpa_bool |
| 1520 |
{ |
| 1521 |
\tl_if_empty:NF \l__tikzcalendarnotes_remark_tmp_tl |
| 1522 |
{ |
| 1523 |
|
| 1524 |
\__tikzcalendarnotes_shift_adjust_tl_set:NV |
| 1525 |
\l__tikzcalendarnotes_TXshift_tmp_tl |
| 1526 |
\l__tikzcalendarnotes_remark_Xshift_adj_pgfkey_tl |
| 1527 |
|
| 1528 |
|
| 1529 |
\__tikzcalendarnotes_shift_adjust_tl_set:NV |
| 1530 |
\l__tikzcalendarnotes_TYshift_tmp_tl |
| 1531 |
\l__tikzcalendarnotes_remark_Yshift_adj_pgfkey_tl |
| 1532 |
|
| 1533 |
\use:e |
| 1534 |
{ |
| 1535 |
\exp_not:N\draw |
| 1536 |
(\l__tikzcalendarnotes_cal_name_key_tl - \l__tikzcalendarnotes_dateref_tmp_tl . \l__tikzcalendarnotes_remarkposref_tmp_tl) |
| 1537 |
++(\l__tikzcalendarnotes_TXshift_tmp_tl ,\l__tikzcalendarnotes_TYshift_tmp_tl) |
| 1538 |
node |
| 1539 |
[anchor=\l__tikzcalendarnotes_remarkanchor_tmp_tl , every~ remark , \l__tikzcalendarnotes_remarkstyle_tmp_tl] |
| 1540 |
(\l__tikzcalendarnotes_cal_name_key_tl - \l__tikzcalendarnotes_dateref_tmp_tl - remark) |
| 1541 |
{ \l__tikzcalendarnotes_remark_tmp_tl } ; |
| 1542 |
} |
| 1543 |
} |
| 1544 |
} |
| 1545 |
%%% |
| 1546 |
} |
| 1547 |
} |
| 1548 |
} |
| 1549 |
|
| 1550 |
\cs_generate_variant:Nn \__tikzcalendarnotes_draw_notes:n {V} |
| 1551 |
|
| 1552 |
|
| 1553 |
%%%%%%%%%%%%%%%%%% |
| 1554 |
%%%%%%%%%%%%%%%%%% |
| 1555 |
%% |
| 1556 |
%% End user's commands |
| 1557 |
%% |
| 1558 |
%%%%%%%%%%%%%%%%%% |
| 1559 |
%%%%%%%%%%%%%%%%%% |
| 1560 |
|
| 1561 |
|
| 1562 |
\NewDocumentCommand{\defnewdataset}{m} |
| 1563 |
{ |
| 1564 |
\__tikzcalendarnotes_new_dataset:n {#1} |
| 1565 |
} |
| 1566 |
|
| 1567 |
|
| 1568 |
\NewDocumentCommand{\setdates}{O{default}m} |
| 1569 |
{ |
| 1570 |
\__tikzcalendarnotes_reset_defaults: |
| 1571 |
|
| 1572 |
\bool_set_true:N \l__tikzcalendarnotes_date_case_bool |
| 1573 |
\tl_set:Nn \l__tikzcalendarnotes_msg_submodule_tl |
| 1574 |
{date not set} |
| 1575 |
|
| 1576 |
\__tikzcalendarnotes_select_dataset:n {#1} |
| 1577 |
\keys_set:nn |
| 1578 |
{tikzcalendarnotes / date set} |
| 1579 |
{#2} |
| 1580 |
} |
| 1581 |
|
| 1582 |
\NewDocumentCommand{\sethighlightdates}{O{default}m} |
| 1583 |
{ |
| 1584 |
\__tikzcalendarnotes_reset_defaults: |
| 1585 |
|
| 1586 |
\bool_set_true:N \l__tikzcalendarnotes_hldates_case_bool |
| 1587 |
|
| 1588 |
\__tikzcalendarnotes_select_dataset:n {#1} |
| 1589 |
\keys_set:nn |
| 1590 |
{tikzcalendarnotes / hl dates set} |
| 1591 |
{#2} |
| 1592 |
} |
| 1593 |
|
| 1594 |
|
| 1595 |
\NewDocumentCommand{\setranges}{O{default}m} |
| 1596 |
{ |
| 1597 |
\__tikzcalendarnotes_reset_defaults: |
| 1598 |
|
| 1599 |
\bool_set_true:N \l__tikzcalendarnotes_range_case_bool |
| 1600 |
\tl_set:Nn \l__tikzcalendarnotes_msg_submodule_tl |
| 1601 |
{range not set} |
| 1602 |
|
| 1603 |
\__tikzcalendarnotes_select_dataset:n {#1} |
| 1604 |
\keys_set:nn |
| 1605 |
{tikzcalendarnotes / range set} |
| 1606 |
{#2} |
| 1607 |
} |
| 1608 |
|
| 1609 |
|
| 1610 |
|
| 1611 |
\NewDocumentCommand{\setcountingweeks}{O{default}m} |
| 1612 |
{ |
| 1613 |
\__tikzcalendarnotes_reset_defaults: |
| 1614 |
|
| 1615 |
\bool_set_true:N \l__tikzcalendarnotes_cntweek_case_bool |
| 1616 |
\tl_set:Nn \l__tikzcalendarnotes_msg_submodule_tl |
| 1617 |
{range not set} |
| 1618 |
|
| 1619 |
\__tikzcalendarnotes_select_dataset:n {#1} |
| 1620 |
\keys_set:nn |
| 1621 |
{tikzcalendarnotes / cnt week set} |
| 1622 |
{#2} |
| 1623 |
|
| 1624 |
\bool_if:nT |
| 1625 |
{\l__tikzcalendarnotes_from_set_flag_bool && \l__tikzcalendarnotes_to_set_flag_bool} |
| 1626 |
{ |
| 1627 |
\__tikzcalendarnotes_try_insert_cntweek:VV |
| 1628 |
\l__tikzcalendarnotes_from_key_tl |
| 1629 |
\l__tikzcalendarnotes_to_key_tl |
| 1630 |
} |
| 1631 |
} |
| 1632 |
|
| 1633 |
\NewDocumentCommand{\suppresscounting}{O{default}m} |
| 1634 |
{ |
| 1635 |
\__tikzcalendarnotes_reset_defaults: |
| 1636 |
\bool_set_true:N \l__tikzcalendarnotes_nocntweek_case_bool |
| 1637 |
\tl_set:Nn \l__tikzcalendarnotes_msg_submodule_tl |
| 1638 |
{range not set} |
| 1639 |
|
| 1640 |
\__tikzcalendarnotes_select_dataset:n {#1} |
| 1641 |
\keys_set:nn |
| 1642 |
{tikzcalendarnotes / no cnt week set} |
| 1643 |
{#2} |
| 1644 |
|
| 1645 |
\bool_if:nT |
| 1646 |
{\l__tikzcalendarnotes_from_set_flag_bool && \l__tikzcalendarnotes_to_set_flag_bool} |
| 1647 |
{ |
| 1648 |
\__tikzcalendarnotes_try_insert_no_cntweek:VV |
| 1649 |
\l__tikzcalendarnotes_from_key_tl |
| 1650 |
\l__tikzcalendarnotes_to_key_tl |
| 1651 |
} |
| 1652 |
} |
| 1653 |
|
| 1654 |
|
| 1655 |
\cs_new_protected:Npn \__tikzcalendarnotes_prepare_style:nn #1#2 |
| 1656 |
{ |
| 1657 |
|
| 1658 |
\pgfkeys{tikz , #1} |
| 1659 |
|
| 1660 |
\__tikzcalendarnotes_set_dim_constants: |
| 1661 |
|
| 1662 |
\keys_set:nn |
| 1663 |
{tikzcalendarnotes} |
| 1664 |
{defaults , #2} |
| 1665 |
|
| 1666 |
\tl_set:Ne \l__tikzcalendarnotes_begin_iso_tl |
| 1667 |
{ |
| 1668 |
\l__tikzcalendarnotes_year_key_tl - |
| 1669 |
\l__tikzcalendarnotes_starting_at_key_tl - 01 |
| 1670 |
} |
| 1671 |
|
| 1672 |
} |
| 1673 |
|
| 1674 |
|
| 1675 |
\NewDocumentCommand{\calendarnotesprepare}{O{}m} |
| 1676 |
{ |
| 1677 |
\__tikzcalendarnotes_prepare_style:nn |
| 1678 |
{#1}{#2} |
| 1679 |
} |
| 1680 |
|
| 1681 |
\NewDocumentCommand{\calendarnotessetifs}{} |
| 1682 |
{ |
| 1683 |
\__tikzcalendarnotes_set_ifdates:V |
| 1684 |
\l__tikzcalendarnotes_dataset_key_tl |
| 1685 |
} |
| 1686 |
|
| 1687 |
\NewDocumentCommand{\calendarnotesdraw}{} |
| 1688 |
{ |
| 1689 |
\__tikzcalendarnotes_draw_notes:V |
| 1690 |
\l__tikzcalendarnotes_dataset_key_tl |
| 1691 |
} |
| 1692 |
|
| 1693 |
\NewDocumentCommand{\calendarnotesmatrix}{} |
| 1694 |
{ |
| 1695 |
\matrix[column~ sep=\l__tikzcalendarnotes_inter_month_space_key_tl pt, |
| 1696 |
row~ sep=0.7*\l__tikzcalendarnotes_inter_month_space_key_tl pt] |
| 1697 |
{ |
| 1698 |
\__tikzcalendarnotes_month_matrix:nnnn |
| 1699 |
{\l__tikzcalendarnotes_year_key_tl} |
| 1700 |
{\l__tikzcalendarnotes_starting_at_key_tl} |
| 1701 |
{\l__tikzcalendarnotes_nmonths_key_tl} |
| 1702 |
{\l__tikzcalendarnotes_perline_key_tl} |
| 1703 |
} ; |
| 1704 |
} |
| 1705 |
|
| 1706 |
\NewDocumentCommand{\calendarnotes}{O{}m} |
| 1707 |
{ |
| 1708 |
\__tikzcalendarnotes_prepare_style:nn {#1}{#2} |
| 1709 |
|
| 1710 |
\__tikzcalendarnotes_set_ifdates:V |
| 1711 |
\l__tikzcalendarnotes_dataset_key_tl |
| 1712 |
|
| 1713 |
\matrix[column~ sep=\l__tikzcalendarnotes_inter_month_space_key_tl pt, |
| 1714 |
row~ sep=0.7*\l__tikzcalendarnotes_inter_month_space_key_tl pt] |
| 1715 |
{ |
| 1716 |
\__tikzcalendarnotes_month_matrix:nnnn |
| 1717 |
{\l__tikzcalendarnotes_year_key_tl} |
| 1718 |
{\l__tikzcalendarnotes_starting_at_key_tl} |
| 1719 |
{\l__tikzcalendarnotes_nmonths_key_tl} |
| 1720 |
{\l__tikzcalendarnotes_perline_key_tl} |
| 1721 |
} ; |
| 1722 |
|
| 1723 |
\__tikzcalendarnotes_draw_notes:V |
| 1724 |
\l__tikzcalendarnotes_dataset_key_tl |
| 1725 |
|
| 1726 |
} |
| 1727 |
|
| 1728 |
|
| 1729 |
%%%%%%%%%%%%%%%%%% |
| 1730 |
%%%%%%%%%%%%%%%%%% |
| 1731 |
%% |
| 1732 |
%% |
| 1733 |
%% |
| 1734 |
%%%%%%%%%%%%%%%%%% |
| 1735 |
%%%%%%%%%%%%%%%%%% |
| 1736 |
|
| 1737 |
|
| 1738 |
|
| 1739 |
\cs_new_protected:Npn \__tikzcalendarnotes_test_jan_first: |
| 1740 |
{ |
| 1741 |
\int_compare:nNnT {\pgfcalendarifdateday} = {1} |
| 1742 |
{ |
| 1743 |
\int_compare:nNnT {\pgfcalendarifdatemonth} = {1} |
| 1744 |
{ \pgfcalendarmatchestrue } |
| 1745 |
} |
| 1746 |
} |
| 1747 |
|
| 1748 |
|
| 1749 |
\cs_new_protected:Npn \__tikzcalendarnotes_test_year_start: |
| 1750 |
{ |
| 1751 |
\bool_if:NTF \g__tikzcalendarnotes_firstdraw_bool |
| 1752 |
{ |
| 1753 |
\bool_gset_false:N \g__tikzcalendarnotes_firstdraw_bool |
| 1754 |
\pgfcalendarmatchestrue |
| 1755 |
} |
| 1756 |
{ \__tikzcalendarnotes_test_jan_first: } |
| 1757 |
} |
| 1758 |
|
| 1759 |
|
| 1760 |
\cs_new_protected:Npn \__tikzcalendarnotes_test_week_start_or_first:n #1 |
| 1761 |
{ |
| 1762 |
\bool_lazy_or:nnTF |
| 1763 |
{ |
| 1764 |
\int_compare_p:nNn {\pgfcalendarifdateweekday} = {#1} |
| 1765 |
} |
| 1766 |
{ |
| 1767 |
\int_compare_p:nNn {\pgfcalendarifdateday} = {1} |
| 1768 |
} |
| 1769 |
{ \pgfcalendarmatchestrue } |
| 1770 |
{} |
| 1771 |
} |
| 1772 |
|
| 1773 |
|
| 1774 |
\cs_generate_variant:Nn \str_range:nnn {e} |
| 1775 |
|
| 1776 |
\cs_new_protected:Npn \__tikzcalendarnotes_set_day_acro:NNn #1#2#3 |
| 1777 |
{ |
| 1778 |
\int_set:Nn \l__tikzcalendarnotes_tmpa_int {#3} |
| 1779 |
\int_sub:Nn \l__tikzcalendarnotes_tmpa_int {\l__tikzcalendarnotes_weeklist_delta_int} |
| 1780 |
\int_compare:nNnT {\l__tikzcalendarnotes_tmpa_int} < {0} |
| 1781 |
{ |
| 1782 |
\int_add:Nn \l__tikzcalendarnotes_tmpa_int {7} |
| 1783 |
} |
| 1784 |
\tl_set:Ne #1 {\str_range:enn {\pgfcalendarweekdayname{\int_use:N \l__tikzcalendarnotes_tmpa_int}}{1}{2}} |
| 1785 |
\int_compare:nNnTF {\l__tikzcalendarnotes_tmpa_int} > {4} |
| 1786 |
{ |
| 1787 |
\int_compare:nNnTF {\l__tikzcalendarnotes_tmpa_int} = {5} |
| 1788 |
{ |
| 1789 |
\tl_set:Nn #2 {@calnotes@saturday~ fmt} |
| 1790 |
} |
| 1791 |
{ |
| 1792 |
\tl_set:Nn #2 {@calnotes@sunday~ fmt} |
| 1793 |
} |
| 1794 |
} |
| 1795 |
{ |
| 1796 |
\tl_set:Nn #2 {} |
| 1797 |
} |
| 1798 |
} |
| 1799 |
|
| 1800 |
|
| 1801 |
\cs_new_protected:Npn \__tikzcalendarnotes_weeklist_set:nnnn #1#2#3#4 |
| 1802 |
{ |
| 1803 |
\int_set:Nn \l__tikzcalendarnotes_weeklist_delta_int {#1} |
| 1804 |
\tl_set:Nn \l__tikzcalendarnotes_weeklist_starts_on_tl {#2} |
| 1805 |
\tl_set:Nn \l__tikzcalendarnotes_weeklist_ends_on_tl {#3} |
| 1806 |
\int_set:Nn \l__tikzcalendarnotes_weeklist_starts_on_int {#4} |
| 1807 |
|
| 1808 |
\__tikzcalendarnotes_set_day_acro:NNn \l__tikzcalendarnotes_day_A_tl \l__tikzcalendarnotes_day_A_style_tl {0} |
| 1809 |
\__tikzcalendarnotes_set_day_acro:NNn \l__tikzcalendarnotes_day_B_tl \l__tikzcalendarnotes_day_B_style_tl {1} |
| 1810 |
\__tikzcalendarnotes_set_day_acro:NNn \l__tikzcalendarnotes_day_C_tl \l__tikzcalendarnotes_day_C_style_tl {2} |
| 1811 |
\__tikzcalendarnotes_set_day_acro:NNn \l__tikzcalendarnotes_day_D_tl \l__tikzcalendarnotes_day_D_style_tl {3} |
| 1812 |
\__tikzcalendarnotes_set_day_acro:NNn \l__tikzcalendarnotes_day_E_tl \l__tikzcalendarnotes_day_E_style_tl {4} |
| 1813 |
\__tikzcalendarnotes_set_day_acro:NNn \l__tikzcalendarnotes_day_F_tl \l__tikzcalendarnotes_day_F_style_tl {5} |
| 1814 |
\__tikzcalendarnotes_set_day_acro:NNn \l__tikzcalendarnotes_day_G_tl \l__tikzcalendarnotes_day_G_style_tl {6} |
| 1815 |
|
| 1816 |
} |
| 1817 |
|
| 1818 |
% |
| 1819 |
% make at letter needed due the many pfg variables/constants at use. |
| 1820 |
% |
| 1821 |
\makeatletter |
| 1822 |
|
| 1823 |
|
| 1824 |
\cs_new_protected:Npn \__tikzcalendarnotes_drawyear: |
| 1825 |
{ |
| 1826 |
\pgftransformxshift{-\tikz@lib@cal@xshift} |
| 1827 |
\tikzyearcode % \tikzyearcode is defined by default |
| 1828 |
\pgftransformxshift{\tikz@lib@cal@xshift} |
| 1829 |
} |
| 1830 |
|
| 1831 |
\cs_new_protected:Npn \__tikzcalendarnotes_day_xshift: |
| 1832 |
{ |
| 1833 |
\int_set:Nn \l__tikzcalendarnotes_tmpa_int {\pgfcalendarcurrentweekday + \l__tikzcalendarnotes_weeklist_delta_int} |
| 1834 |
\int_compare:nNnT {\l__tikzcalendarnotes_tmpa_int} > {6} |
| 1835 |
{ \int_sub:Nn \l__tikzcalendarnotes_tmpa_int {7} } |
| 1836 |
\pgftransformxshift{ \int_use:N\l__tikzcalendarnotes_tmpa_int * \tikz@lib@cal@xshift } |
| 1837 |
} |
| 1838 |
|
| 1839 |
|
| 1840 |
\cs_new_protected:Npn \__tikzcalendarnodes_daynames_draw: |
| 1841 |
{ |
| 1842 |
\begin{scope} |
| 1843 |
\node[every~ day,every~ day~ name,\l__tikzcalendarnotes_day_A_style_tl]{\l__tikzcalendarnotes_day_A_tl}; |
| 1844 |
\pgftransformxshift{ \tikz@lib@cal@xshift } |
| 1845 |
\node[every~ day,every~ day~ name,\l__tikzcalendarnotes_day_B_style_tl]{\l__tikzcalendarnotes_day_B_tl}; |
| 1846 |
\pgftransformxshift{ \tikz@lib@cal@xshift } |
| 1847 |
\node[every~ day,every~ day~ name,\l__tikzcalendarnotes_day_C_style_tl]{\l__tikzcalendarnotes_day_C_tl}; |
| 1848 |
\pgftransformxshift{ \tikz@lib@cal@xshift } |
| 1849 |
\node[every~ day,every~ day~ name,\l__tikzcalendarnotes_day_D_style_tl]{\l__tikzcalendarnotes_day_D_tl}; |
| 1850 |
\pgftransformxshift{ \tikz@lib@cal@xshift } |
| 1851 |
\node[every~ day,every~ day~ name,\l__tikzcalendarnotes_day_E_style_tl]{\l__tikzcalendarnotes_day_E_tl}; |
| 1852 |
\pgftransformxshift{ \tikz@lib@cal@xshift } |
| 1853 |
\node[every~ day,every~ day~ name,\l__tikzcalendarnotes_day_F_style_tl]{\l__tikzcalendarnotes_day_F_tl}; |
| 1854 |
\pgftransformxshift{ \tikz@lib@cal@xshift } |
| 1855 |
\node[every~ day,every~ day~ name,\l__tikzcalendarnotes_day_G_style_tl]{\l__tikzcalendarnotes_day_G_tl}; |
| 1856 |
\end{scope} |
| 1857 |
\pgftransformyshift{ -0.85*\tikz@lib@cal@yshift} |
| 1858 |
} |
| 1859 |
|
| 1860 |
|
| 1861 |
\pgfkeys{tikz , |
| 1862 |
calendar~ notes/.style = |
| 1863 |
{ |
| 1864 |
remember~ picture , |
| 1865 |
every~ calendar/.style = |
| 1866 |
{ week~ starts~ on~ x } , |
| 1867 |
month~ text = {\%mt} , |
| 1868 |
every~ month/.style = |
| 1869 |
{ |
| 1870 |
font = \bfseries\itshape , |
| 1871 |
} , |
| 1872 |
day~ text = |
| 1873 |
{ \%d0 } , |
| 1874 |
} , |
| 1875 |
} |
| 1876 |
|
| 1877 |
\pgfkeys{tikz , |
| 1878 |
% 'execute before day scope' is cumulative. 'new style' needed to fully change calendar's behaviour |
| 1879 |
day~ names~ on~ top/.style = |
| 1880 |
{ |
| 1881 |
week~ starts~ on~ x/.append~ style = |
| 1882 |
{ |
| 1883 |
execute~ before~ day~ scope = |
| 1884 |
{ |
| 1885 |
\ifdate{ day~ of~ month = 1 } |
| 1886 |
{ \__tikzcalendarnodes_daynames_draw: } |
| 1887 |
{} |
| 1888 |
} , |
| 1889 |
} , |
| 1890 |
} , |
| 1891 |
every~ day~ name/.style = |
| 1892 |
{ |
| 1893 |
font = {\scriptsize\itshape} |
| 1894 |
} , |
| 1895 |
} |
| 1896 |
|
| 1897 |
\pgfkeys{tikz , |
| 1898 |
week~ starts~ on~ x/.style = |
| 1899 |
{ |
| 1900 |
execute~ before~ day~ scope = |
| 1901 |
{ |
| 1902 |
\ifdate{ day~ of~ month = 1 } |
| 1903 |
{ % On first of month , except when first date in calendar. |
| 1904 |
\ifdate{ equals = \pgfcalendarbeginiso } |
| 1905 |
{} |
| 1906 |
{ \pgftransformyshift{ -\tikz@lib@cal@month@yshift } } |
| 1907 |
} |
| 1908 |
{} |
| 1909 |
} , |
| 1910 |
% glancing from the source code. |
| 1911 |
tikz@lib@cal@width = 7 , |
| 1912 |
% |
| 1913 |
execute~ at~ begin~ day~ scope = |
| 1914 |
{ \__tikzcalendarnotes_day_xshift: } , |
| 1915 |
execute~ after~ day~ scope = |
| 1916 |
{ % shift to the next line , if end of weeklist |
| 1917 |
\ifdate{ \l__tikzcalendarnotes_weeklist_ends_on_tl } |
| 1918 |
{ \pgftransformyshift{ -\tikz@lib@cal@yshift } } |
| 1919 |
{} |
| 1920 |
} , |
| 1921 |
} , |
| 1922 |
% |
| 1923 |
% |
| 1924 |
week~ starts~ monday/.code = |
| 1925 |
{ |
| 1926 |
\__tikzcalendarnotes_weeklist_set:nnnn{0}{Monday}{Sunday}{0} |
| 1927 |
} , |
| 1928 |
week~ starts~ sunday/.code = |
| 1929 |
{ |
| 1930 |
\__tikzcalendarnotes_weeklist_set:nnnn{1}{Sunday}{Saturday}{6} |
| 1931 |
} , |
| 1932 |
week~ starts~ sunday , |
| 1933 |
% |
| 1934 |
} |
| 1935 |
|
| 1936 |
\pgfkeys{tikz , |
| 1937 |
@calnotes@sunday~ fmt/.style = |
| 1938 |
{} , |
| 1939 |
% |
| 1940 |
every~ sunday/.style = |
| 1941 |
{ |
| 1942 |
every~ calendar/.append~ style = |
| 1943 |
{ |
| 1944 |
if = {(Sunday)~ [#1]} |
| 1945 |
} , |
| 1946 |
@calnotes@sunday~ fmt/.append~ style = {#1} , |
| 1947 |
} , |
| 1948 |
% |
| 1949 |
@calnotes@saturday~ fmt/.style = |
| 1950 |
{} , |
| 1951 |
% |
| 1952 |
every~ weekend/.style = |
| 1953 |
{ |
| 1954 |
every~ calendar/.append~ style = |
| 1955 |
{ |
| 1956 |
if = {(weekend)~ [#1]} |
| 1957 |
} , |
| 1958 |
@calnotes@saturday~ fmt/.append~ style = {#1} , |
| 1959 |
@calnotes@sunday~ fmt/.append~ style = {#1} , |
| 1960 |
} , |
| 1961 |
} |
| 1962 |
|
| 1963 |
|
| 1964 |
|
| 1965 |
\pgfkeys{tikz , |
| 1966 |
% hidden style for drawing the year , |
| 1967 |
% it draws it for January and "first month drawn" (which depends on a _bool variable) |
| 1968 |
/pgf/calendar/@calnotes@start~ @of~ @year/.code = |
| 1969 |
{ \__tikzcalendarnotes_test_year_start: } , |
| 1970 |
% |
| 1971 |
|
| 1972 |
@calnotes@set~ firstdraw~ flag~ @true/.code = |
| 1973 |
{ |
| 1974 |
\bool_gset_true:N \g__tikzcalendarnotes_firstdraw_bool |
| 1975 |
} , |
| 1976 |
|
| 1977 |
@calnotes@set~ firstdraw~ flag~ @false/.code = |
| 1978 |
{ |
| 1979 |
\bool_gset_false:N \g__tikzcalendarnotes_firstdraw_bool |
| 1980 |
} , |
| 1981 |
|
| 1982 |
@calnotes@set~ year~ policy~ true@/.code = |
| 1983 |
{ |
| 1984 |
\bool_set_true:N \l__tikzcalendarnotes_year_policy_set_bool |
| 1985 |
} , |
| 1986 |
|
| 1987 |
@calnotes@set~ year~ policy~ if~ not~ set@/.code = |
| 1988 |
{ |
| 1989 |
\bool_if:NF \l__tikzcalendarnotes_year_policy_set_bool |
| 1990 |
{ |
| 1991 |
\bool_set_true:N \l__tikzcalendarnotes_year_policy_set_bool |
| 1992 |
\pgfkeys{tikz,year~ label~ by~ january~ and~ start} |
| 1993 |
} |
| 1994 |
} , |
| 1995 |
|
| 1996 |
@calnotes@set~ year~ label~ true@/.code = |
| 1997 |
{ |
| 1998 |
\bool_set_true:N \l__tikzcalendarnotes_year_label_set_bool |
| 1999 |
} , |
| 2000 |
|
| 2001 |
@calnotes@set~ year~ label~ if~ not~ set@/.code = |
| 2002 |
{ |
| 2003 |
\bool_if:NF \l__tikzcalendarnotes_year_label_set_bool |
| 2004 |
{ |
| 2005 |
\bool_set_true:N \l__tikzcalendarnotes_year_label_set_bool |
| 2006 |
\pgfkeys{tikz,year~ label~ left} |
| 2007 |
} |
| 2008 |
} , |
| 2009 |
|
| 2010 |
year~ label~ by~ january~ and~ start/.style = |
| 2011 |
{ |
| 2012 |
@calnotes@set~ firstdraw~ flag~ @true , |
| 2013 |
@calnotes@set~ year~ policy~ true@ , |
| 2014 |
@calnotes@set~ year~ label~ if~ not~ set@ , |
| 2015 |
execute~ before~ day~ scope = |
| 2016 |
{ |
| 2017 |
\ifdate{@calnotes@start~ @of~ @year} |
| 2018 |
{ \__tikzcalendarnotes_drawyear: } |
| 2019 |
{} |
| 2020 |
} , |
| 2021 |
} , |
| 2022 |
|
| 2023 |
year~ label~ by~ january~ only/.style = |
| 2024 |
{ |
| 2025 |
@calnotes@set~ firstdraw~ flag~ @false , |
| 2026 |
@calnotes@set~ year~ policy~ true@ , |
| 2027 |
@calnotes@set~ year~ label~ if~ not~ set@ , |
| 2028 |
execute~ before~ day~ scope = |
| 2029 |
{ |
| 2030 |
\ifdate{@calnotes@start~ @of~ @year} |
| 2031 |
{ \__tikzcalendarnotes_drawyear: } |
| 2032 |
{} |
| 2033 |
} , |
| 2034 |
} , |
| 2035 |
|
| 2036 |
% Style forcing an year label. |
| 2037 |
year~ label~ every~ month/.style= |
| 2038 |
{ |
| 2039 |
@calnotes@set~ year~ policy~ true@ , |
| 2040 |
@calnotes@set~ year~ label~ if~ not~ set@ , |
| 2041 |
execute~ before~ day~ scope = |
| 2042 |
{ |
| 2043 |
\ifdate{day~ of~ month = 1} |
| 2044 |
{ \__tikzcalendarnotes_drawyear: } |
| 2045 |
{} |
| 2046 |
} |
| 2047 |
} , |
| 2048 |
|
| 2049 |
year~ label~ left/.style = |
| 2050 |
{ |
| 2051 |
@calnotes@set~ year~ label~ true@ , |
| 2052 |
@calnotes@set~ year~ policy~ if~ not~ set@ , |
| 2053 |
every~ year/.append~ style = |
| 2054 |
{ |
| 2055 |
anchor = north~ east , |
| 2056 |
} , |
| 2057 |
} , |
| 2058 |
|
| 2059 |
year~ label~ left~ vertical/.style = |
| 2060 |
{ |
| 2061 |
@calnotes@set~ year~ label~ true@ , |
| 2062 |
@calnotes@set~ year~ policy~ if~ not~ set@ , |
| 2063 |
every~ year/.append~ style = |
| 2064 |
{ |
| 2065 |
anchor = south , |
| 2066 |
rotate = 90 , |
| 2067 |
} , |
| 2068 |
} , |
| 2069 |
|
| 2070 |
year~ label~ left~ corner/.style = |
| 2071 |
{ |
| 2072 |
@calnotes@set~ year~ label~ true@ , |
| 2073 |
@calnotes@set~ year~ policy~ if~ not~ set@ , |
| 2074 |
every~ year/.append~ style = |
| 2075 |
{ |
| 2076 |
anchor = south , |
| 2077 |
rotate = 45 , |
| 2078 |
} , |
| 2079 |
} , |
| 2080 |
|
| 2081 |
every~ year/.style = |
| 2082 |
{ font = \Large\sffamily\bfseries, green!50!black } , |
| 2083 |
} |
| 2084 |
|
| 2085 |
\pgfkeys{tikz , |
| 2086 |
every~ mark/.style = |
| 2087 |
{ thin , gray } , |
| 2088 |
every~ remark/.style = |
| 2089 |
{ |
| 2090 |
font = |
| 2091 |
\fontsize{3.5}{4.2} |
| 2092 |
\selectfont |
| 2093 |
} , |
| 2094 |
every~ counter/.style = |
| 2095 |
{ |
| 2096 |
every~ remark |
| 2097 |
} , |
| 2098 |
keep~ counters/.code = |
| 2099 |
{ |
| 2100 |
\bool_set_true:N \l__tikzcalendarnotes_keep_counters_pgfkey_bool |
| 2101 |
} , |
| 2102 |
@calnotes@note@fontsize/.code = |
| 2103 |
{ |
| 2104 |
\tl_set:Nn \l__tikzcalendarnotes_notes_fontsize_pgfkey_tl {#1} |
| 2105 |
} , |
| 2106 |
every~ note/.style = |
| 2107 |
{ |
| 2108 |
font = |
| 2109 |
\fontsize{4.5}{4.95} |
| 2110 |
\selectfont |
| 2111 |
} , |
| 2112 |
@calnotes@note@fontsize = 4.5 , |
| 2113 |
remarks~ font size/.style = |
| 2114 |
{ |
| 2115 |
every~ remark/.append~ style = |
| 2116 |
{ |
| 2117 |
font = |
| 2118 |
\fontsize{#1}{\fp_eval:n {1.1*#1}} |
| 2119 |
\selectfont |
| 2120 |
} |
| 2121 |
} , |
| 2122 |
remarks~ font size/.value~ required , |
| 2123 |
% |
| 2124 |
notes~ font size/.style = |
| 2125 |
{ |
| 2126 |
@calnotes@note@fontsize = {#1} , |
| 2127 |
every~ note/.append~ style = |
| 2128 |
{ |
| 2129 |
font = |
| 2130 |
\fontsize{#1}{\fp_eval:n {1.1*#1}} |
| 2131 |
\selectfont |
| 2132 |
} |
| 2133 |
} , |
| 2134 |
notes~ font size/.value~ required , |
| 2135 |
% |
| 2136 |
} |
| 2137 |
|
| 2138 |
\pgfkeys{tikz , |
| 2139 |
Xshift~ adjust/.code = |
| 2140 |
{ |
| 2141 |
\tl_set:Nn \l__tikzcalendarnotes_remark_Xshift_adj_pgfkey_tl {#1 pt} |
| 2142 |
} , |
| 2143 |
Xshift~ adjust/.value~ required , |
| 2144 |
% |
| 2145 |
Yshift~ adjust/.code = |
| 2146 |
{ |
| 2147 |
\tl_set:Nn \l__tikzcalendarnotes_remark_Yshift_adj_pgfkey_tl {#1 pt} |
| 2148 |
} , |
| 2149 |
Yshift~ adjust/.value~ required , |
| 2150 |
% |
| 2151 |
radius~ adjust/.code = |
| 2152 |
{ |
| 2153 |
\tl_set:Nn \l__tikzcalendarnotes_radius_adj_pgfkey_tl {#1 pt} |
| 2154 |
} , |
| 2155 |
radius~ adjust/.value~ required , |
| 2156 |
% |
| 2157 |
radius~ adjust = 0, |
| 2158 |
Xshift~ adjust = 0, |
| 2159 |
Yshift~ adjust = 0, |
| 2160 |
} |
| 2161 |
|
| 2162 |
|