summaryrefslogtreecommitdiff
path: root/Build/source/texk/gregorio/gregorio-src/contrib/900_gregorio.xml
blob: ca392d0c794f664a2b0308cda4c66b0bd4624c83 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<?xml version="1.0"?>
<!--
 XML file for using gregorio inside scribus.
 Copyright (C) 2009 Pierre Couderc <pierre@couderc.eu>.
 Copyright (C) 2010 Elie Roux <elie.roux@telecom-bretagne.eu>
 Copyright (C) 2015-2018 The Gregorio Project (see CONTRIBUTORS.md)

 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation; either version 2 of the License, or
 (at your option) any later version.

 This program is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License along
 with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

 See the different comments in the file to change the default configuration.
-->
<editorsettings description="gregorio" icon="gregorio.png">
    <executable command="texlua"/>
    <imagefile extension=".pdf"/>
    <highlighter>
        <rule name="gabc header" regex="[a-zA-Z]+:" color="blue" minimal="true"/>
        <rule name="gabc delimiter" regex="%%" color="green" minimal="true"/>
        <rule name="gabc notes" regex="\([^)]*\)" color="red" minimal="true"/>
    </highlighter>
    <empty-frame-text>name: myscore;
%%
(c3) Pó(eh/hi)pu(h)lus(h) Si(hi)on,(hgh.)
    </empty-frame-text>
    <!-- you can change the basic headers there -->
    <preamble>data_from_scribus = [==========[% Generated from Scribus
\documentclass[a4paper,$scribus_grefontsize$]{extarticle}
\usepackage[left=0cm,top=0cm,right=0cm,bottom=0cm,nohead,nofoot]{geometry}
\usepackage{color}
\title{Scribus-Latex-gregorio-File}
$scribus_additionalgreheaders$
\usepackage{gregoriotex}
\author{Scribus}
\pagestyle{empty}
\setlength{\textwidth}{$scribus_realwidth$ pt}
\begin{document}
$scribus_greconf$
%%% BEGIN GABC %%%
</preamble>
    <postamble>]==========]
require"lfs"

local latexmkbin = "latexmk"
local lualatexbin = "lualatex"

local function basename(name)
  return name and string.match(name,"^.+[/\\](.-)$") or name
end

local f = basename(arg[0])

local texfile = io.open(f .. ".tex", "w")
local gabcfile = io.open(f .. "-score.gabc", "w")
local in_tex = true
local l
for l in string.gmatch(data_from_scribus, "[^\r\n]+") do
  if l == "%%% BEGIN GABC %%%" then
    in_tex = false
  elseif in_tex then
    texfile:write(l .. '\n')
  else
    gabcfile:write(l .. '\n')
  end
end

local format = string.format

texfile:write("\n\\gregorioscore[f]{" .. f .. "-score}\n\\end{document}\n")
texfile:close()
gabcfile:close()

print("calling "..latexmkbin.."\n")
os.exec({
    latexmkbin,
    '-g',
    '-pdf',
    '-pdflatex=' .. lualatexbin .. ' --interaction=nonstopmode --shell-escape',
    f
})
</postamble>
    <tab type="settings">
        <title>
            <i18n>
                <en>Headers</en>
                <fr>En-tête</fr>
            </i18n>
        </title>
        <list name="grefontsize" default="11pt">
            <title>
                <i18n>
                    <en>Fontsize:</en>
                    <de>Schriftgröße:</de>
                    <fr>Taille police :</fr>
                    <pl>Stopień pisma:</pl>
                    <ru>Кегль шрифт:</ru>
                </i18n>
            </title>
            <option value="8pt">8pt</option>
            <option value="9pt">9pt</option>
            <option value="10pt">10pt</option>
            <option value="11pt">11pt</option>
            <option value="12pt">12pt</option>
            <option value="14pt">14pt</option>
            <option value="17pt">17pt</option>
            <option value="20pt">20pt</option>
        </list>
        <text name="additionalgreheaders" type="long" default="\usepackage{fontspec}
\usepackage{libertine}">
            <i18n>
                <en>Additional LaTeX Headers:</en>
                <de>Zusätzliche LaTeX Header:</de>
                <fr>En-tête LaTeX additionnel :</fr>
            </i18n>
        </text>
    </tab>
    <tab type="settings">
        <title>
            <i18n>
                <en>Gregorio Options</en>
                <fr>Conf. gregorio</fr>
            </i18n>
        </title>
        <comment>
            <i18n>
                <en>Input here your additional gregorio-specific TeX commands.</en>
                <fr>Ajoutez ici vos commandes additionelles pour GregorioTeX.</fr>
            </i18n>
        </comment>
        <text name="greconf" type="long" default="\grechangestaffsize{17}"></text>
    </tab>
</editorsettings>