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 Start Date in Education #10

Closed kyawzazaw closed 2 months ago

kyawzazaw commented 8 months ago

If I comment out the start date, it gives an error.

This feature is particularly useful if candidates would feel more comfortable not to display the amount of time it took them to graduate or simply thinks this is adding verbosity without additional value

jskherman commented 8 months ago

Thanks, I see that could be a problem. I do not have much time around this time of the year since it's the holidays, but I'll take it a look at it once I'm free. For now, as a quick fix, you can override the function for #cveducation in your example.typ file to remove the #start #sym.dash.en portion of line 138 of cv.typ the function to just be #end.

- #start #sym.dash.en #end
+ #end

So for example in your example.typ on lines 36 and 37, you can do:

// Each section function can be overridden by re-declaring it here
#let cveducation(info, isbreakable: true) = {
    if info.education != none {block[
        == Education
        #for edu in info.education {
            // Parse ISO date strings into datetime objects
            let start = utils.strpdate(edu.startDate)
            let end = utils.strpdate(edu.endDate)
            // Create a block layout for each education entry
            block(width: 100%, breakable: isbreakable)[
                // Line 1: Institution and Location
                #if edu.url != none [
                    *#link(edu.url)[#edu.institution]* #h(1fr) *#edu.location* \
                ] else [
                    *#edu.institution* #h(1fr) *#edu.location* \
                ]
                // Line 2: Degree and Date Range
                #text(style: "italic")[#edu.studyType in #edu.area] #h(1fr)
                #end
                #if edu.honors != none [- *Honors*: #edu.honors.join(", ")]
                #if edu.courses != none [- *Courses*:  #edu.courses.join(", ")]
                #if edu.highlights != none {for hi in edu.highlights [- #eval("[" + hi + "]")]}
            ]
        }
    ]}
}
jskherman commented 2 months ago

See related PR #15 and implementation in line 177 of cv.typ that uses utils.daterange() in utils.typ.