From 25645986aa3e8d999e901426932c539e8de6a1ca Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 8 Mar 2004 22:12:26 +0000 Subject: [PATCH] * lily/paper-outputter.cc (output_expr): (output_header): (output_line): New method. * lily/system.cc (get_line): (get_lines): New method. (output_scheme): (output_line): Remove. * scm/lily.scm (make-title): New function. * lily/paper-book.cc: * lily/include/paper-book.hh: New file. * lily/include/ly-module.hh: New file, matching ly-module.cc (WAS: ly-modules.hh). * lily/ly-module.cc (ly_modules_lookup): New function. * lily/main.cc (main_with_guile): Move memory leak debug code back. * scm/output-ps.scm (make-title): Remove. (output-scopes): Junk header-title test. --- ChangeLog | 29 +- input/test/title-markup.ly | 26 +- lily/break-substitution.cc | 14 +- lily/include/lily-proto.hh | 4 +- lily/include/{ly-modules.hh => ly-module.hh} | 9 +- lily/include/main.hh | 2 + lily/include/paper-book.hh | 28 ++ lily/include/paper-outputter.hh | 5 +- lily/include/paper-score.hh | 10 +- lily/include/system.hh | 8 +- lily/input-file-results.cc | 23 +- lily/ly-module.cc | 55 ++-- lily/main.cc | 20 +- lily/music-output-def.cc | 2 +- lily/my-lily-lexer.cc | 2 +- lily/paper-book.cc | 101 +++++++ lily/paper-def.cc | 2 +- lily/paper-outputter.cc | 96 ++++++- lily/paper-score.cc | 114 +++++--- lily/parser.yy | 5 +- lily/score.cc | 52 ++-- lily/system.cc | 288 ++++++------------- scm/lily.scm | 17 +- scm/output-ps.scm | 43 +-- scm/output-tex.scm | 3 +- 25 files changed, 565 insertions(+), 393 deletions(-) rename lily/include/{ly-modules.hh => ly-module.hh} (72%) create mode 100644 lily/include/paper-book.hh create mode 100644 lily/paper-book.cc diff --git a/ChangeLog b/ChangeLog index 062dc929a7..011cb40c54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,12 +1,37 @@ +2004-03-08 Jan Nieuwenhuizen + + * lily/paper-outputter.cc (output_expr): + (output_header): + (output_line): New method. + + * lily/system.cc (get_line): + (get_lines): New method. + (output_scheme): + (output_line): Remove. + + * scm/lily.scm (make-title): New function. + + * lily/paper-book.cc: + * lily/include/paper-book.hh: New file. + + * lily/include/ly-module.hh: New file, matching ly-module.cc (WAS: + ly-modules.hh). + + * lily/ly-module.cc (ly_modules_lookup): New function. + + * lily/main.cc (main_with_guile): Move memory leak debug code back. + + * scm/output-ps.scm (make-title): Remove. + (output-scopes): Junk header-title test. + 2004-03-08 Han-Wen Nienhuys * mf/feta-schrift.mf: thicker dot for portato. - * lily/accidental-placement.cc (position_accidentals): bugfix in offset, this fixes right-padding of AccidentalPlacement. - * lily/[h-z]*.cc: () formatting. + * lily/[h-z]*.cc: () formatting. * Documentation/user/tutorial.itely (An orchestral part): more fixes for the tutorial. diff --git a/input/test/title-markup.ly b/input/test/title-markup.ly index 12bdc0c943..e5a86c004c 100644 --- a/input/test/title-markup.ly +++ b/input/test/title-markup.ly @@ -1,11 +1,10 @@ \version "2.1.29" %{ - \markup in titles is WIP, only available in direct PostScript output - process and view this file doing: + \markup in titles is WIP. + + only available when compiled with PAGE_LAYOUT is #define'd + see include/paper-book.hh - lilypond-bin -fps title-markup.ly - export GS_LIB=$(pwd)/mf/out:/usr/share/texmf/fonts/type1/bluesky/cm - gs title-markup.ps %} sizeTest = \markup { @@ -63,7 +62,7 @@ spaceTest = \markup { "two space chars" } > } %} - makeTitle = \markup { + bookTitle = \markup { \column < %\fill-line #linewidth < \huge \bigger \bold \title > \override #'(baseline-skip . 4) \column < @@ -100,7 +99,18 @@ spaceTest = \markup { "two space chars" } \score { \context Staff \notes \relative c' { - c2-\sizeTest c2-\spaceTest \break - c2 c2 + c2-\sizeTest c2-\spaceTest + % \break c2 c2 + } +} + +\header { + scoreTitle = \markup { "Tweetje" } +} + +\score { + \context Staff \notes \relative c' { + c2-\sizeTest c2-\spaceTest + % \break c2 c2 } } diff --git a/lily/break-substitution.cc b/lily/break-substitution.cc index 59664579f7..bd524417f5 100644 --- a/lily/break-substitution.cc +++ b/lily/break-substitution.cc @@ -90,18 +90,16 @@ do_break_substitution (SCM src) again: if (unsmob_grob (src)) - { - return substitute_grob (unsmob_grob (src)); - } + return substitute_grob (unsmob_grob (src)); else if (gh_vector_p (src)) { - int l = SCM_VECTOR_LENGTH (src); - SCM nv = scm_c_make_vector (l, SCM_UNDEFINED); - - for (int i =0 ; i< l ; i++) + int len = SCM_VECTOR_LENGTH (src); + SCM nv = scm_c_make_vector (len, SCM_UNDEFINED); + for (int i = 0; i < len; i++) { SCM si = scm_int2num (i); - scm_vector_set_x (nv, si, do_break_substitution (scm_vector_ref (src, si))); + scm_vector_set_x (nv, si, + do_break_substitution (scm_vector_ref (src, si))); } } else if (ly_pair_p (src)) diff --git a/lily/include/lily-proto.hh b/lily/include/lily-proto.hh index 57863cdb80..493b5ef46d 100644 --- a/lily/include/lily-proto.hh +++ b/lily/include/lily-proto.hh @@ -109,6 +109,7 @@ class Pitch; class My_lily_lexer; class Note_performer; class Output_property; +class Paper_book; class Paper_column; class Paper_def; class Paper_outputter; @@ -162,4 +163,5 @@ class Translator_group; class Transposed_music; class Type_swallow_translator; class yyFlexLexer; -#endif // LILY_PROTO_HH; + +#endif /* LILY_PROTO_HH */ diff --git a/lily/include/ly-modules.hh b/lily/include/ly-module.hh similarity index 72% rename from lily/include/ly-modules.hh rename to lily/include/ly-module.hh index 6a05cf9639..c486a4e927 100644 --- a/lily/include/ly-modules.hh +++ b/lily/include/ly-module.hh @@ -1,5 +1,5 @@ /* - ly-modules.hh -- declare module related helper functions + ly-module.hh -- declare module related helper functions source file of the GNU LilyPond music typesetter @@ -7,8 +7,8 @@ */ -#ifndef LY_MODULES_HH -#define LY_MODULES_HH +#ifndef LY_MODULE_HH +#define LY_MODULE_HH #include "lily-guile.hh" @@ -16,10 +16,11 @@ SCM ly_make_anonymous_module (); void ly_copy_module_variables (SCM dest, SCM src); SCM ly_module_to_alist (SCM mod); SCM ly_module_lookup (SCM module, SCM sym); +SCM ly_modules_lookup (SCM modules, SCM sym); SCM ly_module_symbols (SCM mod); void ly_reexport_module (SCM mod); inline bool ly_module_p (SCM x) { return SCM_MODULEP(x); } void ly_clear_anonymous_modules (); -#endif /* LY_MODULES_HH */ +#endif /* LY_MODULE_HH */ diff --git a/lily/include/main.hh b/lily/include/main.hh index 978e3f86d1..5c5ed19e8c 100644 --- a/lily/include/main.hh +++ b/lily/include/main.hh @@ -46,4 +46,6 @@ extern int exit_status_global; extern File_path global_path; extern int score_count_global; +extern Paper_book *paper_book; + #endif /* MAIN_HH */ diff --git a/lily/include/paper-book.hh b/lily/include/paper-book.hh new file mode 100644 index 0000000000..9fd93ffcbe --- /dev/null +++ b/lily/include/paper-book.hh @@ -0,0 +1,28 @@ +/* + paper-book.hh -- declare Paper_book + + source file of the GNU LilyPond music typesetter + + (c) 2004 Jan Nieuwenhuizen +*/ + +#ifndef PAPER_BOOK_HH +#define PAPER_BOOK_HH + +// #define PAGE_LAYOUT 1 + +#include "parray.hh" +class Page; + +class Paper_book +{ +public: + Link_array paper_scores_; + Paper_book (); + + Link_array *get_pages (); + void output (); +}; + +#endif /* PAPER_BOOK_HH */ + diff --git a/lily/include/paper-outputter.hh b/lily/include/paper-outputter.hh index 82c3594522..58c23e2464 100644 --- a/lily/include/paper-outputter.hh +++ b/lily/include/paper-outputter.hh @@ -41,6 +41,9 @@ public: void output_metadata (SCM, Paper_def*); void output_music_output_def (Music_output_def* odef); void output_scheme (SCM scm); + void output_expr (SCM expr, Offset o); + void output_header (Paper_def*); + void output_line (SCM, bool); }; -#endif // PAPER_OUTPUTTER_HH +#endif /* PAPER_OUTPUTTER_HH */ diff --git a/lily/include/paper-score.hh b/lily/include/paper-score.hh index 6aeec1ce3a..6ef31f4796 100644 --- a/lily/include/paper-score.hh +++ b/lily/include/paper-score.hh @@ -27,9 +27,14 @@ class Paper_score : public Music_output public: Paper_def *paper_; + /* Vector with lines of stencils. */ + Protected_scm lines_; + Stencil *book_title_; + Stencil *score_title_; + Paper_outputter *outputter_; System *system_; - + Paper_score (); /** @@ -39,7 +44,8 @@ public: Link_array broken_col_range (Item const*,Item const*) const; void typeset_line (System*); - + void output (); + protected: /* MAIN ROUTINES */ virtual void process (String); diff --git a/lily/include/system.hh b/lily/include/system.hh index a9b24b6f2c..911aa0b792 100644 --- a/lily/include/system.hh +++ b/lily/include/system.hh @@ -23,15 +23,15 @@ class System : public Spanner { public: int rank_; - void post_processing (bool); + void post_processing (); + SCM get_line (); + SCM get_lines (); System (SCM); int element_count () const; int spanner_count () const; - void break_into_pieces (Array const&); - void output_lines (); static bool has_interface (Grob*); Link_array broken_col_range (Item const*, Item const*) const; @@ -39,8 +39,6 @@ public: void add_column (Paper_column*); void typeset_grob (Grob*); - void output_stencil (SCM, Offset); - void output_scheme (SCM); void pre_processing (); protected: diff --git a/lily/input-file-results.cc b/lily/input-file-results.cc index c100864453..a70ed99376 100644 --- a/lily/input-file-results.cc +++ b/lily/input-file-results.cc @@ -30,7 +30,9 @@ #include "source.hh" #include "lily-version.hh" #include "scm-hash.hh" -#include "ly-modules.hh" +#include "ly-module.hh" + +#include "paper-book.hh" bool store_locations_global_b; @@ -210,17 +212,7 @@ do_one_file (char const *file) String in_file = inpath.to_string (); String out_file = outpath.to_string (); - -#if 0 - /* Code to debug memory leaks. Cannot call from within .ly - since then we get the protects from the parser state too. */ - static SCM proc ; - if (!proc) - proc = scm_c_eval_string ("dump-gc-protects"); - scm_gc (); - scm_call_0 (proc); -#endif - + if (init.length () && global_path.find (init).is_empty ()) { warning (_f ("can't find file: `%s'", init)); @@ -238,5 +230,12 @@ do_one_file (char const *file) if (!proc) proc = scm_c_eval_string ("dump-gc-protects"); +#ifdef PAGE_LAYOUT + Paper_book book; + paper_book = &book; +#endif Input_file_results inp_file (init, in_file, out_file); +#ifdef PAGE_LAYOUT + book.output (); +#endif } diff --git a/lily/ly-module.cc b/lily/ly-module.cc index 4f4aecb873..dd204fa938 100644 --- a/lily/ly-module.cc +++ b/lily/ly-module.cc @@ -1,15 +1,15 @@ -/* -ly-module.cc -- implement guile module stuff. - -source file of the GNU LilyPond music typesetter - -(c) 2002--2004 Han-Wen Nienhuys +/* + ly-module.cc -- implement guile module stuff. + + source file of the GNU LilyPond music typesetter + + (c) 2002--2004 Han-Wen Nienhuys - */ +*/ #include "string.hh" #include "lily-guile.hh" -#include "ly-modules.hh" +#include "ly-module.hh" #include "protected-scm.hh" #define FUNC_NAME __FUNCTION__ @@ -42,11 +42,9 @@ ly_clear_anonymous_modules () for (; gh_pair_p (s) ; s = gh_cdr (s)) { SCM tab= scm_c_make_hash_table (2); - /* - UGH. - */ - - SCM_STRUCT_DATA (gh_car (s))[scm_module_index_obarray] = (long unsigned int) tab; + /* UGH. */ + SCM_STRUCT_DATA (gh_car (s))[scm_module_index_obarray] + = (long unsigned int) tab; } } @@ -60,9 +58,7 @@ define_one_var (void * closure, SCM key, SCM val, SCM result) return SCM_EOL; } -/* - Ugh signature of scm_internal_hash_fold () is inaccurate. - */ +/* Ugh signature of scm_internal_hash_fold () is inaccurate. */ typedef SCM (*Hash_cl_func)(); void @@ -86,7 +82,8 @@ ly_module_symbols (SCM mod) SCM_VALIDATE_MODULE (1, mod); SCM obarr= SCM_MODULE_OBARRAY (mod); - return scm_internal_hash_fold ((Hash_cl_func) &accumulate_symbol, NULL, SCM_EOL, obarr); + return scm_internal_hash_fold ((Hash_cl_func) &accumulate_symbol, + NULL, SCM_EOL, obarr); } SCM @@ -106,9 +103,7 @@ ly_module_to_alist (SCM mod) return scm_internal_hash_fold ((Hash_cl_func) &entry_to_alist, NULL, SCM_EOL, obarr); } -/* - Lookup SYM, but don't give error when it is not defined. - */ +/* Lookup SYM, but don't give error when it is not defined. */ SCM ly_module_lookup (SCM module, SCM sym) { @@ -119,18 +114,28 @@ ly_module_lookup (SCM module, SCM sym) #undef FUNC_NAME } +SCM +ly_modules_lookup (SCM modules, SCM sym) +{ + for (SCM s = gh_car (modules); SCM_MODULEP (s); s = ly_cdr (s)) + { + SCM v = scm_sym2var (sym, scm_module_lookup_closure (s), SCM_UNDEFINED); + if (v != SCM_UNDEFINED) + return v; + } + return SCM_UNDEFINED; +} + + SCM export_function; void ly_export (SCM module, SCM namelist) { if (!export_function) - { - export_function = scm_permanent_object (scm_c_lookup ("module-export!")); - } + export_function = scm_permanent_object (scm_c_lookup ("module-export!")); - scm_call_2 (SCM_VARIABLE_REF (export_function), - module, namelist); + scm_call_2 (SCM_VARIABLE_REF (export_function), module, namelist); } void diff --git a/lily/main.cc b/lily/main.cc index 337918b3f2..08b483c4de 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -278,17 +278,33 @@ main_with_guile (void *, int, char **) init_scheme_code_string += ")"; gh_eval_str ((char*) init_scheme_code_string.to_str0 ()); - + + /* We accept multiple independent music files on the command line to + reduce compile time when processing lots of small files. + Starting the GUILE engine is very time consuming. */ bool first = true; while (char const *arg = option_parser->get_next_arg ()) { + +#if 0 + /* Code to debug memory leaks. Cannot call from within .ly + since then we get the protects from the parser state too. */ + static SCM proc; + if (!proc) + proc = scm_c_eval_string ("dump-gc-protects"); + scm_gc (); + scm_call_0 (proc); +#endif + do_one_file (arg); first = false; } delete option_parser; option_parser = 0; - /* No FILE arguments is now a usage error */ + /* No FILE arguments is now a usage error to help newbies. If you + want a filter, you're not a newbie and should know to use file + argument `-'. */ if (first) { usage (); diff --git a/lily/music-output-def.cc b/lily/music-output-def.cc index 9ead9e7d8c..b690c9450d 100644 --- a/lily/music-output-def.cc +++ b/lily/music-output-def.cc @@ -15,7 +15,7 @@ #include "main.hh" #include "file-path.hh" #include "lily-guile.hh" -#include "ly-modules.hh" +#include "ly-module.hh" #include "ly-smobs.icc" diff --git a/lily/my-lily-lexer.cc b/lily/my-lily-lexer.cc index 30b4afd7dd..a0a276ccf7 100644 --- a/lily/my-lily-lexer.cc +++ b/lily/my-lily-lexer.cc @@ -22,7 +22,7 @@ #include "main.hh" #include "input.hh" #include "moment.hh" -#include "ly-modules.hh" +#include "ly-module.hh" static Keyword_ent the_key_tab[]={ diff --git a/lily/paper-book.cc b/lily/paper-book.cc new file mode 100644 index 0000000000..3e43a14f4a --- /dev/null +++ b/lily/paper-book.cc @@ -0,0 +1,101 @@ +/* + paper-book.cc -- implement Paper_book + + source file of the GNU LilyPond music typesetter + + (c) 2004 Jan Nieuwenhuizen +*/ + +#include "main.hh" +#include "paper-book.hh" +#include "paper-score.hh" +#include "paper-def.hh" +#include "stencil.hh" +#include "paper-outputter.hh" + +// WIP -- simplistic page interface +// Do we need this at all? SCM, smob? +class Page +{ +public: + Paper_def *paper_; + + SCM lines_; + Real hsize_; + Real vsize_; + + Page (Paper_def*); + void output (Paper_outputter*, bool); +}; + +Page::Page (Paper_def *paper) +{ + paper_ = paper; + hsize_ = paper->get_realvar (ly_symbol2scm ("hsize")); + vsize_ = paper->get_realvar (ly_symbol2scm ("vsize")); +} + +void +Page::output (Paper_outputter *out, bool is_last) +{ + int line_count = SCM_VECTOR_LENGTH ((SCM) lines_); + for (int i = 0; i < line_count; i++) + out->output_line (scm_vector_ref (lines_, scm_int2num (i)), + is_last && i == line_count - 1); +} + + +Paper_book *paper_book; + +Paper_book::Paper_book () +{ +} + +void +Paper_book::output () +{ + Paper_outputter *out = paper_scores_[0]->outputter_; + + Paper_def *paper = paper_scores_[0]->paper_; + out->output_header (paper); + + if (paper_scores_[0]->book_title_) + out->output_expr (paper_scores_[0]->book_title_->get_expr (), + Offset (0, 0)); + + Link_array *pages = get_pages (); + int page_count = pages->size (); + for (int i = 0; i < page_count; i++) + (*pages)[i]->output (out, i + 1 == page_count); + + out->output_scheme (scm_list_1 (ly_symbol2scm ("end-output"))); + progress_indication ("\n"); +} + +/* + WIP -- this simply adds one Page per \score + TODO: + * get dimensions + * title: bookTitle vs scoreTitle + * header / footer (generate per Page, with page#) + * start-page / stop-page in output-* interface + * some page breaking algorithm +*/ +Link_array* +Paper_book::get_pages () +{ + Link_array *pages = new Link_array; + Paper_def *paper = paper_scores_[0]->paper_; + int score_count = paper_scores_.size (); + for (int i = 0; i < score_count; i++) + { + Page *page = new Page (paper); + page->lines_ = paper_scores_[i]->lines_; + pages->push (page); + } + + //if (paper_scores_[0]->book_title_) + // title = paper_scores_[0]->book_title_->extent (Y_AXIS).length (); + + return pages; +} diff --git a/lily/paper-def.cc b/lily/paper-def.cc index 0e7ab2254e..3d32542868 100644 --- a/lily/paper-def.cc +++ b/lily/paper-def.cc @@ -20,7 +20,7 @@ #include "scm-hash.hh" #include "input-file-results.hh" // urg? header_global #include "paper-outputter.hh" -#include "ly-modules.hh" +#include "ly-module.hh" /* This is an almost empty thing. The only substantial thing this class diff --git a/lily/paper-outputter.cc b/lily/paper-outputter.cc index 2fe3441307..51135a7e9c 100644 --- a/lily/paper-outputter.cc +++ b/lily/paper-outputter.cc @@ -23,7 +23,10 @@ #include "lily-version.hh" #include "paper-def.hh" #include "input-file-results.hh" -#include "ly-modules.hh" +#include "ly-module.hh" + + +#include "input-smob.hh" // output_expr Paper_outputter::Paper_outputter (String name) @@ -62,9 +65,9 @@ Paper_outputter::output_metadata (SCM scopes, Paper_def *paper) { SCM fields = SCM_EOL; for (int i = dump_header_fieldnames_global.size (); i--; ) - fields = gh_cons (ly_symbol2scm (dump_header_fieldnames_global[i].to_str0 ()), - fields); - + fields + = gh_cons (ly_symbol2scm (dump_header_fieldnames_global[i].to_str0 ()), + fields); output_scheme (scm_list_n (ly_symbol2scm ("output-scopes"), paper->self_scm (), scm_list_n (ly_symbol2scm ("quote"), @@ -75,6 +78,42 @@ Paper_outputter::output_metadata (SCM scopes, Paper_def *paper) SCM_UNDEFINED)); } +void +Paper_outputter::output_header (Paper_def *paper) +{ + output_music_output_def (paper); + output_scheme (scm_list_1 (ly_symbol2scm ("header-end"))); + output_scheme (scm_list_2 (ly_symbol2scm ("define-fonts"), + ly_quote_scm (paper->font_descriptions ()))); +} + +void +Paper_outputter::output_line (SCM line, bool is_last) +{ + Offset dim = ly_scm2offset (ly_car (line)); + Real width = dim[X_AXIS]; + Real height = dim[Y_AXIS]; + + if (height > 50 CM) + { + programming_error ("Improbable system height."); + height = 50 CM; + } + + output_scheme (scm_list_3 (ly_symbol2scm ("start-system"), + gh_double2scm (width), gh_double2scm (height))); + + for (SCM s = ly_cdr (line); gh_pair_p (s); s = ly_cdr (s)) + { + Stencil *stil = unsmob_stencil (ly_cdar (s)); + output_expr (stil->get_expr (), ly_scm2offset (ly_caar (s))); + } + + if (is_last) + output_scheme (scm_list_1 (ly_symbol2scm ("stop-last-system"))); + else + output_scheme (scm_list_1 (ly_symbol2scm ("stop-system"))); +} void Paper_outputter::output_music_output_def (Music_output_def* odef) @@ -82,3 +121,52 @@ Paper_outputter::output_music_output_def (Music_output_def* odef) output_scheme (scm_list_n (ly_symbol2scm ("output-paper-def"), odef->self_scm (), SCM_UNDEFINED)); } + +/* TODO: replaceme/rewriteme, see output-ps.scm: output-stencil */ +void +Paper_outputter::output_expr (SCM expr, Offset o) +{ + while (1) + { + if (!gh_pair_p (expr)) + return; + + SCM head =ly_car (expr); + if (unsmob_input (head)) + { + Input * ip = unsmob_input (head); + + output_scheme (scm_list_n (ly_symbol2scm ("define-origin"), + scm_makfrom0str (ip->file_string ().to_str0 ()), + gh_int2scm (ip->line_number ()), + gh_int2scm (ip->column_number ()), + SCM_UNDEFINED)); + expr = ly_cadr (expr); + } + else if (head == ly_symbol2scm ("no-origin")) + { + output_scheme (scm_list_n (head, SCM_UNDEFINED)); + expr = ly_cadr (expr); + } + else if (head == ly_symbol2scm ("translate-stencil")) + { + o += ly_scm2offset (ly_cadr (expr)); + expr = ly_caddr (expr); + } + else if (head == ly_symbol2scm ("combine-stencil")) + { + output_expr (ly_cadr (expr), o); + expr = ly_caddr (expr); + } + else + { + output_scheme (scm_list_n (ly_symbol2scm ("placebox"), + gh_double2scm (o[X_AXIS]), + gh_double2scm (o[Y_AXIS]), + expr, + SCM_UNDEFINED)); + return; + } + } +} + diff --git a/lily/paper-score.cc b/lily/paper-score.cc index f392455a89..9202095e17 100644 --- a/lily/paper-score.cc +++ b/lily/paper-score.cc @@ -23,33 +23,39 @@ #include "misc.hh" #include "all-font-metrics.hh" +#include "stencil.hh" +#include "paper-book.hh" +#include "ly-module.hh" + Paper_score::Paper_score () { - paper_ =0; - outputter_ =0; + paper_ = 0; + outputter_ = 0; system_ = 0; main_smob_ = SCM_EOL; + lines_ = SCM_EOL; + book_title_ = 0; + score_title_ = 0; } -void -Paper_score::typeset_line (System *l) +Paper_score::Paper_score (Paper_score const &s) + : Music_output (s) { - if (!system_) - { - system_ = l; // ugh. - } - - main_smob_ = gh_cons (l->self_scm (), main_smob_); - l->pscore_ = this; - - scm_gc_unprotect_object (l->self_scm ()); + assert (false); } -Paper_score::Paper_score (Paper_score const &s) - : Music_output (s) +void +Paper_score::typeset_line (System *line) { - assert (false); + if (!system_) + /* ugh. */ + system_ = line; + + main_smob_ = gh_cons (line->self_scm (), main_smob_); + line->pscore_ = this; + + scm_gc_unprotect_object (line->self_scm ()); } Array @@ -66,9 +72,6 @@ Paper_score::calc_breaking () return sol; } -/* - urg. clean me - */ void Paper_score::process (String outname) { @@ -77,52 +80,79 @@ Paper_score::process (String outname) system_->element_count (), system_->spanner_count ())); - progress_indication (_ ("Preprocessing graphical objects...") + " "); - /* - Check out why we need this - removing gives assertion failures - down the road. - */ - { /* doubly, also done in Score_engraver */ - Link_array pc (system_->columns ()); - - pc[0]->set_property ("breakable", SCM_BOOL_T); - pc.top ()->set_property ("breakable", SCM_BOOL_T); - } - + /* FIXME: Check out why we need this - removing gives assertion failures + down the road. + + doubly, also done in Score_engraver */ + Link_array pc (system_->columns ()); + pc[0]->set_property ("breakable", SCM_BOOL_T); + pc.top ()->set_property ("breakable", SCM_BOOL_T); + system_->pre_processing (); Array breaking = calc_breaking (); system_->break_into_pieces (breaking); - + lines_ = system_->get_lines (); + + // FIXME: ... outputter_ = paper_->get_paper_outputter (outname); progress_indication ("\n"); SCM scopes = SCM_EOL; - if (header_) scopes = scm_cons (header_, scopes); if (global_input_file->header_ && global_input_file->header_ != header_) scopes = scm_cons (global_input_file->header_, scopes); outputter_->output_metadata (scopes, paper_); - outputter_->output_music_output_def (paper_); - outputter_->output_scheme (scm_list_1 (ly_symbol2scm ("header-end"))); - outputter_ - ->output_scheme (scm_list_2 (ly_symbol2scm ("define-fonts"), - ly_quote_scm (paper_->font_descriptions ()))); +#ifdef PAGE_LAYOUT + SCM make_title = scm_primitive_eval (ly_symbol2scm ("make-title")); + SCM b = ly_modules_lookup (scopes, ly_symbol2scm ("bookTitle")); + if (b != SCM_UNDEFINED && scm_variable_bound_p (b) == SCM_BOOL_T) + book_title_ + = unsmob_stencil (gh_call2 (make_title, paper_->self_scm (), + scm_variable_ref (b))); + + SCM s = ly_modules_lookup (scopes, ly_symbol2scm ("scoreTitle")); + if (s != SCM_UNDEFINED && scm_variable_bound_p (s) == SCM_BOOL_T) + score_title_ + = unsmob_stencil (gh_call2 (make_title, paper_->self_scm (), + scm_variable_ref (s))); + +#if 0 + // FIXME: + delete system_; + system_ = 0; +#endif + + /* Ugh: caller (Score) should do this, but does not know our flavor + (paper or midi). */ + paper_book->paper_scores_.push (this); +#else + output (); +#endif +} - outputter_->output_scheme (scm_list_2 (ly_symbol2scm ("make-title"), - ly_quote_scm (outputter_->file_))); - system_->output_lines (); +void +Paper_score::output () +{ + outputter_->output_header (paper_); + + int line_count = SCM_VECTOR_LENGTH ((SCM) lines_); + for (int i = 0; i < line_count; i++) + outputter_->output_line (scm_vector_ref (lines_, scm_int2num (i)), + i == line_count - 1); + outputter_->output_scheme (scm_list_1 (ly_symbol2scm ("end-output"))); - progress_indication ("\n"); +#if 0 // huh? delete outputter_; outputter_ = 0; +#endif } diff --git a/lily/parser.yy b/lily/parser.yy index d1b40819d9..3723bf4347 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -74,12 +74,13 @@ TODO: #include "input.hh" #include "lilypond-input-version.hh" #include "scm-hash.hh" -#include "ly-modules.hh" +#include "ly-module.hh" #include "music-sequence.hh" #include "input-smob.hh" #include "event.hh" #include "text-item.hh" #include "music-list.hh" +#include "paper-book.hh" #define MY_MAKE_MUSIC(x) make_music_by_name (ly_symbol2scm (x)) @@ -455,7 +456,9 @@ toplevel_expression: scm_gc_unprotect_object (id->self_scm ()); } +#ifndef PAGE_LAYOUT scm_gc_unprotect_object (sc->self_scm ()); +#endif } | output_def { SCM id = SCM_EOL; diff --git a/lily/score.cc b/lily/score.cc index 4350d8854a..0f3c924df1 100644 --- a/lily/score.cc +++ b/lily/score.cc @@ -21,8 +21,9 @@ #include "cpu-timer.hh" #include "main.hh" #include "paper-def.hh" -#include "ly-modules.hh" +#include "ly-module.hh" +#include "paper-book.hh" /* @@ -88,7 +89,7 @@ Score::Score (Score const &s) music_ = m?m->clone ()->self_scm () : SCM_EOL; scm_gc_unprotect_object (music_); - for (int i=0; i < s.defs_.size (); i++) + for (int i = 0; i < s.defs_.size (); i++) defs_.push (s.defs_[i]->clone ()); header_ = ly_make_anonymous_module (); @@ -96,17 +97,15 @@ Score::Score (Score const &s) ly_copy_module_variables (header_, s.header_); } - - LY_DEFINE (ly_run_translator, "ly:run-translator", - 2, 0, 0, - (SCM mus, SCM output_def), - "Process @var{mus} according to @var{output_def}. A interpretation " -"context is set up, and @var{mus} is interpreted with it. The " -"context is returned in its final state." ) + 2, 0, 0, (SCM mus, SCM output_def), + "Process @var{mus} according to @var{output_def}. " + "An interpretation context is set up, " + "and @var{mus} is interpreted with it. " + "The context is returned in its final state.") { Music_output_def *odef = unsmob_music_output_def (output_def); - Music * music = unsmob_music (mus); + Music *music = unsmob_music (mus); SCM_ASSERT_TYPE (music, mus, SCM_ARG1, __FUNCTION__, "Music"); SCM_ASSERT_TYPE (odef, output_def, SCM_ARG2, __FUNCTION__, "Output definition"); @@ -123,7 +122,7 @@ LY_DEFINE (ly_run_translator, "ly:run-translator", progress_indication (_ ("Interpreting music...")); trans->final_mom_ = music->get_length (); - SCM protected_iter = Music_iterator::get_static_get_iterator (music); + SCM protected_iter = Music_iterator::get_static_get_iterator (music); Music_iterator * iter = unsmob_iterator (protected_iter); iter->init_translator (music, trans); @@ -149,31 +148,27 @@ LY_DEFINE (ly_run_translator, "ly:run-translator", LY_DEFINE (ly_render_output, "ly:render-output", - 3,0,0, - (SCM context, SCM header, SCM out_filename), - "Given a Score context in its final state, calculate the output, " - "and dump the result to @var{out-filename}, using " - "@var{header} for the bibliographic information.") + 3, 0, 0, (SCM context, SCM header, SCM out_filename), + "Given a Score context in its final state, calculate the output, " + "and dump the result to @var{out-filename}, using " + "@var{header} for the bibliographic information.") { Global_context * gt = dynamic_cast (unsmob_context (context)); - SCM_ASSERT_TYPE (gt, context, SCM_ARG1, __FUNCTION__, - "Global context"); - SCM_ASSERT_TYPE (ly_module_p (header), header, SCM_ARG2, __FUNCTION__, - "module"); - SCM_ASSERT_TYPE (gh_string_p (out_filename), out_filename, SCM_ARG3, __FUNCTION__, - "output filename"); - - Music_output * output = gt->get_output (); + SCM_ASSERT_TYPE (gt, context, SCM_ARG1, __FUNCTION__, "Global context"); + SCM_ASSERT_TYPE (ly_module_p (header), header, SCM_ARG2, __FUNCTION__, "module"); + SCM_ASSERT_TYPE (gh_string_p (out_filename), out_filename, SCM_ARG3, __FUNCTION__, "output filename"); + Music_output *output = gt->get_output (); output->header_ = header; - progress_indication ("\n"); output->process (ly_scm2string (out_filename)); - - delete output ; - return SCM_UNDEFINED ; +#ifndef PAGE_LAYOUT + delete output; +#endif + + return SCM_UNDEFINED; } void @@ -184,4 +179,3 @@ default_rendering (SCM mus, SCM outdef, SCM head, SCM outname) if (unsmob_context (context)) ly_render_output (context, head, outname); } - diff --git a/lily/system.cc b/lily/system.cc index 61ab2ebbec..2c221eefbf 100644 --- a/lily/system.cc +++ b/lily/system.cc @@ -6,7 +6,6 @@ (c) 1996--2004 Han-Wen Nienhuys */ -#include "input-smob.hh" #include "axis-group-interface.hh" #include "warn.hh" #include "system.hh" @@ -17,22 +16,11 @@ #include "paper-score.hh" #include "string.hh" #include "warn.hh" -#include "dimensions.hh" #include "stencil.hh" #include "all-font-metrics.hh" #include "spacing-interface.hh" #include "staff-symbol-referencer.hh" - -// todo: use map. -void -fixup_refpoints (SCM s) -{ - for (; gh_pair_p (s); s = ly_cdr (s)) - { - Grob::fixup_refpoint (ly_car (s)); - } -} - +#include "paper-book.hh" System::System (SCM s) : Spanner (s) @@ -118,13 +106,22 @@ System::typeset_grob (Grob * elem) scm_gc_unprotect_object (elem->self_scm ()); } -void -System::output_lines () +// todo: use map. +static void +fixup_refpoints (SCM s) { - for (SCM s = get_property ("all-elements"); - gh_pair_p (s); s = ly_cdr (s)) + for (; gh_pair_p (s); s = ly_cdr (s)) { - Grob * g = unsmob_grob (ly_car (s)); + Grob::fixup_refpoint (ly_car (s)); + } +} + +SCM +System::get_lines () +{ + for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s)) + { + Grob *g = unsmob_grob (ly_car (s)); if (g->internal_has_interface (ly_symbol2scm ("only-prebreak-interface"))) { /* @@ -151,9 +148,7 @@ System::output_lines () Grob *se = broken_intos_[i]; SCM all = se->get_property ("all-elements"); for (SCM s = all; gh_pair_p (s); s = ly_cdr (s)) - { - fixup_refpoint (ly_car (s)); - } + fixup_refpoint (ly_car (s)); count += scm_ilength (all); } @@ -162,42 +157,41 @@ System::output_lines () */ fixup_refpoints (get_property ("all-elements")); - - for (SCM s = get_property ("all-elements"); - gh_pair_p (s); s = ly_cdr (s)) - { - unsmob_grob (ly_car (s))->handle_broken_dependencies (); - } + for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s)) + unsmob_grob (ly_car (s))->handle_broken_dependencies (); handle_broken_dependencies (); - /* - Because the this->get_property (all-elements) contains items - in 3 versions, handle_broken_dependencies () will leave duplicated - items in all-elements. Strictly speaking this is harmless, but it - leads to duplicated symbols in the output. uniquify_list () makes - sure that no duplicates are in the list. - */ - for (int i=0; i < broken_intos_.size (); i++) +#if 0 /* don't do this: strange side effects. */ + + /* Because the this->get_property (all-elements) contains items in 3 + versions, handle_broken_dependencies () will leave duplicated + items in all-elements. Strictly speaking this is harmless, but + it leads to duplicated symbols in the output. uniquify_list () + makes sure that no duplicates are in the list. */ + for (int i = 0; i < line_count; i++) { - /* - don't do this: strange side effects. - */ - // SCM al = broken_intos_[i]->get_property ("all-elements"); - // al = uniquify_list (al); + SCM all = broken_intos_[i]->get_property ("all-elements"); + all = uniquify_list (all); } +#endif if (verbose_global_b) progress_indication (_f ("Element count %d.", count + element_count ())); + int line_count = broken_intos_.size (); + SCM lines = scm_c_make_vector (line_count, SCM_UNDEFINED); - for (int i=0; i < broken_intos_.size (); i++) + for (int i = 0; i < line_count; i++) { System *system = dynamic_cast (broken_intos_[i]); if (verbose_global_b) progress_indication ("["); - bool last = i+1 == broken_intos_.size (); - system->post_processing (last); + + // bool last = (i + 1 == line_count); + + system->post_processing (); + scm_vector_set_x (lines, scm_int2num (i), system->get_line ()); if (verbose_global_b) { @@ -205,7 +199,8 @@ System::output_lines () progress_indication ("]"); } - if (i < broken_intos_.size () - 1) +#ifndef PAGE_LAYOUT + if (i < line_count - 1) { SCM lastcol = ly_car (system->get_property ("columns")); Grob* e = unsmob_grob (lastcol); @@ -219,7 +214,9 @@ System::output_lines () inter, SCM_UNDEFINED)); } } +#endif } + return lines; } @@ -335,61 +332,6 @@ System::break_into_pieces (Array const &breaking) } } -void -System::output_stencil (SCM expr, Offset o) -{ - while (1) - { - if (!gh_pair_p (expr)) - return; - - SCM head =ly_car (expr); - if (unsmob_input (head)) - { - Input * ip = unsmob_input (head); - - pscore_->outputter_->output_scheme (scm_list_n (ly_symbol2scm ("define-origin"), - scm_makfrom0str (ip->file_string ().to_str0 ()), - gh_int2scm (ip->line_number ()), - gh_int2scm (ip->column_number ()), - SCM_UNDEFINED)); - expr = ly_cadr (expr); - } - else if (head == ly_symbol2scm ("no-origin")) - { - pscore_->outputter_->output_scheme (scm_list_n (head, SCM_UNDEFINED)); - expr = ly_cadr (expr); - } - else if (head == ly_symbol2scm ("translate-stencil")) - { - o += ly_scm2offset (ly_cadr (expr)); - expr = ly_caddr (expr); - } - else if (head == ly_symbol2scm ("combine-stencil")) - { - output_stencil (ly_cadr (expr), o); - expr = ly_caddr (expr); - } - else - { - pscore_->outputter_-> - output_scheme (scm_list_n (ly_symbol2scm ("placebox"), - gh_double2scm (o[X_AXIS]), - gh_double2scm (o[Y_AXIS]), - expr, - SCM_UNDEFINED)); - - return; - } - } -} - -void -System::output_scheme (SCM s) -{ - pscore_->outputter_->output_scheme (s); -} - void System::add_column (Paper_column*p) { @@ -435,123 +377,77 @@ System::pre_processing () } } - - const int LAYER_COUNT= 3; - - - void -System::post_processing (bool last_line) +System::post_processing () { - for (SCM s = get_property ("all-elements"); - gh_pair_p (s); s = ly_cdr (s)) + for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s)) { - Grob* sc = unsmob_grob (ly_car (s)); - sc->calculate_dependencies (POSTCALCED, POSTCALCING, - ly_symbol2scm ("after-line-breaking-callback")); + Grob *g = unsmob_grob (ly_car (s)); + g->calculate_dependencies (POSTCALCED, POSTCALCING, + ly_symbol2scm ("after-line-breaking-callback")); } - Interval i (extent (this, Y_AXIS)); - if (i.is_empty ()) - programming_error ("Huh? Empty System?"); + Interval iv (extent (this, Y_AXIS)); + if (iv.is_empty ()) + programming_error ("System with zero extent."); else - translate_axis (- i[MAX], Y_AXIS); + translate_axis (-iv[MAX], Y_AXIS); - Real height = i.length (); - if (height > 50 CM) - { - programming_error ("Improbable system height"); - height = 50 CM; - } - - /* - generate all stencils to trigger all font loads. - */ + /* Generate all stencils to trigger font loads. + This might seem inefficient, but Stencils are cached per grob + anyway. */ SCM all = get_property ("all-elements") ; all = uniquify_list (all); - /* - trigger font loads first. - - This might seem inefficient, but Stencils are cached per grob - anyway. - */ this->get_stencil (); for (SCM s = all; gh_pair_p (s); s = ly_cdr (s)) { - Grob * g = unsmob_grob (ly_car (s)); + Grob *g = unsmob_grob (ly_car (s)); g->get_stencil (); } - - /* - font defs; - */ - SCM font_names = ly_quote_scm (get_paper ()->font_descriptions ()); - output_scheme (scm_list_n (ly_symbol2scm ("define-fonts"), - font_names, - SCM_UNDEFINED)); +} - /* - line preamble. - */ - Interval j (extent (this, X_AXIS)); - Real length = j[RIGHT]; - - output_scheme (scm_list_n (ly_symbol2scm ("start-system"), - gh_double2scm (length), - gh_double2scm (height), - SCM_UNDEFINED)); - - /* Output elements in three layers, 0, 1, 2. - The default layer is 1. */ - { - Stencil *m = this->get_stencil (); - if (m) - output_stencil (m->get_expr (), Offset (0,0)); - } - - for (int i = 0; i < 3; i++) - for (SCM s = get_property ("all-elements"); gh_pair_p (s); - s = ly_cdr (s)) +/* Return line: + ((HEIGHT . WIDTH) LINE) + LINE: list of ((OFFSET-X . OFFSET-Y) . STENCIL) + Maybe make clas/smob? */ +SCM +System::get_line () +{ + static int const LAYER_COUNT = 3; + SCM line = SCM_EOL; + if (Stencil *me = get_stencil ()) + line = scm_cons (scm_cons (ly_offset2scm (Offset (0, 0)), + me->smobbed_copy ()), line); + + /* Output stencils in three layers: 0, 1, 2. The default layer is + 1. */ + for (int i = 0; i < LAYER_COUNT; i++) + for (SCM s = get_property ("all-elements"); gh_pair_p (s); s = ly_cdr (s)) { - Grob *sc = unsmob_grob (ly_car (s)); - Stencil *m = sc->get_stencil (); - if (!m) - continue; - - SCM s = sc->get_property ("layer"); - int layer = gh_number_p (s) ? gh_scm2int (s) : 1; - if (layer != i) + Grob *g = unsmob_grob (ly_car (s)); + Stencil *stil = g->get_stencil (); + + /* Skip empty stencils and grobs that are not in this layer. */ + if (!stil + || robust_scm2int (g->get_property ("layer"), 1) != i) continue; - Offset o (sc->relative_coordinate (this, X_AXIS), - sc->relative_coordinate (this, Y_AXIS)); + Offset o (g->relative_coordinate (this, X_AXIS), + g->relative_coordinate (this, Y_AXIS)); - SCM e = sc->get_property ("extra-offset"); - if (gh_pair_p (e)) - { - Offset z = ly_scm2offset (e); - z *= Staff_symbol_referencer::staff_space (sc); - - o += z; - } - - output_stencil (m->get_expr (), o); + Offset extra = robust_scm2offset (g->get_property ("extra-offset"), + Offset (0, 0)) + * Staff_symbol_referencer::staff_space (g); + line = scm_cons (scm_cons (ly_offset2scm (o + extra), + stil->smobbed_copy ()), line); } - - - if (last_line) - { - output_scheme (scm_list_n (ly_symbol2scm ("stop-last-system"), SCM_UNDEFINED)); - } - else - { - output_scheme (scm_list_n (ly_symbol2scm ("stop-system"), SCM_UNDEFINED)); - } + Interval x (extent (this, X_AXIS)); + Interval y (extent (this, Y_AXIS)); + return scm_cons (ly_offset2scm (Offset (x.length (), y.length ())), line); } - Link_array System::broken_col_range (Item const*l, Item const*r) const { @@ -605,12 +501,8 @@ System::columns ()const } return acs; } - - - ADD_INTERFACE (System,"system-interface", "This is the toplevel object: each object in a score " - "ultimately has a System object as its X and Y parent. " - , - "between-system-string all-elements columns"); + "ultimately has a System object as its X and Y parent. ", + "between-system-string all-elements columns") diff --git a/scm/lily.scm b/scm/lily.scm index 161e8932fd..c2a0430bc5 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -388,13 +388,22 @@ L1 is copied, L2 not. )) (define-public (find-dumper format ) - (let* - ((d (assoc format output-alist))) + (let* ((d (assoc format output-alist))) (if (pair? d) (caddr d) - (scm-error "Could not find dumper for format ~s" format)) - )) + (scm-error "Could not find dumper for format ~s" format)))) + + +(define-public (make-title paper markup) + (if (markup? markup) + (let ((BASELINE-SKIP 2) + (props (list (append `((linewidth . ,(ly:paper-get-number + paper 'linewidth)) + (font-family . roman)) + (ly:paper-lookup paper 'font-defaults))))) + (stack-lines DOWN 0 BASELINE-SKIP + (list (interpret-markup paper props markup)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; other files. diff --git a/scm/output-ps.scm b/scm/output-ps.scm index 6be76dbece..24b259d369 100644 --- a/scm/output-ps.scm +++ b/scm/output-ps.scm @@ -44,11 +44,6 @@ ;; alist containing fontname -> fontcommand assoc (both strings) (define font-name-alist '()) -;; WIP -- stencils from markup? values of output-scopes -(define header-stencil #f) - -(define BASELINE-SKIP 3) - ;; /lilypondpaperoutputscale 1.75729901757299 def ;;/lily-output-units 2.83464 def %% milimeter ;;/output-scale lilypondpaperoutputscale lily-output-units mul def @@ -323,18 +318,6 @@ (string-append "/" key " {" val "} bind def\n") (string-append "/" key " (" val ") def\n")))) -(define (make-title port) - (if header-stencil - (let ((x-ext (ly:stencil-get-extent header-stencil Y)) - (y-ext (ly:stencil-get-extent header-stencil X))) - (display (start-system - (/ (interval-length x-ext) OUTPUT-SCALE) - (/ (interval-length y-ext) OUTPUT-SCALE)) - port) - (output-stencil port (ly:stencil-get-expr header-stencil) '(0 . 0)) - (display (stop-system) port))) - "") - (define (no-origin) "") ;; FIXME: duplictates output-scopes, duplicated in other backends @@ -356,12 +339,7 @@ ;; FIXME: duplicated in other output backends ;; FIXME: silly interface name (define (output-scopes paper scopes fields basename) - (let* ((props (list (append - `((linewidth . ,(ly:paper-get-number paper 'linewidth)) - (font-family . roman)) - (ly:paper-lookup paper 'font-defaults)))) - (prefix "lilypond") - (stencils '())) + (let ((prefix "lilypond")) ;; FIXME: duplicates output-paper's scope-entry->string, mostly (define (scope-entry->string key var) @@ -369,29 +347,14 @@ (if (memq key fields) (header-to-file basename key val)) (cond - ;; define strings, for /make-lilypond-title to pick up ((string? val) (ps-string-def prefix key val)) ((number? val) (ps-number-def prefix key val)) - ((markup? val) (set! stencils - (append - stencils - (list - (interpret-markup paper props val)))) - "") - (else "")))) + (else "")))) (define (output-scope scope) (apply string-append (module-map scope-entry->string scope))) - (let ((s (string-append (apply string-append (map output-scope scopes))))) - (set! header-stencil (stack-lines DOWN 0 BASELINE-SKIP stencils)) - - ;; match systems, which are also aligned to center - (ly:stencil-align-to! header-stencil Y CENTER) - - ;; trigger font load - (ly:stencil-get-expr header-stencil) - s))) + (string-append (apply string-append (map output-scope scopes))))) ;; hmm, looks like recursing call is always last statement, does guile ;; think so too? diff --git a/scm/output-tex.scm b/scm/output-tex.scm index 4698e8ee41..0ef9f4727a 100644 --- a/scm/output-tex.scm +++ b/scm/output-tex.scm @@ -99,6 +99,7 @@ (module-map (lambda (sym var) (let ((val (variable-ref var)) + ;;(val (if (variable-bound? var) (variable-ref var) '"")) (tex-key (symbol->string sym))) (if (memq sym fields) @@ -351,5 +352,3 @@ (define-public (tex-output-expression expr port) (display (eval expr this-module) port )) - -(define (make-title port) "") -- 2.39.2