Suggestion: a good start for footnotes Insert > Char > Footnote#

Previous topic - Next topic

jack_cat

We see a fertile mind at work. I don't know how long it will take me to catch up.
I will plug along in Dragonfly's dust trail. Hasta pronto.

dragonfly

I have been studying how to build the final leg of the pipeline from Atom to Scribus.

All roads lead to Rome.

But I read here from post#3 ..

QuoteAll of my many files (accumulated last 3 years) are made with 1.4.6, and I understand that 1.5 uses a new file format not backwardly-compatible; this and the report that the footnote functions are still incomplete has discouraged me from making an experiment.

From my reading through the forum there are many users still using the stable version of Scribus 1.4.x.

I have been experimenting on Scribus-trunk 1.5.5 (daily build) which has the ability to exploit python scripting to move pre-processed content from Atom (or LibreOffice) into Scribus.

However Scripter is not available on early version 1.4.x.

This leads me to consider developing two pipeline routes for different users.

(a) Atom accessing Scribus through methods in Atom which leverage the Scribus XML (.sla) format. This approach should work for both 1.4.x (stable) and 1.5.x (development).

(b) Atom driving Scribus through command line and leveraging Scripter.
This will not work with 1.4x but I can see should work with 1.5.x.

I'm not sure about the relative populations of 1.4.x users vs 1.5.x users.

My personal preference is the XML route which should support both 1.4.x and 1.5.x including legacy documents.


dragonfly


jack_cat

Quote from: dragonfly on September 24, 2018, 12:01:25 PM
@jack_cat
How are you faring? Need any tips on usage?

thanks for asking...
I have focused lately on learning Lilypond, which I am doing from within Atom using Lily-compile after almost every keystroke. Mostly, learning Lilypond is a matter of finding code snippets online, plugging them into the file and seeing if they work, which usually they don't the first time, but with patience I have solved everything so far.

An issue that has arisen just now has to do with the export routine via either .svg or .png from Lilypond for insertion into Scribus (bypassing markdown etc for the moment ).

I just did a test because I wanted to compare Lilypond output directly to MusEdit output (a cheap and useful workhorse I have had since 1997), so I re-created one of my MusEdit examples in Lilypond and put them side by side in a test.sla file and exported to .pdf to look at it in Foxit reader. Not to knock MusEdit which has many very useful features for an inexpensive and now antiquated program, but Lilypond's output is definitely up to Schirmer edition engraving standards and looks much classier, not to say, ahem, more professional.

I had no luck trying to use File > Import > Get Vector File (or whatever it is) in Scribus, couldn't make that routine work, nohow, at least so far... I had hoped Scribus would import the .svg and just deal with it automatically, but there is something I don't know.

so I changed from .svg to .png to try that (changing Lily-compiles output setting). I placed Lilypond and MusEdit .png files with very nearly the same content side by side on a two page spread in Scribus to compare. Visually in .pdf in the reader, without going to print, the result is excellent, but:

Lilypond's .png is lower res at only 100 dpi than the 144 dpi that Scribus wants. It looks OK in .pdf, but it probably will not look so good in print, and I have to override Scribus's error message on the pdf export. MusEdit exports, optionally, hi-res .png files, a very nice feature, they are far higher res than necessary but they look sharp in print. So, I have to find out how to make Lilypond generate hi-res .png images, and then to find out - ha, this is a long shot for python-ignoramus me - whether Lily-compile can be tweaked to have this option. Do you have a comment on that possibility? This is premature, because I have interrupted the search for a Lilypond hi-res .png feature to check in here and take a few minutes to answer your inquiry.

As far as Atom goes, I am just getting used to using it. I have updated my web site editing HTML with it, no problem, although there is no obvious advantage over my other html editor, as matters stand. I have not done much with Markdown - it looks pretty straightforward and transparent as far as I can tell, and I will play with it on small test projects as they come up.

So that's the report, as far as it goes, inconclusive for the moment, because I still have a long learning curve for Lilypond ahead. I have left the revision of my older project draft with the footnotes, for which I began this thread, on ice for now, will get back to it when I'm ready. I have no shortage of projects on hand, so right now I am putting in a couple of hours on Lilypond every day or two, and am keeping busy.

