modern-cv
modern-cv copied to clipboard
trying to change `letter-position-pretext` errors out
I'm trying to use modern-cv and wanted to change "Bewerbung für
#letter-heading(
job-position: "Projektmanager*in",
letter-position-pretext: "Bewerbung als", // THIS throws an error, see below!
dear: "Liebes", // necessary because otherwise "Sehr geehrte" is hard-coded; note that *this* can be set and typst compiles without problems!
addressee: "Hiring Team von <company>",
)
I then get this error:
┌─ coverletter.typ:46:0
│
46 │ letter-position-pretext: "Bewerbung als",
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
I think this is wrong, because other keys can be overwritten, like "dear" in the example works as expected.
Is there more information other than the error you posted? This doesn't tell me why it failed, but it seems that it might be just because it's not expecting that as an input.
Also can you confirm what version of the template you're using?
Hi! The version I use is 0.8.0.
I've created a minimal (not) working example: https://paste.xinu.at/OzAfH/ comment out line 19 to see the error vs not. :-)
Hmm looks like this input parameter does not exist and that's why it's giving you an error. I can add it as a feature.
Thank you! Just to understand, letter-position-pretext does not yet exist as an input parameter, but curriculum-vitae and attached do; where is that defined? When I search this repo for these terms respectively, I find the same results, so it's surprising that only one of them can't be defined by the user yet.
These are defined in the lang.toml file which is how I provide translations of the same text. These aren't customizable directly from the template, you would have to edit the lang.toml. In fact you could do the same for letter-position-pretext.
@Ablesius Is editing the lang.toml viable instead of adding a parameter to the template?
Hi @DeveloperPaul123, I don't think I understand how I would do that, except by forking your template? I don't see the lang.toml file in my folder. When I run typst init @preview/modern-cv:0.8.0, I just get
/t/typst_test> tree
.
└── modern-cv
├── coverletter2.typ
├── coverletter.typ
├── profile.png
└── resume.typ
2 directories, 4 files
Hi again,
I think I figured it out, at least as a hack:
I found the files in my cache, and copied them to ~/.local/share/typst/packages/local/modern-cv/0.8.1 (I didn't want to use the same version number in case that would break anything bad, so I could more easily return to a working state)
Then I adapted the import line in my document to
#import "@local/modern-cv:0.8.1": *
Then I could change the lang.toml value of letter-position-pretext.
It's a bit complicated to do just to change a single line in the document, though.
The easier hack is to use a show box:
// temporary solution: see https://github.com/DeveloperPaul123/modern-cv/issues/98#issue-2848982324
#show "Bewerbung für": "Bewerbung als"
Then I don't need to do all the extra steps.
But it's quite possible that I just found a way that was very complicated, and there's an easier solution - please advise :-)
Cheers!
Ah I see, yes that's less than ideal. Didn't realize the lang.toml is only available in the cache.