blob: 8b00e1c2b5a18a121d6d8bbcc2b01b4fd789de10 (
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
|
% an auxiliary package for the manual
\directlua{
barracuda = require "barracuda"
local v = barracuda._VERSION
local p = v:find(" ")
brcd_data = {
version = v:sub(p+1),
date = barracuda._DATE
}
}
\newcommand{\code}[1]{\texttt{#1}}
\newcommand{\brcd}{\code{barracuda}}
\newbox\barracudabox
\newcommand\barracuda[3][_brcd_empty_=true]{\directlua{
local enc_name = [[#2]]
local data = [[#3]]
local opt = {#1};
if opt._brcd_empty_ == true then
barracuda:hbox(enc_name, data, "barracudabox")
else
barracuda:hbox(enc_name, data, "barracudabox", opt)
end
}%
\leavevmode\box\barracudabox
}
\newcommand{\brcdkey}[1]{\directlua{
local key = [===[#1]===]
if brcd_data[key] then
tex.sprint(brcd_data[key])
else
error("Key '"..key.."' not found")
end
}}
|