-
Notifications
You must be signed in to change notification settings - Fork 15
/
introduction-editor.html
140 lines (108 loc) · 8.01 KB
/
introduction-editor.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!--
Gregorio web site.
Copyright (C) 2007-2015 The Gregorio project
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 3 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, see <http://www.gnu.org/licenses/>.
-->
<title>Gregorio project website</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="description" content="Free software for typesetting Gregorian chant" lang="en">
<meta name="keywords" content="Gregorian chant, gregorio, gabc, gregoriotex" lang="en">
<meta name="author" content="The Gregorio project">
<link rel="shortcut icon" href="./illus/fav.ico">
<link rel="icon" href="./illus/fav.ico">
<link rel="stylesheet" href="./style.css" type="text/css" title="default">
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
<script type="text/javascript" src="./gregorio-menu.js"></script>
<script>
var context = 'gregorio';
var title = 'Gregorio project website'
</script>
</head>
<body>
<div id="ban">
<img src="./illus/harpedroite.png" title="" class="hd" alt="" />
<a id="haut" name="haut"></a>
<div id="banniere">
</div>
</div>
<script>write_gre_menu();</script>
<div class="flux">
<!-- IE patch-->
<div class="text">
<!-- End of header -->
<!-- header -->
<h1>Using Gregorio in <span class="tex">T<span class="epsilon">e</span>X</span>Shop</h1>
<p>This page describes how Gregorio is used with a <span class="tex">T<span class="epsilon">e</span>X</span> editor such as <span class="tex">T<span class="epsilon">e</span>X</span>works or <span class="tex">T<span class="epsilon">e</span>X</span>Shop. If you are used to <span class="tex">T<span class="epsilon">e</span>X</span> compilation and know the command line tools, you can refer to the <a href="./introduction-commandline.html">command line introduction</a>.</p>
<p>The editor must be correctly configured according to the instructions for <a href="./configuration-texworks.html"><span class="tex">T<span class="epsilon">e</span>X</span>works</a> or <a href="./configuration-texshop.html"><span class="tex">T<span class="epsilon">e</span>X</span>Shop</a>. These instructions can be easily adapted for other tools using <span class="tex">T<span class="epsilon">e</span>X</span>Shop markup, such as the <a href="https://github.com/SublimeText/LaTeXTools"><span class="latex">L<span class="alpha">a</span>T<span class="epsilon">e</span>X</span> Tools for SublimeText</a>.</p>
<p>Overall, producing a score involves these steps:</p>
<ul>
<li>writing a gabc text file that describes the score</li>
<li>writing a <span class="latex">L<span class="alpha">a</span>T<span class="epsilon">e</span>X</span> text file that describes the document which contains the score</li>
<li>running <span class="latex">L<span class="alpha">a</span>T<span class="epsilon">e</span>X</span> to compile the document file and the gabc file</li>
</ul>
<h3 id="gabc">Creating a gabc score file</h3>
<p>For a first example, you can take inspiration from the file <code>PopulusSion.gabc</code> in the <code>examples/</code> directory of the Gregorio software distribution (also <a href="https://github.com/gregorio-project/gregorio/blob/master/examples/PopulusSion.gabc">here</a>).</p>
<p>See the <a href="./gabc/index.html">gabc page</a> for details about the gabc syntax. For now, let’s suppose you keep this score as it is and that you save it as <code>example.gabc</code>.<p>
<p>Save your gabc file in a new directory, which will be our working directory. You need to save it with the extension “<code>.gabc</code>”, and save it in UTF-8 encoding: under <span class="tex">T<span class="epsilon">e</span>X</span>Shop, save it in “UTF8 Plain Text” format. </p>
<h3>Making a document and including your score</h3>
<p>This step will let you create a small document and include your score in it. It will be very basic, but from this basis, you’ll be able to do virtually anything you need, such as a booklet including more scores or a book.</p>
<p>To accomplish that, you will certainly need some understanding of <span class="latex">L<span class="alpha">a</span>T<span class="epsilon">e</span>X</span>, but for a first try, you can use the following barebones file:</p>
<div class="commandline">
<code>\documentclass[11pt]{article}<br />
<br />
\usepackage{fontspec}<br />
<br />
\usepackage[autocompile]{gregoriotex}<br />
<br />
\begin{document}<br />
<br />
\gregorioscore{example}<br />
<br />
\end{document}</code>
</div>
<p>Copy the above into a new file and save it as <code>test.tex</code> in the same directory as <code>example.gabc</code></p>
<h3 id="compile">Compiling the document</h3>
<p>The goal now is to compile this file using your <span class="tex">T<span class="epsilon">e</span>X</span> editor to produce a PDF output. Select <code>LuaLaTeX+se</code> from the drop down list in the upper left, or automate this selection by placing the following line at the begining of the file:</p>
<div class="commandline">
<code>% !TEX program = LuaLaTeX+se</code>
</div>
<p>Then click on the “Typeset” button.</p>
<p>If you correctly followed the instructions of this page, a PDF file will show up in the right side of your screen! You’re now ready to start playing with your document file by using <a href="gregoriotex/details.html">the various Gregorio<span class="tex">T<span class="epsilon">e</span>X</span> commands available to tweak the appearence of the score.</a></p>
<h3>Behind the scenes</h3>
<p>What you just did might seem a bit magical and confusing. Here is what really happened:</p>
<ul>
<li>Your editor launches the command <br/><code>lualatex --shell-escape test.tex</code></li>
<li>Lua<span class="latex">L<span class="alpha">a</span>T<span class="epsilon">e</span>X</span> compiles the document. When it sees <code>\gregorioscore{example}</code>, it launches the command <br/><code>gregorio example.gabc</code></li>
<li>Gregorio compiles your gabc score into <code>example-###.gtex</code> (where <code>###</code> is the version number of Gregorio). You can check your folder for this file.</li>
<li>Lua<span class="latex">L<span class="alpha">a</span>T<span class="epsilon">e</span>X</span> reads in the contents of <code>example-###.gtex</code> and continues the compilation of your document.
</ul>
<p>There is a mechanism to avoid repeated compilation if the gabc file and the Gregorio version have not changed.</p>
<h3 id="automation">Compiling directly from the score window</h3>
<p>It can be practical, when writing a gabc score, to compile directly from the window containing the gabc file. To allow that, add the following lines at the top of your gabc file:</p>
<div class="commandline">
<code>% !TEX root = test.tex</code><br />
<code>% !TEX TS-program = LuaLaTeX+se</code>
</div>
<p>The first line tells <span class="tex">T<span class="epsilon">e</span>X</span>Shop that this file is part of a larger project whose main (or root) file is <code>test.tex</code>. Now whenever you go to typeset <code>example.gabc</code> <span class="tex">T<span class="epsilon">e</span>X</span>Shop wil typeset <code>test.tex</code> instead. The second line is the same as in your tex file (it is mandatory under <span class="tex">T<span class="epsilon">e</span>X</span>works, optional in <span class="tex">T<span class="epsilon">e</span>X</span>Shop).</p>
<!-- footer -->
</div>
<div class="bottom">
</div>
<script>initialize_menu();</script>
</body>
</html>