lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: org-babel-lilypond export,automatic image trimming?


From: pls
Subject: Re: org-babel-lilypond export,automatic image trimming?
Date: Wed, 14 Jan 2015 10:19:55 +0100

James and Phil,

I know, it’s a bit late to join the party — but better late than never! ;)

I experimented a bit with org-babel-lilypond (version 7.9.3f) in basic mode and it looks like -dpreview is not absolutely necessary to automatically trim images in org-mode. I didn’t have to manipulate my .emacs file either and I got rid of the package listings:

#+TITLE: 
#+DATE:
#+AUTHOR:
#+OPTIONS: timestamp:nil num:nil toc:nil 
#+LaTeX_HEADER: \usepackage[cm]{fullpage}

** Pitches
   - Pitch: =a b c d e f g=
     - Flat: Using English note names, =af bf= etc.
     - Sharp: Using English note names, =cs ds= etc. 
#+LaTeX: \linebreak
# #+LaTeX: \begin{center}  %comment
#+begin_src lilypond :exports both :file pitches.eps :noweb yes
  <<version-and-paper>>
  \include "english.ly"
  #(set-global-staff-size 14)
  { c' e' g' fs' a' c'' ef'' d' }
#+end_src
#+RESULTS:
[[file:pitches.eps]]
# #+LaTeX: \end{center} %comment 

** Rhythms

#+name: version-and-paper()
#+begin_src org :exports none
\version "2.18.2"
\paper {
  oddFooterMarkup=##f
  scoreTitleMarkup=##f
  indent = 4\cm
}
#+end_src

hth
patrick

P.S.: I’m actually quite convinced that ob-lilypond basic-mode in combination with org-mode really is a very flexible and powerful alternative to lilypond-book. Shouldn’t it be mentioned in the docs, at least?

P.P.S:  [Slightly OT] Has anyone ever managed to generate files in arrange-mode? (see http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-lilypond.html) The functions gen-triad, generate_bassline, gen_arpeggio didn’t seem to be globally available when I tried to generate PDFs, HTML, Texinfo…from e.g. https://raw.githubusercontent.com/mjago/ob-lilypond/master/examples/arrange-mode/Modal-Cycle/modal-cycle.org. I got errors such as “Reference ‘gen_arpeggio’ not found in this buffer” even though it definitely is defined in the buffer.  To me arrange-mode looks like a very promising tool to generate different editions from a single source!


On 05.11.2013, at 15:49, James Harkins <address@hidden> wrote:

On Mon, Nov 4, 2013 at 10:05 PM, Phil Holmes <address@hidden> wrote:
tagline = ##f

will get rid of the tagline.

Using -dpreview on the command line will provide trimmed images.  Be a
little careful with this, since it sometimes trims a little too much.

Thanks. For future reference, it's working now, like this:

In ~/.emacs (only way to add -dpreview):

(setq ly-nix-ly-path "/home/dlm/share/lilypond/myinstall/bin/lilypond
-dpreview")

In the org file, near the top:

#+BIND: org-latex-listings-options (("basicstyle"
"\\ttfamily\\scriptsize") ("captionpos" "b") ("tabsize" "3"))
#+PROPERTY: header-args:lilypond :prologue \header{tagline=##f}
#+LATEX_HEADER: \newcommand{\inpcode}[1]{\texttt{#1}}
#+LATEX_HEADER: \usepackage{listings}

(Also customized org-latex-listings to "use listings.")

Then:

** Pitches
   - Pitch: @@latex:\inpcode{a b c d e f g}@@
     - Flat: Using English note names, @@latex:\inpcode{af bf}@@ etc.
     - Sharp: Using English note names, @@latex:\inpcode{cs ds}@@ etc.
#+name: pitches
#+begin_src lilypond -i :exports both :file babel/pitches.png
\include "english.ly"
{ c' e' g' fs' a' c'' ef'' d' }
#+end_src

Produces the attached. :)

hjh
<for-ly-list.png>_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

[Prev in Thread] Current Thread [Next in Thread]