Re: [Tex-music] Compiling mtxdoc in Windows (was RE: Compile error in M-Tx documentation)

2011-05-04 Thread David Allsopp
Bob Tennent wrote:
  |... I wouldn't think that Windows users would  |have any interest
 in constructing mtxdoc.pdf from scratch.
  |
  |I've been responsible for creating extensive revisions of musixdoc,
 |which is  |a more complex document than mtxdoc, and I did all the work
 in  |Windows. So I  |have more than a passing interest in learning as
 much as I can about the  |process. And one thing I've learned is that
 the process can be simpler and  |the files required much less numerous
 if you just embed the musical  |examples  |in the document, much less
 breaking individual examples into more than one  |file each.
 
 Don: I wasn't thinking of you as the typical Windows user. If you just
 want to learn about how Dirk sets up his compilation, that's fine. But
 you might want to ask Dirk why he set it up the way he did.

make (or derivatives) is the only logical system to use for the build system of 
code-based projects - the difference between make and a shell script is that 
make only rebuilds files which need to be rebuilt (so, for example, if you 
changed mtxdoc.tex, Dirk's Makefile would not rebuild all of the examples from 
the .mta and .mtb files and if you changed just one .mta or .mtb file then it 
would only rebuild the examples which depend on that specific file, not all of 
them). While the difference is irrelevant if you're building a project from 
scratch (i.e. for a deployment/installation script), that's very useful when 
you're actually working on it as you don't have to recompile absolutely 
everything each time you want to see a change.

 |And if this is considered important for some reason, a batch file
 |isn't the right way to do it.
 |
 |I'm puzzled why you would say that, partly because I don't think you
 |mean Why waste the effort on writing a batch script if you're only
 |going to do the compilation once or twice. The response by David
 |seems to show how to fill in the pieces.
 
 
 The problem with a batch script is that, like a Makefile, it's platform
 dependent.

Incorrect - GNU make is *extremely* cross-platform, by design - the caveat is 
that you have to write your Makefiles in a cross-platform way. Similarly, it's 
quite easy to write platform-dependent Lua scripts - it's what you write, not 
what you write it in that creates the problem.

 Instead of trying to emulate the Makefile in Windows, we
 should be replacing it by a platform-independent script in Lua. (This is
 similar to what's been done with musixflx: we no longer need to compile
 separate binaries for Window, Macs, Linux, Solaris, etc. because
 musixflx.lua will work everywhere.) I don't think every mtx user will
 want to re-build mtxdoc.pdf for themselves so this isn't high priority.
 And it's really Dirk's problem, because it's his document.

The only big (Windows) problem with the Makefile is the use of ln which, 
despite proper underlying support in Windows Vista onwards is an awkward 
command because it requires an elevated command prompt to use it. make is 
trivially easy to install - you install 
http://gnuwin32.sourceforge.net/downlinks/make.php and then 
http://gnuwin32.sourceforge.net/downlinks/coreutils.php as this gives you 
Windows versions of commands like cp (the equivalent of copy) and rm (the 
equivalent of del), etc. GNU make itself is just one .exe and two supporting 
.dlls (i.e. you do not have to install a monster like Cygwin in order to get 
it).

