Re: [lilypond-book] @format environments
Am 13.07.2020 um 10:26 schrieb Werner LEMBERG: So we could either 1. Drop the support for 'addversion' in lilypond-book completely I favor that. Ok, if nobody else objects I will prepare a MR. Cheers, Michael Werner
Re: [lilypond-book] @format environments
> So we could either > > 1. Drop the support for 'addversion' in lilypond-book completely I favor that. Werner
Re: [lilypond-book] @format environments
Am 09.07.2020 um 18:09 schrieb Trevor: Michael Käppler, you wrote 09/07/2020 12:45:28 What strikes me the most is that 'addversion' is used only three times throughout the whole documentation, and these three occurrences are all in the LM, fundamental.itely What is the reason that the version string is mentioned for these particular snippets and nowhere else? I'm guessing, but I think these are the only examples that purport to be "complete" LP programs. Everything else are just snippets of code. The other possibility is that these were written by Graham, I think, whereas I wrote most of the others. According to the git history, you wrote it in 2007, but these days the 'addversion' option did not exist. See 396a1debe40aa5715cdc0cbe6cb90bc677004261 This option was added by John Mandereau in February 2008 with f6caefb696b778cd8f49acc127583253f020248c In April 2008, John adjusted your snippet to use the 'addversion' option. However, the history also states that 'addversion' was removed from two snippets in January 2016 with 8892bd951e1705e116b36cf2243c061f74e73af9 by Greg Swinford. I don't think it would be a problem if the version strings were dropped, though. I would like to support this opinion. The 'addversion' option, as it is now, is useless for end users, because it relies on the @version macro to be defined. So we could either 1. Drop the support for 'addversion' in lilypond-book completely 2. Let lilypond-book prepend the version string to verbatim snippets depending on the version it uses for compiling the snippet, not on the @version macro. (if this is possible without a major rewrite) IMHO, the graphical output and version string should match. I do not know, if somebody actually compiles the documentation with a precompiled lilypond/lilypond-book. But with the current setup it could happen that a snippet is compiled with a lilypond version different from the \version string and the conclusion: "Alright, this snippets looks that particular way if compiled with lilypond 2.x.x." would be misleading. Please correct me if I have some wrong thinking here. Michael
Re[2]: [lilypond-book] @format environments
Michael Käppler, you wrote 09/07/2020 12:45:28 What strikes me the most is that 'addversion' is used only three times throughout the whole documentation, and these three occurrences are all in the LM, fundamental.itely What is the reason that the version string is mentioned for these particular snippets and nowhere else? I'm guessing, but I think these are the only examples that purport to be "complete" LP programs. Everything else are just snippets of code. The other possibility is that these were written by Graham, I think, whereas I wrote most of the others. I don't think it would be a problem if the version strings were dropped, though. Trevor
Re: [lilypond-book] @format environments
So I would vote to make @noindent [Version string if needed] @verbatim ... @end verbatim This is OK with me. Thanks for working on this! Hmm, not so simple as I thought at first. The version string should be printed in typewriter, like the code that immediately follows in the @verbatim environment. If we use @code{\version @w{"@version{}"}} it will be put in quotes for Info output, which is not what we want. With @verbatim \version @w ... @end verbatim the @version macro won't be expanded. The following @format @t{\version @w...} @end format does work well for PDF and for Info output, but not for HTML with texi2html-1.82, because @format environments are indented there, the following @verbatim block is not. Texi2any from texinfo-6.5 behaves differently again, not indenting the @format blocks. *Ugh* The only solution that works for PDF, Info and HTML actually seems to be: @noindent @t{\version @w} @verbatim foo @end verbatim This is hacky, too, because IIUC '@noindent' is designed to be used *after* environments like @quotation, @example, etc. to prevent the following paragraph from being indented. What strikes me the most is that 'addversion' is used only three times throughout the whole documentation, and these three occurrences are all in the LM, fundamental.itely What is the reason that the version string is mentioned for these particular snippets and nowhere else? Cheers, Michael Werner
Re: [lilypond-book] @format environments
Am 06.07.2020 um 07:24 schrieb Werner LEMBERG: please see the attached files for a test case, [...] Thanks, looks good. Thanks for your feedback! What I did not test, however, was texi2html-1.82. Well, it will take some time until we can move on to a newer version, so this has to be tested, too. Ok, will test this, too. If no differences show up, I will file in a MR. Cheers, Michael
Re: [lilypond-book] @format environments
> please see the attached files for a test case, [...] Thanks, looks good. > What I did not test, however, was texi2html-1.82. Well, it will take some time until we can move on to a newer version, so this has to be tested, too. > So I would vote to make > > @noindent > [Version string if needed] > @verbatim > ... > @end verbatim This is OK with me. Thanks for working on this! Werner
Re: [lilypond-book] @format environments
Am 30.06.2020 um 09:23 schrieb Werner LEMBERG: @format @exampleindent 0 @verbatim \relative { a4 b c d } @end verbatim @end format [...] What I do not understand here: The @verbatim environment is not indented by default, as far as I can see. What is the reason to set '@exampleindent 0', here? (And the enclosing @format environment to scope the effect of @exampleindent 0) I think this was implemented to work around bugs in older texinfo distributions. In particular, the `makeinfo` binary and the `texinfo.tex` file often did different things; IIRC, the code above ensured identical behaviour for HTML, info, and PDF output. This has improved a lot meanwhile and could be simplified. Hi Werner, please see the attached files for a test case, the renderings were done with: PDF: (texinfo.tex from current texinfo master) texi2pdf verbatim.texi INFO: makeinfo verbatim.texi HTML: texi2any --set-customization-variable TEXI2HTML=1 verbatim.texi All utils from texinfo 6.5. AFAICS, they behave similarly w.r.t. @verbatim without @format @exampleindent 0 ... @end format What I did not test, however, was texi2html-1.82. So I would vote to make @noindent [Version string if needed] @verbatim ... @end verbatim the default setting for verbatim snippets in texinfo. I already made some tests with a patched version of lilypond-book and could not spot differences, at least in the PDF manuals. What do you think? Cheers, Michael Verbatim This is a normal paragraph. Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et doloire magna aliqua. This is an @example environment. This is a normal paragraph. Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et doloire magna aliqua. Version string These are nested @format and @verbatim environments, as produced by lilypond-book with \lilypond[verbatim] This is a normal paragraph. Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et doloire magna aliqua. This is another @example environment. This is a normal paragraph. Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et doloire magna aliqua. Version string (indentation removed with @noindent) This is only a @verbatim environment. Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. This is a normal paragraph. Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et doloire magna aliqua. This is another @example environment. __ This document was generated on July 1, 2020 using [1]texi2any. References 1. http://www.gnu.org/software/texinfo/ verbatim.info Description: Binary data verbatim.pdf Description: Adobe PDF document \input texinfo @ifnottex @node Top @top Verbatim @end ifnottex This is a normal paragraph. Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et doloire magna aliqua. @example This is an @code{@@example} environment. @end example This is a normal paragraph. Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et doloire magna aliqua. @format @exampleindent 0 Version string @verbatim These are nested @format and @verbatim environments, as produced by lilypond-book with \lilypond[verbatim] @end verbatim @end format This is a normal paragraph. Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et doloire magna aliqua. @example This is another @code{@@example} environment. @end example This is a normal paragraph. Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et doloire magna aliqua. @noindent Version string (indentation removed with @code{@@noindent}) @verbatim This is only a @verbatim environment. Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. @end verbatim This is a normal paragraph. Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et doloire magna aliqua. @example This is another @code{@@example} environment. @end example @bye
Re: [lilypond-book] @format environments
> @format > @exampleindent 0 > @verbatim > \relative { > a4 b c d > } > @end verbatim > @end format > > [...] > > What I do not understand here: The @verbatim environment is not > indented by default, as far as I can see. What is the reason to set > '@exampleindent 0', here? > > (And the enclosing @format environment to scope the effect of > @exampleindent 0) I think this was implemented to work around bugs in older texinfo distributions. In particular, the `makeinfo` binary and the `texinfo.tex` file often did different things; IIRC, the code above ensured identical behaviour for HTML, info, and PDF output. This has improved a lot meanwhile and could be simplified. Werner
[lilypond-book] @format environments
Hi everyone, (Werner in particular ;)) I'm trying to understand the usage of quoting and formatting environments that occurs when lilypond-book transforms a .tely file to .texi. The following snippet, e.g., = @lilypond[verbatim] \relative { a4 b c d } @end lilypond = is being transformed into = @format @exampleindent 0 @verbatim \relative { a4 b c d } @end verbatim @end format [...] (Info and HTML stuff) @iftex @include 7a/lily-21179cd9-systems.texi @end iftex = What I do not understand here: The @verbatim environment is not indented by default, as far as I can see. What is the reason to set '@exampleindent 0', here? (And the enclosing @format environment to scope the effect of @exampleindent 0) Cheers, Michael