I am using Scribble to write assignments and would like to have the ability to include common text snippets somewhere in the document. For example:
#lang scribble/manual
@section{Some section}
@include-file["common-pretext.scrbl"] @; my imaginary command
Some additional text after the pretext
@section{Next section}
More text...
I would like @include-file
to include the contents of common-pretext.scrbl
just as if I had copy/pasted its contents at the specified position. That is, I would like its contents to be part of Some section
and also properly handle Scribble commands occurring in common-pretext.scrbl
.
I know that Scribble has @include-section
, which is similar to what I want. However, @include-section
always starts a new section and text following it until the next section is silently dropped (I am not sure why this happens, but presumably because of how the document is constructed). I also tried Racket's @include
, but then the contents are not shown at all. Lastly, I tried building a macro that does what I want, but failed to make it work (if a macro is the way to go, then I am happy to share my attempts so far).
Is there such a command already and if not how can I build one?