Although my personal preference is to install Unix utilities on Windows (as 
they're generally superior to the equivalent Windows commands), it's also 
possible to write your Makefile to detect Windows and adapt the commands it 
uses accordingly.

This is getting a bit off-topic - it's just that seeing a relatively new 
poster-child (Lua in this case) being over-touted to solve problems already 
dealt with by a much older and better-suited tool tends to hit a nerve! Lua is 
a very good idea for replacing shell scripts and auxiliary programs (i.e. 
musixflx, makeindex, etc.), but not build systems.


David

---
TeX-music@tug.org mailing list
If you want to unsubscribe or look at the archives, go to 
http://tug.org/mailman/listinfo/tex-music


Re: [Tex-music] Compiling mtxdoc in Windows (was RE: Compile error in M-Tx documentation)

2011-05-04 Thread Dirk Laurie
On Wed, May 04, 2011 at 02:44:07AM +0200, Bob Tennent wrote:
 
 But you might want to ask Dirk why he set it up the way he did. 
Back in 2005 I couldn't think of a better way to do it.  The best way
to see how dated the stuff is, is to notice that there is still a rule
for making a LaserJet version in make-dvi.

 And it's really Dirk's problem, because it's his document.
A statement like this is never true for any open-source software.  

It's all about writing a LaTeX document containing numerous small music
excerpts.  I'm not the only person who does that.  By distributing my
Makefile, I'm basically saying to the community: this is how I did it,
you're welcome to use some of my ideas if you like.  

Dirk

---
TeX-music@tug.org mailing list
If you want to unsubscribe or look at the archives, go to 
http://tug.org/mailman/listinfo/tex-music


[Tex-music] Compiling mtxdoc in Windows (was RE: Compile error in M-Tx documentation)

2011-05-03 Thread Don Simons
(Lack of) progress report:

1. In a Windows command window, I've succeeded in creating *.tex for all of
the *.mtx, using only commands starting with 

for %a in (*.

In the process I figured out how to pass only the basenames of all *.pmx to
musixflx with

for %a in (*.pmx) do musixflx %~na

2. I've succeeded in creating *.ps for all those tex files, again using
for commands. But evidently my TeX system lacks the control sequence
\textit.

3. I got the latex compilation started. During that I had to let MiKTeX
install a bunch of packages it was missing. Then it even seemed to process
some of the inserted tex files after I included \usepackage{etex} as
suggested. But it choked on \input netsoos1.tex. Looking in the makefile
it appears that this and various other *.tex are created on the fly by
merging various *.mta and *.mtb files. 

At that point it transitioned from adventure to slog, and I threw in the
towel, leaving the keys to this forbidden kingdom to the Unix gurus for the
time being.

--Don Simons

-Original Message-
From: tex-music-boun...@tug.org [mailto:tex-music-boun...@tug.org] On
Behalf Of Don Simons
Sent: Monday, May 02, 2011 5:16 PM
To: 'Werner Icking Music Archive'; 625...@bugs.debian.org
Subject: Re: [Tex-music] Compile error in M-Tx documentation

I'm glad that the Linux-Unix-Debian-pdftex contingent can now sleep
soundly. I also see exactly how the new PMX etex-demanding commands got
into the mix (when the embedded examples were compiled with mtx/pmx).

But there are still a few mysteries I'd like to pursue, for my own
satisfaction if nothing else.

They start with what happens when I try to compile mtxdoc according to
Dirk's instructions. I didn't think makefiles had a place in the Windows
command window, but to my surprise, when I unzipped mtxD060.zip and
blindly typed

make dvitarget  make config

as instructed, I did not get nothing. Instead, I got

ln -sf make-dvi make-target
process_begin: CreateProcess((null), ln -sf make-dvi make-target, ...)
failed.
make (e=2): The system cannot find the file specified.
make: *** [dvitarget] Error 2

Verry interesting, but from this point on I'm clueless on this path.
However, just for laughs I will try to compile the document using
commands I do know about such as

for %a in (*.mtx) do prepmx %a

At the moment the next mystery is how to similarly send just the
basenames as arguments to the musixflx command. Or maybe it'll work on
*.mx1 ?

--Don Simons

-Original Message-
From: tex-music-boun...@tug.org [mailto:tex-music-boun...@tug.org] On
Behalf Of Roland Stigge
Sent: Monday, May 02, 2011 9:46 AM
To: Werner Icking Music Archive; 625...@bugs.debian.org
Subject: Re: [Tex-music] Compile error in M-Tx documentation

Hi,

On 05/02/2011 05:33 PM, Simon Dreher wrote:
 it seems to work if you add the line
 \usepackage{etex}
 directly after the \documentclass[11pt]{article} line.

Thanks for all your suggestions! Adding the above line to mtxdoc.tex,
halleluja.ltx and kanons.ltx fixes the problem. (Doing it the old
fashioned way as Don suggested would also work, but it wasn't necessary
in the end.)

The attached patch fixes the Debian bug. Will upload later.

bye,
  Roland



---
TeX-music@tug.org mailing list
If you want to unsubscribe or look at the archives, go to
http://tug.org/mailman/listinfo/tex-music


---
TeX-music@tug.org mailing list
If you want to unsubscribe or look at the archives, go to 
http://tug.org/mailman/listinfo/tex-music


Re: [Tex-music] Compiling mtxdoc in Windows (was RE: Compile error in M-Tx documentation)

2011-05-03 Thread David Allsopp
Don Simons wrote:
 At that point it transitioned from adventure to slog, and I threw in the
 towel, leaving the keys to this forbidden kingdom to the Unix gurus for
 the time being.

Quick translation of the Makefile (I haven't tested it)

 make dvitarget

The effect of this statement is to cause the next invocation of make to read 
the file make-dvi instead of make-pdf (which is the default)

 make config

This effectively copies prepmx to the current directory (so not necessary if 
you have prepmx in your PATH if building manually)

 make

This will build mtx.dvi using the following sequences which I translate:

touch mtxdoc.mx1 ==  copy nul mtxdoc.mx1
rm *.mx? ==  del *.mx?
- $(latex) mtxdoc==  latex mtxdoc
musixflx mtxdoc
makeindex mtxdoc
- $(latex) mtxdoc== latex mtxdoc
- $(latex) mtxindex  ==  latex mtxindex
rm ...   ==  del ...

However, as a prerequisite, it requires the examples to build which you should 
be able to do by saying: (newlines are important)

for %i in (*.mta) do (
  if not exist %~ni.mtb (
for %j in (%~ni*.mtb) do 
  copy %i %~nj.mtx
  copy %~nj.mtx + %j
  prepmx %~nj
  pmxab %~nj
  del %~nj.pml %~nj.pmx pmxaerr.dat
)
  ) else (
copy %i %~ni.mtx
copy %~ni.mtx + %~ni.mxb
prepmx %~ni
pmxab %~ni
del %~ni.pml %~ni.pmx pmxaerr.dat
  )
)

(it's possible that actually you should remove the prepmx, pmxab and del 
commands and put them in a separate loop over *.mtx after running the first bit 
but I haven't checked whether there are additional .mtx files in the zip...)


David 

---
TeX-music@tug.org mailing list
If you want to unsubscribe or look at the archives, go to 
http://tug.org/mailman/listinfo/tex-music


Re: [Tex-music] Compiling mtxdoc in Windows (was RE: Compile error in M-Tx documentation)

2011-05-03 Thread Bob Tennent
 |(Lack of) progress report:
 |
 |1. In a Windows command window, I've succeeded in creating *.tex for
 |all of
 |the *.mtx, using only commands starting with
 |
 |for %a in (*.
 |
 |In the process I figured out how to pass only the basenames of all
 |*.pmx to
 |musixflx with
 |
 |for %a in (*.pmx) do musixflx %~na
 |
 |2. I've succeeded in creating *.ps for all those tex files, again using
 |for commands. But evidently my TeX system lacks the control sequence
 |\textit.
 |
 |3. I got the latex compilation started. During that I had to let MiKTeX
 |install a bunch of packages it was missing. Then it even seemed to process
 |some of the inserted tex files after I included \usepackage{etex} as
 |suggested. But it choked on \input netsoos1.tex. Looking in the makefile
 |it appears that this and various other *.tex are created on the fly by
 |merging various *.mta and *.mtb files.
 |
 |At that point it transitioned from adventure to slog, and I threw in the
 |towel, leaving the keys to this forbidden kingdom to the Unix gurus
 |for the
 |time being.

Don: Why are you doing this? I wouldn't think that Windows users would
have any interest in constructing mtxdoc.pdf from scratch. And if this
is considered important for some reason, a batch file isn't the right
way to do it.

Dirk: Shouldn't you be following your own advice? Re-write the Makefile
in Lua (and only use tools available on every platform)!

Bob T.
---
TeX-music@tug.org mailing list
If you want to unsubscribe or look at the archives, go to 
http://tug.org/mailman/listinfo/tex-music


Re: [Tex-music] Compiling mtxdoc in Windows (was RE: Compile error in M-Tx documentation)

2011-05-03 Thread Dirk Laurie
On Tue, May 03, 2011 at 12:39:44PM +0200, Bob Tennent wrote:
 
 Dirk: Shouldn't you be following your own advice? Re-write the Makefile
 in Lua (and only use tools available on every platform)!
 
It's on my TODO list, but not at this moment very high up.

Dirk 

---
TeX-music@tug.org mailing list
If you want to unsubscribe or look at the archives, go to 
http://tug.org/mailman/listinfo/tex-music


Re: [Tex-music] Compiling mtxdoc in Windows (was RE: Compile error in M-Tx documentation)

2011-05-03 Thread Don Simons
Bob Tennent wrote

... I wouldn't think that Windows users would
have any interest in constructing mtxdoc.pdf from scratch. 

I've been responsible for creating extensive revisions of musixdoc, which is
a more complex document than mtxdoc, and I did all the work in Windows. So I
have more than a passing interest in learning as much as I can about the
process. And one thing I've learned is that the process can be simpler and
the files required much less numerous if you just embed the musical examples
in the document, much less breaking individual examples into more than one
file each.

And if this
is considered important for some reason, a batch file isn't the right
way to do it.

I'm puzzled why you would say that, partly because I don't think you mean
Why waste the effort on writing a batch script if you're only going to do
the compilation once or twice. The response by David seems to show how to
fill in the pieces.

--Don Simons




---
TeX-music@tug.org mailing list
If you want to unsubscribe or look at the archives, go to 
http://tug.org/mailman/listinfo/tex-music


Re: [Tex-music] Compiling mtxdoc in Windows (was RE: Compile error in M-Tx documentation)

2011-05-03 Thread Bob Tennent
 |... I wouldn't think that Windows users would
 |have any interest in constructing mtxdoc.pdf from scratch.
 |
 |I've been responsible for creating extensive revisions of musixdoc,
 |which is
 |a more complex document than mtxdoc, and I did all the work in
 |Windows. So I
 |have more than a passing interest in learning as much as I can about the
 |process. And one thing I've learned is that the process can be simpler and
 |the files required much less numerous if you just embed the musical
 |examples
 |in the document, much less breaking individual examples into more than one
 |file each.

Don: I wasn't thinking of you as the typical Windows user. If you just
want to learn about how Dirk sets up his compilation, that's fine. But
you might want to ask Dirk why he set it up the way he did. 

 |And if this is considered important for some reason, a batch file
 |isn't the right way to do it.
 |
 |I'm puzzled why you would say that, partly because I don't think you
 |mean Why waste the effort on writing a batch script if you're only
 |going to do the compilation once or twice. The response by David
 |seems to show how to fill in the pieces.

The problem with a batch script is that, like a Makefile, it's platform
dependent. Instead of trying to emulate the Makefile in Windows, we
should be replacing it by a platform-independent script in Lua. (This
is similar to what's been done with musixflx: we no longer need to
compile separate binaries for Window, Macs, Linux, Solaris, etc. because
musixflx.lua will work everywhere.) I don't think every mtx user will
want to re-build mtxdoc.pdf for themselves so this isn't high priority.
And it's really Dirk's problem, because it's his document.

Bob
---
TeX-music@tug.org mailing list
If you want to unsubscribe or look at the archives, go to 
http://tug.org/mailman/listinfo/tex-music