From: Mats Bengtsson Date: Thu, 23 Jun 2005 10:56:07 +0000 (+0000) Subject: * scripts/lilypond-book.py (LATEX_DOCUMENT): More or less ugly X-Git-Tag: release/2.6.0~15 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f5e81dd9ca9e3621709898e6518ab7295377ac7c;p=lilypond.git * scripts/lilypond-book.py (LATEX_DOCUMENT): More or less ugly workaround since /dev/stdin doesn't work on Cygwin. Using a temporary file in the current directory since latex doesn't understand the path name to the default TMP in Cygwin (at least on win XP). --- diff --git a/ChangeLog b/ChangeLog index 3f5224437b..e31a343a7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2005-06-23 Mats Bengtsson + * scripts/lilypond-book.py (LATEX_DOCUMENT): More or less ugly + workaround since /dev/stdin doesn't work on Cygwin. Using a + temporary file in the current directory since latex doesn't + understand the path name to the default TMP in Cygwin (at least on + win XP). + * Documentation/user/global.itely (Creating titles): Correct misprint in example. Thanks to Rob Vlasaty. diff --git a/scripts/lilypond-book.py b/scripts/lilypond-book.py index e3e62de2da..64eae0d3d4 100644 --- a/scripts/lilypond-book.py +++ b/scripts/lilypond-book.py @@ -116,7 +116,7 @@ psfonts_p = 0 use_hash_p = 1 format = 0 output_name = '' -latex_filter_cmd = 'latex "\\nonstopmode \input /dev/stdin"' +latex_filter_cmd = 'cat > %(tmpfile)s && latex "\\nonstopmode \input %(tmpfile)s" && rm %(tmpfile)s' filter_cmd = 0 process_cmd = '' default_ly_options = { 'alt': "[image of music]" } @@ -1276,7 +1276,11 @@ def get_latex_textwidth (source): m = re.search (r'''(?P\\begin\s*{document})''', source) preamble = source[:m.start (0)] latex_document = LATEX_DOCUMENT % vars () - parameter_string = filter_pipe (latex_document, latex_filter_cmd) + # Workaround problems with unusable $TMP on Cygwin: + tempfile.tempdir = '' + tmpfile = tempfile.mktemp('.tex') + cmd = latex_filter_cmd % vars () + parameter_string = filter_pipe (latex_document, cmd) columns = 0 m = re.search ('columns=([0-9.]*)', parameter_string)