pandoc
pandoc copied to clipboard
Adding new features to the Typst template
This implements the changes suggested in #9956, with the exception of the filecolor/urlcolor one. These would require adding some regex to guess the link types. This is theoretically possible to do, but it wasn't clear to me that this is a good thing to put in a default template. Happy to adjust if you have thoughts on this.
Some things to note:
- I'm converting colors by passing them as content, as I was seeing pandoc escape
#if that was included. An alternative here is to just do something like:rgb(linkcolor.replace("\\#", "#")). - I set the default fonts for math and code ("raw") to fonts that are bundled with Typst. These need not be those fonts if there are more familiar pandoc preferences.
Hi @jgm, I don't want to bother you if this is already on your radar, but should I add you as a reviewer (for when you have time)? I'm not 100% sure of the norms for contributions here.
Sorry for the delay on this!
Sorry for the long delay on this. I've been on the academic job market and a bit crazed. I'm using Quarto + pandoc + Typst for my dissertation and will resolve these over the next few days while in the midst of this.
d05ca30 handles the merging with the pagenumber change
Hi @jgm. I've rerequested your review for when you have a chance. These are all now set to be less opinionated and better fit with the default typst settings, especially removing colors and fonts unless specified.
Apologies, spoke too soon on the last message. Just went through and triple checked things and now it is ready for re-review.
looks pretty good -- I made one comment about "Abstract."
The other thing that needs to be done is modifying MANUAL.txt so that the new variables are documented. There should be a section "Variables for Typst."
TODO (for me): set abstract-title variable to a localized default in the typst writer.
abstractTitle <- translateTerm Abstract
and then when setting template variables,
defField "abstract-title" abstractTitle .
The MANUAL.txt and abstract-title defaults are now updated. Thanks for the review!
Looks like the branch has to be rebased on to main in order to be merged cleanly.
So, I just rebased onto main, but I have a strong suspicion that this is not what you wanted. Before doing this, I made a backup branch which is just a copy prior to me rebasing. I can open a clean PR from that if this is not what you wanted.
@christopherkenny -- I had a look at what may have gone wrong with your rebase. My theory is as follows (please correct me if any of this is wrong!):
- During your work on this branch, you used the 'Update branch' button a few times to merge
jgm:mainintochristopherkenny:typst-template. - Your pandoc fork hasn't been synced since June 2024 and so the latest commit on
christopherkenny:mainis correspondingly old. - When you rebased onto
main, you therefore rebased onto a commit from June 2024 rather than the latestmain. In addition, you ranrebasewithout the--rebase-mergesoption, so your merge commits (created previously via the 'Update branch' button) were replaced with all of the respective commits fromjgm:main, which is how you ended up with 662 commits on your branch. If the--rebase-mergesoption had been used, I think the rebase would have had no effect (since the rebase would've been done on the same commit onjgm:mainthat your branch was branching out from anyway).
To fix this, you could restore your previous version of this branch (via your backup branch), sync your fork (and do a git pull to make sure your local main is up to date as well), and perform an interactive rebase on main, during which you would drop all merge commits.
Yeah, that sounds exactly like what happened. Thanks for the help @rnwst. I will get this cleaned up tomorrow.
Thanks @rnwst, that was exactly it. All cleaned up now. Thanks for the help!
Looks like you have opted to undo and then redo (after merging jgm:main) the commit that would be causing a merge conflict, instead of rebasing the whole branch on top of latest jgm:main, which would result in a cleaner commit history. Some of the commit messages could also be tidied up, and perhaps some or all of the commits squashed. But I don't know if @jgm is as pedantic as I am, so let's wait to see what he says.
I was thinking this could all be rebased into one commit (unless there's some strong reason for having more than one commit for this change).
Sorry for the delay and thank you for your patience. It is now rebased into 1 commit and all check pass @jgm.
I rebased this from the command line and committed it. Thank you!
Thanks @jgm and @rnwst for the help and patience.