lilypond-0.1.35
[lilypond.git] / lily / outputter.cc
blob81ef2c793e002ce610e2a08c94414a94a0829b41
2 /*
3 outputter.cc -- implement Tex_outputter
5 source file of the GNU LilyPond music typesetter
7 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
8 */
10 #include "outputter.hh"
11 #include "tex-stream.hh"
12 #include "molecule.hh"
13 #include "varray.hh"
14 #include "dimen.hh"
15 #include "tex.hh"
17 Tex_outputter::Tex_outputter (Tex_stream *s)
19 outstream_l_ = s;
22 void
23 Tex_outputter::output_molecule (Molecule const*m, Offset o)
25 String t = m->TeX_string();
26 if (t.empty_b ())
27 return ;
29 String s ("\\placebox{%}{%}{%}");
30 Array<String> a;
31 a.push (print_dimen (o.y()));
32 a.push (print_dimen (o.x()));
33 a.push (t);
34 String r;
36 if (check_debug)
37 r = String ("\n%start: ") + name() + "\n";
40 r += substitute_args (s, a);
42 *outstream_l_ << r;
46 void
47 Tex_outputter::start_line ()
49 *outstream_l_ << "\\hbox{%<- line of score\n";
52 void
53 Tex_outputter::stop_line ()
55 *outstream_l_ << "}";
56 *outstream_l_ << "\\interscoreline";