From: Bruce Horrocks <ntg@scorecrow.com>
To: ntg-context mailing list <ntg-context@ntg.nl>
Subject: [NTG-context] Re: How to tell a single *.tex file to produce separate PDFs?
Date: Fri, 20 Sep 2024 18:04:34 +0100 [thread overview]
Message-ID: <998B4393-F1F7-4D7D-9C30-573773E677FD@scorecrow.com> (raw)
In-Reply-To: <348911354.5371554.1726801061779@mail.yahoo.com>
> On 20 Sep 2024, at 03:57, Joel via ntg-context <ntg-context@ntg.nl> wrote:
>
> I have a document that's quite long. It uses a recurse function, a bit like this:
>
> \starttext
>
> \dostepwiserecurse{1}{180}{1}{%
>
> \input chapter\recurselevel
>
> }
>
> \stoptext
>
> That produces 180 chapters of content.
>
> Anyway, my boss is upset she has to use a table of contents to navigate to the page she wants, and so wants me to split the file into 180 separate files, which somehow is going to be easier to look at. Honestly, she probably still won't ever actually look at it, but that's her requirement.
Since you’ve already got the chapter content split into separate \input files ...
At the Unix level, use the following script to run Context 180 times specifying a different output file each time:
#! /bin/bash
for i in {1..180}
do
context \
--arguments="ChapNo=$i" test.tex \
--result="chapter_$i.pdf”
done
And at the Context level, test.tex is simply:
\starttext
\input chapter\env{ChapNo}
\stoptext
Regards,
—
Bruce Horrocks
Hampshire, UK
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2024-09-20 17:06 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <348911354.5371554.1726801061779.ref@mail.yahoo.com>
2024-09-20 2:57 ` [NTG-context] " Joel via ntg-context
2024-09-20 8:23 ` [NTG-context] " vm via ntg-context
2024-09-20 8:33 ` Denis Maier via ntg-context
2024-09-20 9:58 ` vm via ntg-context
2024-09-21 0:38 ` Alan Braslau via ntg-context
2024-09-20 10:26 ` Wolfgang Schuster
2024-09-20 13:05 ` Denis Maier via ntg-context
2024-09-20 16:04 ` Wolfgang Schuster
2024-09-20 13:46 ` Pablo Rodriguez via ntg-context
2024-09-20 16:41 ` Jim
2024-09-20 17:04 ` Bruce Horrocks [this message]
2024-09-21 0:06 ` Joel via ntg-context
2024-09-23 9:32 ` Otared Kavian
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=998B4393-F1F7-4D7D-9C30-573773E677FD@scorecrow.com \
--to=ntg@scorecrow.com \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).