I post a screenshot of my test file output.

ps: this from Lilypond docs, command line options:

____

--png

    Generate pictures of each page, in PNG format. This implies '--ps'. The resolution in DPI of the image may be set with

        -dresolution=110


____

do I dare open up the python file for lily-compile and find and tweak this? Any advice?

thanks
jack_cat



[attachment deleted by admin]

jack_cat

Ok, I found the place to put "custom arguments" into Lily-compile.

a.l.e

can you please upload the svg to the bug tracker and see if the team can find what's wrong with it?

https://bugs.scribus.net

there might be a problem on the lillypond side... or on the scribus side...

dragonfly

That looks like good progress to me.
I can confirm that rendering the SVG output from lilypond in Scribus frame hits  problems. When I have time I will look into the internal structure. But as @i.l.e suggests send a sample to the Scribus developers.

Meanwhile you have to focus on PNG.

It is a wise move to park using other features until you grasp the lilypond command line options.

I suggest that you track two parallel forums:
(a) this Scribus forum
(b) Lilypond forum

Looking at latter forum ..

http://lilypond.1069038.n5.nabble.com/Horizontalized-scores-td158972.html#a159389

this led me here ..

http://www.notezilla.io/

http://www.notezilla.io/p/beethoven/fur-elise

Might give you some ideas for monetising your works (re: your earlier observations on earning returns).

I tried this command ..

lilypond --png -danti-alias-factor=10 -dresolution=300 example.ly

I think that you will need to install ImageMagick.

The output looks crisp (note use of anti-alias and increased resolution).
I made the mistake of missing out the "-" before d. Then it worked when I corrected arguments.

If you want to build up a library of different commands to try then I suggest that you install the scripts package in Atom.

Then a library of frequently used commands can be created as one liner scripts and run by Scripts.  This might be easier than frequently modifying the custom arguments field in lily-compile.

Here is an example .. lilypond-png.sh

#!/bin/bash

filename="/home/user/Atom-repo/music-experiment/example.ly"

lilypond --png -danti-alias-factor=10 -dresolution=300 $filename



dragonfly


dragonfly

Re: Scribus not rendering correctly the SVG output from LilyPond compilation.

I have an idea that the Scribus SVG rendering engine might need to import LilyPond fonts?
I will explore that theory at some point (but this idea is parked for now).
Meanwhile other exported image formats work nicely.

jack_cat

Quote from: a.l.e on September 27, 2018, 09:20:53 AM
can you please upload the svg to the bug tracker and see if the team can find what's wrong with it?

https://bugs.scribus.net

there might be a problem on the lillypond side... or on the scribus side...

Quote from: dragonfly on September 27, 2018, 03:14:46 PM
I can confirm that rendering the SVG output from lilypond in Scribus frame hits problems.

I was not sure that the error was not mine in some way. Dragonfly confirms some kind of error.
It is a little difficult to describe; Scribus gives multiple error messages on trying to export, to the
effect that many objects are not on a page.
I have not tried to reproduce the error or work around it, but I have uploaded an .svg file:

https://bugs.scribus.net/view.php?id=15454

a.l.e

thanks for filling the ticket!
i've added a preview of what inkscape sees and exports as png...

let's hope that someone finds the issue...

dragonfly

In the issue tracker @utnik pinned down this issue ..

The discussion of "currentColor" in lilypond output SVG file is found in lilypond forum

http://lilypond.1069038.n5.nabble.com/rsvg-view-can-t-display-SVG-files-created-by-lilypond-tc191462.html#a191496

I have found that string "currentColor" is in one location in lilypond installation.
In my Ubuntu 16.04 it is here ..
/usr/share/lilypond/2.18.2/scm/output-svg.scm

The path will differ in Windows.

As a workaround, this file can be edited to change "currentColor" to "black" throughout.

I searched to find "what is an .scm file ?".

I found this ..

https://fileinfo.com/extension/scm

QuoteWhat is an SCM file?

File Type 8
Schema File
Descriptor file that describes another document, such as an XML file; typically specifies the structure and formatting of the document as well as what type of data it can contain.

================================

[Later edit]

