Git Product home page Git Product logo

Comments (6)

mintyfrankie avatar mintyfrankie commented on August 15, 2024 1

Hi, a new commit is patched on both the example repo and the template repo, feel free to have a try.

Basically, it was resolved by wrapping an element of personalInfo with box() function in the template; it forces it to stay in the same line.

A tiny (but dirty) trick is also added: add a key of linebreak with whatever value in personalInfo will create a forced linebreak.

I am closing this issue now but feel free to raise another one should you encounter other issues.

from brilliant-cv.

danieltomasz avatar danieltomasz commented on August 15, 2024

You might replace my custom "adress" with "extraInfo" to the same effect

from brilliant-cv.

danieltomasz avatar danieltomasz commented on August 15, 2024

I solved my problem with a combination of adding additional empty condition containing linebreak() and hardcoding specific numbers of lines where to hide hBar() in the template.typ, but I wonder if more general solution is possible

from brilliant-cv.

danieltomasz avatar danieltomasz commented on August 15, 2024

One simple general enhacement that might almost solve my problem would be use of non-breaking space ~ between fontawesome icon and the text after

from brilliant-cv.

mintyfrankie avatar mintyfrankie commented on August 15, 2024

Hi @danieltomasz thanks for opening up this issue. Can you provide the code snippet and/or the screenshot for the ~ you've mentioned? The effect is indeed not ideal, I will see what I can do.

from brilliant-cv.

danieltomasz avatar danieltomasz commented on August 15, 2024

I by support of ~ I meant this typst/typst#1538
My current workaround doesn't use ~, it is uglier but kinda works,
In the template.typ I just introduced dummy item breakline for manually adding linebreak(justify: false) as part of text, and I reset the n counter to remove the hbar from the next item that starts new line, in the metadata.typ I am using it by adding breakline: "dummy" in a specific place in defining personalInfo

#let makeHeaderInfo() = {
  let personalInfoIcons = (
    phone: fa-phone(),
    adress: fa-home(),
    email: fa-envelope(),
    linkedin: fa-linkedin(),
    homepage: fa-pager(),
    github: fa-square-github(),
    gitlab: fa-gitlab(),
    orcid: fa-orcid(),
    researchgate: fa-researchgate(),
    extraInfo: "",
    breakline: "",
  )
  let n = 1
  for (k, v) in personalInfo {
      if v != "" {
        // Adds hBar
        if n != 1  {
            if k != "breakline" {
          hBar()
            }
        }
      // Adds icons
      personalInfoIcons.at(k) + h(5pt)
      // Adds hyperlinks
      if k == "email" {
        link("mailto:" + v)[#v]
      } else if k == "linkedin" {
        link("https://www.linkedin.com/in/" + v)[#v]
      } else if k == "github" {
        link("https://github.com/" + v)[#v]
      } else if k == "gitlab" {
        link("https://gitlab.com/" + v)[#v]
      } else if k == "homepage" {
        link("https://" + v)[#v]
      } else if k == "orcid" {
        link("https://orcid.org/" + v)[#v]
      } else if k == "researchgate" {
        link("https://www.researchgate.net/profile/" + v)[#v]
      } else if k == "breakline" {
        linebreak(justify: false)
        n = 0
      } else {
        v
      }
    }
    n = n + 1
  }
}

When I wanted to replace personalInfoIcons.at(k) + h(5pt) by personalInfoIcons.at(k) + space.nobreak (~ is a shorthand for that) I got error, so stopped with proceding this way

from brilliant-cv.

Related Issues (15)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.