Thanks; I'm getting closer. I think I have everything set up almost right; I can enable my module without it asking for a converter, but once I do, the "view" and "update" buttons are grayed out; it seems to be that I can't export.

Here's what I've got so far, copying what I saw in the Lilypond book module:

File Format Definition:
Format: Chordii
    -checked document format
    -checked show in export menu
short name: chordii
extension: cho
other fields blank

Converter:
Chordii->PDF (Xetex) -I'm exporting using Xetex, so this was my best guess.
converter: ~/scripts/leadsheet.sh $$r $$i

contents of leadsheet.sh, which is one of 3 scripts I've written, so it might be a bit of a hack job. I currently use this on the command line when using chordii. It processes the chordii file, which generates a ps, which is converter to a pdf. Files are renamed and removed in the process.

-One issue that might come up is that the way the file name is passed through the script as a variable; notice that inputing file.cho would result in error file.cho.cho due to $FILE1.cho in the script.

#!/bin/bash

FILE1=$1

for FILE1 in "$@"
do
chordii -a -G -P letter $FILE1.cho > $FILE1.ps | ps2pdf $FILE1.ps $FILE1.pdf | xargs rm $FILE1.ps && pdfcrop $FILE1.pdf && mv $FILE1-crop.pdf $FILE1.pdf
done

echo "Done"

and here's the module:
#\DeclareLyXModule[chordii->pdf]{Chordii}
#DescriptionBegin
#This module adds an inset to enter Chorddii LilyPond code directly into LyX.
#It will be processed in the output. The pdf will be clipped by pdfcrop.
#DescriptionEnd
#Excludes: sweave

# Author: Kale Good <k...@kalegood.com>

Format 35
OutputFormat           chordii

InsetLayout "Flex:Chordii"
        LabelString           Chordii
        LaTeXType             Environment
        LaTeXName             chordii
        LyXType               Custom
        Decoration            Classic
        Font
          Color               latex
          Family              typewriter
        EndFont
        LabelFont
          Color               latex
          Size                Small
        EndFont
        MultiPar              true
        CustomPars            false
        ForcePlain            true
        FreeSpacing           true
        PassThru              true
        ParbreakIsNewline     true
        ForceLTR              true
        Spellcheck            true
End

Thanks for any help!

Best,
kale


On Mon 22 Jul 2013 10:20:20 PM EDT, Scott Kostyshak wrote:
On Mon, Jul 22, 2013 at 10:11 PM, Kale Good <k...@kalegood.com> wrote:
Took a look at that and its not quite what I had in mind. This might be
because I miscommunicated.

It was probably I that misunderstood.

Here is the Lilypond module description. I want to do this, but with
Chordii.
This module adds an inset to enter LilyPond code directly into LyX. It will
be processed in the output.

For my lilypond files, I'm using the lilypond-book module (file name
lilypond.module), not the lilypond external template. If I'm understanding
correctly, creating an external template would force me to go to the
external file to edit any changes in said file. I want to be able to edit
everything in my lyx file; if I'm understanding this correctly, this means I
want a module rather than an external template.

I think you understood correctly.


I managed to copy, paste, and edit lilypond.module and get it to show up;
now it seems I need to create a converter. If I'm understanding correctly,
converters are a Latex thing rather than a Lyx thing. Can someone point me
in the right direction?


Converters are a LyX thing. You can see examples by going to Tools >
Preferences > File Handling > Converters. You can read about them in
the Customization manual, "3.3 Converters"

Best,

Scott

--
Kale Good: Guitar Instructor
phillyguitarlessons.com <http://phillyguitarlessons.com>
k...@kalegood.com <mailto:k...@kalegood.com>
phone: (215)260-5383

 * 4705 Baltimore Ave, Phila, PA 19143 -mailing & lessons
 * 1867 Frankford Ave. Phila, PA 19125 -lessons

Google+ <https://plus.google.com/b/105422331794047992190/>
Facebook <http://facebook.com/KaleGoodGuitarStudio>
Read my article "The Seven Secrets to Six String Success
<http://www.guitarnoise.com/lesson/seven-secrets-to-six-string-success/>" at
GuitarNoise.com <http://guitarnoise.com>
Leading the Journey from No-Skills-Guitarist to Talented Musician!


Reply via email to