justified paragraphs in bookTitleMarkup
Hi, I still don't seem to understand this markup stuff sufficiently :-( Please consider the attached file. It has a custom header field defined as \markup \justify and uses this field in \bookTitleMarkup. This concats the complete markup to one justified paragraph. However I would like to achieve a solution where this field can be interpreted markdown-like as three paragraphs. I tried several things but nothing gave me what I need. \justify-field gives a nice result but that makes it impossible to use a \markup (including the formatting) as the field value. What basically works is defining it as field = \markup \column { \justify { first paragraph } \justify { second paragraph } \justify { third paragraph } } but this additionally requires me to add manual space between the paragraphs. I want to provide a clean interface to entering this multiparagraph field values in the header that can output justified output by paragraph. Any ideas? Would it be possible to define a markup-command that takes a string as argument, parses it markdown-like (including some basic formatting) and returns a \markup suitable for use in \bookTitleMarkup (or elsewhere in a score)? I think this would be a great enhancement in general. Best Urs \version 2.19.11 \header { desc = \markup \justify { When working on a score it is often necessary to mark the state of development on a given intermediate state (printout or shared PDF). Instead of simply adding a date it can be very useful to add information about the Git revision if the document is in a version control repository. This module provides markup commands that retrieve information about the current Git repository. It is not only possible to get information about the current commit but also whether the repository is in a clean state (i.e. whether the score represents the state of a commit or contains modifications in the working tree). A generic command can be used to issue arbitrary Git commands. For a list of defined commands see the usage example. } } \paper { bookTitleMarkup = \markup { \fromproperty #'header:desc } } { c' }___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: justified paragraphs in bookTitleMarkup
2014-07-18 12:57 GMT+02:00 Urs Liska u...@openlilylib.org: Hi, I still don't seem to understand this markup stuff sufficiently :-( Please consider the attached file. It has a custom header field defined as \markup \justify and uses this field in \bookTitleMarkup. This concats the complete markup to one justified paragraph. However I would like to achieve a solution where this field can be interpreted markdown-like as three paragraphs. I tried several things but nothing gave me what I need. \justify-field gives a nice result but that makes it impossible to use a \markup (including the formatting) as the field value. What basically works is defining it as field = \markup \column { \justify { first paragraph } \justify { second paragraph } \justify { third paragraph } } but this additionally requires me to add manual space between the paragraphs. I want to provide a clean interface to entering this multiparagraph field values in the header that can output justified output by paragraph. Any ideas? Would it be possible to define a markup-command that takes a string as argument, parses it markdown-like (including some basic formatting) and returns a \markup suitable for use in \bookTitleMarkup (or elsewhere in a score)? I think this would be a great enhancement in general. Best Urs Does justify-string what you want? \header { desc = \markup \justify-string #When working on a score it is often necessary to mark the state of development on a given intermediate state (printout or shared PDF). Instead of simply adding a date it can be very useful to add information about the Git revision if the document is in a version control repository. This module provides markup commands that retrieve information about the current Git repository. It is not only possible to get information about the current commit but also whether the repository is in a clean state (i.e. whether the score represents the state of a commit or contains modifications in the working tree). A generic command can be used to issue arbitrary Git commands. For a list of defined commands see the usage example. } \paper { bookTitleMarkup = \markup { \fromproperty #'header:desc } } { c' } Cheers, Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: justified paragraphs in bookTitleMarkup
Am 18.07.2014 13:45, schrieb Thomas Morley: 2014-07-18 12:57 GMT+02:00 Urs Liska u...@openlilylib.org: Hi, I still don't seem to understand this markup stuff sufficiently :-( ... Best Urs Does justify-string what you want? Unfortunately not. It's the same as with justify-field. The result is basically right, but I can only supply a string to it and not a markup (i.e. no further formatting). Best Urs \header { desc = \markup \justify-string #When working on a score it is often necessary to mark the state of development on a given intermediate state (printout or shared PDF). Instead of simply adding a date it can be very useful to add information about the Git revision if the document is in a version control repository. This module provides markup commands that retrieve information about the current Git repository. It is not only possible to get information about the current commit but also whether the repository is in a clean state (i.e. whether the score represents the state of a commit or contains modifications in the working tree). A generic command can be used to issue arbitrary Git commands. For a list of defined commands see the usage example. } \paper { bookTitleMarkup = \markup { \fromproperty #'header:desc } } { c' } Cheers, Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user -- ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: justified paragraphs in bookTitleMarkup
Urs Liska u...@openlilylib.org writes: This concats the complete markup to one justified paragraph. However I would like to achieve a solution where this field can be interpreted markdown-like as three paragraphs. What do you mean with markdown-like? -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: justified paragraphs in bookTitleMarkup
Am 18.07.2014 14:20, schrieb David Kastrup: Urs Liska u...@openlilylib.org writes: This concats the complete markup to one justified paragraph. However I would like to achieve a solution where this field can be interpreted markdown-like as three paragraphs. What do you mean with markdown-like? Well, this was of course not an exact specification. But in the current case I wanted to have the empty line to be interpreted as an indicator for a new paragraph (just like in LaTeX or Markdown. I would not insist on this exact behaviour, but I'm looking for a way to enter a header field as markup and let it be printed as a series of justified paragraphs. And the author should not be forced to use a significant amount of markup for this (I also want to input file to be still readable. So in the end it would be a nice thing to have a function that parses a Markdown-formatted string and returns usable \markup from it. Urs ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: justified paragraphs in bookTitleMarkup
Urs Liska u...@openlilylib.org writes: Am 18.07.2014 14:20, schrieb David Kastrup: Urs Liska u...@openlilylib.org writes: This concats the complete markup to one justified paragraph. However I would like to achieve a solution where this field can be interpreted markdown-like as three paragraphs. What do you mean with markdown-like? Well, this was of course not an exact specification. But in the current case I wanted to have the empty line to be interpreted as an indicator for a new paragraph (just like in LaTeX or Markdown. I would not insist on this exact behaviour, but I'm looking for a way to enter a header field as markup and let it be printed as a series of justified paragraphs. And the author should not be forced to use a significant amount of markup for this (I also want to input file to be still readable. So in the end it would be a nice thing to have a function that parses a Markdown-formatted string and returns usable \markup from it. It would appear that markdown is your favorite text formatting language. It is not likely that we will add a full text formatting language to LilyPond so I will not even try to hunt up definitions and figuring out what you actually want. It is not clear whether you want some input as LilyPond markup, or whether you want your input to be simple-string-only with some sort of conversion mechanism into markup. So can you please try providing a description of what functionality you actually want with what kind of interface so that it is possible to figure out the missing pieces? -- David Kastrup ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: justified paragraphs in bookTitleMarkup
Am 18.07.2014 14:56, schrieb David Kastrup: So can you please try providing a description of what functionality you actually want with what kind of interface so that it is possible to figure out the missing pieces? I'll try to do that, but now I have to shut down the PC. ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: justified paragraphs in bookTitleMarkup
2014-07-18 13:58 GMT+02:00 Urs Liska u...@openlilylib.org: Am 18.07.2014 13:45, schrieb Thomas Morley: 2014-07-18 12:57 GMT+02:00 Urs Liska u...@openlilylib.org: Hi, I still don't seem to understand this markup stuff sufficiently :-( ... Best Urs Does justify-string what you want? Unfortunately not. It's the same as with justify-field. The result is basically right, but I can only supply a string to it and not a markup (i.e. no further formatting). Best I can think of right now is the coding below. You'll need to insert \n (or another separator-sign) manually at the appropiate places. I didn't manage to make the empty lines being automagically recognized instead. #(define-markup-command (my-justify layout props args) (markup-list?) #:category align #:properties ((baseline-skip) (par-indent 2) wordwrap-internal-markup-list) (let* ((splitted-args (split-list-by-separator args (lambda (x) (equal? x \n (indented-splitted-args (map (lambda (arg) (cons (markup #:hspace par-indent) arg)) splitted-args)) (proc (lambda (x) (stack-lines DOWN 0.0 baseline-skip (wordwrap-internal-markup-list layout props #t x (lst (map proc indented-splitted-args))) (stack-lines DOWN 0.0 (* 3 baseline-skip) lst))) \header { desc = \markup \my-justify { \italic When working on a score it is often necessary to mark the state of development on a given intermediate state (printout or shared PDF). Instead of simply adding a date it can be very useful to add information about the Git revision if the document is in a version control repository. \n This module provides markup commands that retrieve information about the current \bold { Git repository}. It is not only possible to get information about the current commit but also whether the repository is in a clean state (i.e. whether the score represents the state of a commit or contains modifications in the working tree). \n A generic command can be used to issue arbitrary Git commands. For a list of defined commands see the usage example. } } \paper { bookTitleMarkup = \markup { \fromproperty #'header:desc } } { c' } Cheers, Harm ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user
Re: justified paragraphs in bookTitleMarkup
Message: 3 Date: Fri, 18 Jul 2014 16:06:40 +0200 From: Thomas Morley thomasmorle...@gmail.com To: Urs Liska u...@openlilylib.org Cc: lilypond-user lilypond-user@gnu.org Subject: Re: justified paragraphs in bookTitleMarkup Message-ID: CABsfGyWdRsxnY-g3U7EHCepSu+TwohTbeYX=x7mpvgm+wvq...@mail.gmail.com Content-Type: text/plain; charset=UTF-8 2014-07-18 13:58 GMT+02:00 Urs Liska u...@openlilylib.org: Am 18.07.2014 13:45, schrieb Thomas Morley: 2014-07-18 12:57 GMT+02:00 Urs Liska u...@openlilylib.org: Hi, I still don't seem to understand this markup stuff sufficiently :-( ... Best Urs Does justify-string what you want? Unfortunately not. It's the same as with justify-field. The result is basically right, but I can only supply a string to it and not a markup (i.e. no further formatting). Best I can think of right now is the coding below. You'll need to insert \n (or another separator-sign) manually at the appropiate places. I didn't manage to make the empty lines being automagically recognized instead. If you mean as a blank line between paragraphs, I like the looks of the following: \version 2.18.2 \header { desc = \markup \column { \justify-string #When working on a score it is often necessary to mark the state of development on a given intermediate state (printout or shared PDF). Instead of simply adding a date it can be very useful to add information about the Git revision if the document is in a version control repository. \justify-string #This module provides markup commands that retrieve information about the current Git repository. It is not only possible to get information about the current commit but also whether the repository is in a clean state (i.e. whether the score represents the state of a commit or contains modifications in the working tree). \justify-string #A generic command can be used to issue arbitrary Git commands. For a list of defined commands see the usage example. } } \paper { bookTitleMarkup = \markup { \fromproperty #'header:desc } } { c' } ___ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user