sinaatalay / rendercv

The engine of the RenderCV App
http://rendercv.com
MIT License
1.92k stars 139 forks source link

How to render a document with custom theme? #127

Closed Hariss-Gills closed 3 months ago

Hariss-Gills commented 3 months ago

Hey I have created a custom theme but I can't seem to figure out how to render that document with a custom theme . I presume you'd need to clone the repo and adding an additional CLI option to "THEME_NAME ". Just wanted to know of there is a way to do this by perhaps passing in the path of the custom theme to the rendercv new command.

sinaatalay commented 3 months ago

Hi! You don't need to clone the repository to use a custom theme.

If your folder structure looks like the one below,

├── mycustomtheme
│   ├── __init__.py
│   ├── Preamble.j2.tex
│   ├── Header.j2.tex
│   ├── EducationEntry.j2.tex
│   ├── ExperienceEntry.j2.tex
│   ├── NormalEntry.j2.tex
│   ├── OneLineEntry.j2.tex
│   ├── PublicationEntry.j2.tex
│   ├── TextEntry.j2.tex
│   ├── SectionBeginning.j2.tex
│   └── SectionEnding.j2.tex
└── Your_Full_Name_CV.yaml

you can run the command

 rendercv render Your_Full_Name_CV.yaml

If the design.theme field is set to mycustomtheme in the YAML file, the custom theme will be used.

Also, I suggest using your local LaTeX distribution since RenderCV's TinyTeX is minimal and doesn't contain a lot of packages. See the command below:

rendercv render --use-local-latex-command pdflatex Your_Full_Name_CV.yaml

I would appreciate it if you could point out what can be updated in the documentation to clarify how to use custom themes. Also, pull requests are welcome if you would like to share your custom theme with everyone else!

Hariss-Gills commented 3 months ago

Awesome that worked. I cannot believe I misunderstood this line in the documentation.

I think this happened due to two reasons. I presumed rendercv new "Full Name" --theme "THEME_NAME" was the only way to change the theme.

And I thought the line However, custom themes can also be used. Simply shows a possibility that a user can simply use custom themes. Not that a user can change it in this specific field.

I would maybe expand it to

However, custom themes can also be used here by setting theme to the name of your custom theme.

Very pedantic, but yeah that would have personally helped me understand. Cool project!

prabhjotsbhatia-ca commented 3 months ago

Hi, The docs could definitely be improved. I also got the impression that I need to perhaps clone or fork the repo and add my custom theme there. One reason for that is that VSCode keeps showing the error Value must be "classic" | "sb2nov" | "engineeringresumes". based on schema.json.

There's an additional bug here. I tried creating a new theme based on sb2nov, called "mysb2nov". However, attempting to render it fails with this error: The custom theme name should contain only letters. Using mycustomtheme works. Perhaps that needs to be added to the doc as well.

sinaatalay commented 3 months ago

Hi, I have updated the user guide. Also, The custom theme name should contain only letters. error is removed. Now, digits are accepted as well.