jskherman / imprecv

A no-frills curriculum vitae (CV) template using Typst and YAML to version control CV data.
Apache License 2.0
319 stars 38 forks source link

Allow to not include Country in Location #9

Closed kyawzazaw closed 2 months ago

kyawzazaw commented 8 months ago

If I comment out the Country in the value part, it still adds a comma after the Region

jskherman commented 8 months ago

Hi, just like in #10 you can also override the #addresstext and #cvheading functions for this in cv.typ in your example.typ file. For example:

// Each section function can be overridden by re-declaring it here
#let addresstext(info, uservars) = {
    if uservars.showAddress {
        block(width: 100%)[
            #info.personal.location.city, #info.personal.location.region // <===== Edit the address text
            #v(-4pt)
        ]
    } else {none}
}

// Create layout of the title + contact info
// Just copied this verbatim with no change for new addresstext() function to work
#let cvheading(info, uservars) = {
    align(center)[
        = #info.personal.name
        #addresstext(info, uservars)
        #contacttext(info, uservars)
        // #v(0.5em)
    ]
}

You need to redeclare both of these functions in the example.typ for it to be overwritten properly.

mangkoran commented 7 months ago

@jskherman I think we could make several fields optional/won't be shown if user don't provide the YAML key/value. What do you think?

jskherman commented 7 months ago

That would be for the best, but I don't think I'll be able to work on this anytime soon. If someone could do a PR along the lines of phamson02's suggestion...

mangkoran commented 7 months ago

I will try to work on it!

jskherman commented 2 months ago

Hi sorry for taking so long, the country and other address fields can now be omitted for this with the v1.0.1 release, pending merge in the Typst packages repo.