File: test-expl3.tex

package info (click to toggle)
vim-vimtex 2.17-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,844 kB
  • sloc: makefile: 360; python: 103
file content (67 lines) | stat: -rw-r--r-- 1,570 bytes parent folder | download
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
\ExplSyntaxOn
\str_new:N \g_myfile_name_str
\str_gset:Nn \g_myfile_name_str {myfile.txt}
\str_new:N \g_myfile_old_mdfive_str
\str_new:N \l_myfile_mdfive_str
\cs_new_protected:Npn \getmdfive % get hash is not expandable, so protect
{
  \file_get_mdfive_hash:nN {\str_use:N \g_myfile_name_str} \l_myfile_mdfive_str
  \str_use:N \l_myfile_mdfive_str
}
\cs_new:Npn \getoldmdfive
{
  \str_use:N \g_myfile_old_mdfive_str
}
\cs_new:Npn \IfMyfileChanged #1 #2
{
  \str_if_eq:NNTF \g_myfile_old_mdfive_str \l_myfile_mdfive_str {#2} {#1}
}
\AtEndDocument
{
  \iow_now:cx { @auxout }
  {
    \token_to_str:N \ExplSyntaxOn
    \iow_newline:
    \str_gset:Nn \token_to_str:N \g_myfile_old_mdfive_str {\str_use:N \l_myfile_mdfive_str}
    \iow_newline:
    \token_to_str:N \ExplSyntaxOff
  }
}
\ExplSyntaxOff

\ExplSyntaxOn
\ExplSyntaxOn
\ExplSyntaxOn
\str_new:N \g_myfile_name_str
\ExplSyntaxOff
\str_new:N \g_myfile_name_str

% Example from #1945
\ExplSyntaxOn
\use:x
  {
    \exp_not:N \includegraphics
      [ \clist_use:Nn \g__pdfoverlay_graphics_options_clist { , } ]
      { \g__pdfoverlay_pdf_file_name_str }
  }
\ExplSyntaxOff

% Example from #2272
\ExplSyntaxOn
\c_tmpa_str
\c_tmpa_str:nx
\l_@@_int
\cs_new:Nn \@@_shift_item:nn {
  \str_set:Nx \l_tmpa_str { \str_head:n { #1 } }
  \str_case:VnF \l_tmpa_str {
    { x } {
      \prop_put:Nnx \l_@@_b { #1 }
        { \dim_eval:n { #2 + \l_@@_shiftx_dim } } }
    { y } {
      \prop_put:Nnx \l_@@_b { #1 }
        { \dim_eval:n { #2 + \l_@@_shifty_dim } } }
  } {
    \prop_put:Nnn \l_@@_b { #1 } { #2 }
  }
}
\ExplSyntaxOff