]> git.donarmstrong.com Git - lilypond.git/blobdiff - stepmake/stepmake/tex-rules.make
Issue 5126: Prevent Ghostscript's unwanted automatic page rotation
[lilypond.git] / stepmake / stepmake / tex-rules.make
index 6310a60eff4b5acd665cf37e9c4147f395ef55f7..5b6e6c04d04c4a43c18708be7f69d193bd930836 100644 (file)
@@ -1,6 +1,6 @@
 
-#$(outdir)/%.tex: %.tex
-#      $(LN) $< $@
+$(outdir)/%.tex: %.tex
+       cp $< $@
 
 $(outdir)/%.dvi: $(outdir)/%.tex
        (cd $(outdir); tex \\nonstopmode \\input $(<F))
@@ -8,10 +8,30 @@ $(outdir)/%.dvi: $(outdir)/%.tex
 $(outdir)/%.dvi: $(outdir)/%.latex
        (cd $(outdir)&& \
          latex \\nonstopmode \\input $(<F)&&\
-         (bibtex $(basename $(<F) || true)&&\
+         (bibtex $(basename $(<F)) || true) && \
          latex \\nonstopmode \\input $(<F)&&\
-         latex \\nonstopmode \\input $(<F) ))
+         (makeindex $(basename $(<F)) || true) && \
+         latex \\nonstopmode \\input $(<F) )
+
+$(outdir)/%.pdf: $(outdir)/%.dvi
+       cd $(outdir) \
+               && dvips $(DVIPS_FLAGS) -t $(DVIPS_PAPERSIZE) \
+                       -o $(@F).pdfps $(<F) \
+               && gs -dCompatibilityLevel=1.2\
+                       -sPAPERSIZE=a4\
+                       -q\
+                       -dNOPAUSE\
+                       -dBATCH\
+                       -sDEVICE=pdfwrite\
+                       -dAutoRotatePages=/None\
+                       -sOutputFile=$(@F)\
+                       -dCompatibilityLevel=1.2\
+                       -sPAPERSIZE=a4\
+                       -c .setpdfwrite\
+                       -f $(@F).pdfps
+
+
+# without -dSAFER
+# gs 8.15 complains of safety of loading a ttf directly
 
-$(outdir)/%.ps: $(outdir)/%.dvi
-       dvips -ta4 -o $@ $<