[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to use LaTeX code from manual to include LilyPond-generated TOC?
From: |
David Kastrup |
Subject: |
Re: How to use LaTeX code from manual to include LilyPond-generated TOC? |
Date: |
Thu, 10 Mar 2022 23:16:44 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Jean Abou Samra <jean@abou-samra.fr> writes:
> Hi,
>
> The (pdf|Xe|(dvi)?Lua)?(La)?TeX experts in the room are going to
> find this question ridiculous, but anyway: how do I use the code
> here?
>
> https://lilypond.org/doc/v2.23/Documentation/usage/sharing-the-table-of-contents.html
>
> After reading that, I fired LilyPond 2.20 (since the Scheme code
> is broken in 2.22 and I am writing code that will break it further)
> to generate toc.toc:
>
> 1, section, 1, {A}, toc96,
> 1, section, 1, {B}, toc97
>
>
> Then I tried to compile:
>
>
> \documentclass{article}
>
> \usepackage{pdfpages}
>
> \begin{document}
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> % \includescore{PossibleExtension}
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> % Read in the TOC entries for a PDF file from the corresponding .toc file.
> % This requires some heave latex tweaking, since reading in things
> from a file
> % and inserting it into the arguments of a macro is not (easily) possible
>
> % Solution by Patrick Fimml on #latex on April 18, 2009:
> % \readfile{filename}{\variable}
> % reads in the contents of the file into \variable (undefined if file
> % doesn't exist)
> \newread\readfile@f
That kind of stuff needs to be included from a .sty file via \usepackage
since otherwise @ cannot become a part of control sequence.
Or you have to enclose the respective code (which you call "Solution
by...") in \makeatletter ... \makeatother in order to make @ ("at") a
letter for the purpose of reading the definitions in the middle.
--
David Kastrup