One option I explored before finding the above workaround was to pipe lilypond commandline SVG output through a filter to change "currentColor" to "black".

I read here that pandoc has a filter for lilypond.

https://github.com/jgm/pandocfilters

and here .. lilypond.py

https://github.com/jgm/pandocfilters/blob/master/examples/lilypond.py

I did not explore this idea further.

a.l.e

the lillypond authors seem to know about the issue but (probably) wrongly decided to do nothing...

can somebody who uses lillypond try to post a bug report for this issue with jean's explanation from the bug tracker and telling them that this shortcut makes hard to import the svg in scribus?
(i mean, they could keep track of the color used and always set it explicitly, instead of relying on a default value that seems not to be 100% standardized)

dragonfly

Done. They are about to release a new version so hopefully it might be brought into line with Scribus SVG import.

jack_cat

Re the .svg issue, well, I'm glad this didn't turn out to be totally just my cluelessness! Thanks DF & ALE for helping identify the issue.

On the other issue of the  .png resolution:
I tried putting this string into the lilypond command line in Atom-package lily-compile's settings:

-danti-alias-factor=10 -dresolution=300

where I had, before, had only

-dresolution=300

and got peculiar results including nothing happening,  a partial (?) error message, and making the VI program (Windows free image viewer I use) hang also, so that it displayed only a black screen even on other images, which went away after I closed and restarted it.

So this is why DF said,
"I think that you will need to install ImageMagick."
I may do this although I am not yet convinced of the necessity... (ahem, to be continued.)

When I tried the complete string (as given above by DF) directly in the Windows command line it took a very long time, and finally produced an error message, screen shot attached (for the record, although DF has been over this before.)

a search for "pngtopnm" turned up this page:

http://netpbm.sourceforge.net/doc/pngtopnm.html

with this text:
"...
This program is part of Netpbm.

pngtopnm was obsoleted by pngtopam, introduced with Netpbm 10.44 (September 2008). pngtopam is backward compatible with pngtopnm, plus adds many additional functions, including the ability to produce a PAM image that includes a transparency (alpha) channel. Starting in Release 10.48, pngtopnm is just an alias for pngtopam.

pngtopnm remained in the Netpbm package through Release 10.47 because it may have fewer bugs than pngtopam in those releases, and may be faster in some environments. But pngtopnm's incompatibility with the most current PNG libraries makes it impractical to maintain along with pngtopam now.

In releases before 10.48, you can use the pngtopam documentation for pngtopnm, considering the following differences:

    pngtopnm options are a subset of pngtopam's, as documented above.
    Any change that the pngtopam manual says happened in or after Netpbm 10.44 doesn't apply to pngtopnm.

..."

I also found this by searching "pngtopnm windows"

http://gnuwin32.sourceforge.net/packages/pngutils.htm

"PngUtils is a collection of utilities for PNG images: "

list of files including:

"[bullet] PngtoPnm: convert a Portable Network Graphics file into a portable anymap "

This looked like a likely thing instead of Image-Magick...
So I downloaded it and installed it, with more peculiar results, to wit:
I ran the same string from the Windows 7 DOS command line.
Took a long time. Sorry I didn't screen-shot the output. Said something about "renaming file to file.old" and then said, "file exists".
In the output directory there were then two files where there was one before.
One file appeared to be that which I had made with lily-compile an hour before - same date, time, properties, size 191 kilobytes, 300 dpi.
The second file had the same name with extension .png.old, and it is 4 megabtyes !! I took the .old extension off it, and indeed it appears to be a very high res .png file, but of course much too large to be of practical use. I can see part of it with VI, but it won't go small enough to see the whole thing! I tried to open it with Gimp, and Gimp appears to have hung - awaiting developments, it is still sitting there with its little hourglass. I'll give it a while.

Anyway, that's two strikes and one hit: the .svg and the anti-aliased .png have miss-fired, and the hi-res 300 dpi .png output from lilypond is working fine, and can be imported into Scribus routinely, and that's where it makes sense to me to leave it for now. Until I make a test print I have no further criticism of the 191k 300 dpi file, unless it turns out that it doesn't print well (and I could I suppose up the resolution more), but I have no printer these days, ha! So it can wait.

[attachment deleted by admin]