Replies: 3 comments 2 replies
-
Would allowing Tectonic to pass options to the document class be a good solution? I think this increased flexibility would be good for other reasons, but it could be good to have a simple way to also produce an output with "draft" enabled, for example. |
Beta Was this translation helpful? Give feedback.
-
Hi @rm-dr, First off, sorry for taking so long to reply! I think this idea has a lot of promise. It's clear that the current preamble/postamble approach is, at best, polarizing, and this feels like a nice generalization. I also think that you're on to something with the idea that "inputs" could be things besides files; either lines of raw text or potentially other pseudo-files. Something that I've thought of, that might be another piece of the puzzle, is a sort of "dynamic" use of the preamble/postamble: the engine could test if the preamble/postamble files exist, and only include them in the build sequence if they exist. Then, in the current framework, if you don't like the the preamble/postamble you can just delete them. I'd be OK with making it the default to have There's no reason this idea and yours couldn't go together, I think. So, the default OK, the more I think about your idea, the more I like it! It's too bad if Rust's TOML implementation has trouble with mixed-type lists, although I can understand how the type system might cause that. It might be worth thinking about ways to implement that kind of functionality that are compatible with the crate; maybe something like this? inputs = ["pseudofile", "src/index.tex"]
[inputinfo.pseudofile]
text = "\\nosolutions" |
Beta Was this translation helpful? Give feedback.
-
I just tested this again, and it seems that these do, in fact, work. Oops. Tables as inputs could now be a viable option! |
Beta Was this translation helpful? Give feedback.
-
The current
tectonic -X new
preamble/main/postamble document organization is promising, but it's a bit limited.My use case:
I often write handouts, which come in two versions: just problems, and problems with solutions. This is implemented with some flags in a custom document class. In short,
\documentclass[solutions]{handout}
shows solutions, and\documentclass[nosolutions]{handout}
hides them.Using
Tectonic.toml
with two output configs allows me to compile both versions with one command. That's pretty cool. However, my approach is a bit hacky: in order to avoid having two copies of the same preamble which differ at only one line, my preamble tex files only include\documentclass
, with the rest of the TeX preamble inindex.tex
.If I wanted to do anything more complicated, I'd have an awful mess on my hands.
A possible solution:
Instead of limiting users to three input files (preamble, index, postamble), we could instead implement an array of input files that would all be concatenated when compiling the final document. Something like the following:
This also improves compatibility with traditional single-file LaTeX. Instead of hackishly setting
preamble=""
andpostamble=""
, one could just setinputs = "bigfile.tex"
and be confident that nothing will break.This could even be extended to support single-line inputs, to remove the need for many tiny files:
Note: I have a working demo, but I won't PR until we decide if (and how) we want to implement this.
Beta Was this translation helpful? Give feedback.
All reactions