]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scripts/lilypond-book.py (LATEX_DOCUMENT): More or less ugly
authorMats Bengtsson <mats.bengtsson@s3.kth.se>
Thu, 23 Jun 2005 10:56:07 +0000 (10:56 +0000)
committerMats Bengtsson <mats.bengtsson@s3.kth.se>
Thu, 23 Jun 2005 10:56:07 +0000 (10:56 +0000)
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).

ChangeLog
scripts/lilypond-book.py

index 3f5224437bdb604eeb2b34254843276078217d54..e31a343a7e36ef545585ed61d8d42a99609c9c3c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2005-06-23  Mats Bengtsson  <mabe@drongo.s3.kth.se>
 
+       * 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.
 
index e3e62de2dabee0d492cf4094bcc15b025a778457..64eae0d3d4696ce773cb7c4d21c0d4ba689fc17f 100644 (file)
@@ -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<preamble>\\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)