sinaatalay / rendercv

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

Support Chinese characters by default. #61

Open imjiaoyuan opened 6 months ago

imjiaoyuan commented 6 months ago

Describe the bug As long as there is Chinese in the yaml file, it cannot run successfully

To Reproduce

    experience:
      - company: 猫四叔
        position: blogger
        location: China
        start_date: 2004-06
        end_date: 2004-08
        highlights:

Screenshots

MINGW64 /d/Home/test $ rendercv render resume_CV.yaml 

Welcome to RenderCV! Some useful links:
┏━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Title            ┃                                                Link ┃
┡━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ Documentation    │              https://sinaatalay.github.io/rendercv/ │
│ Source code      │             https://github.com/sinaatalay/rendercv/ │
│ Bug reports      │      https://github.com/sinaatalay/rendercv/issues/ │
│ Feature requests │      https://github.com/sinaatalay/rendercv/issues/ │
│ Discussions      │ https://github.com/sinaatalay/rendercv/discussions/ │
└──────────────────┴─────────────────────────────────────────────────────┘
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮│ 2.2 s Reading and validating the input file has finished.                                                                                                                                                                                 ││ 0.0 s Generating the LaTeX file has finished.                                                                                                                                                                                             ││ 0.0 s Generating the Markdown file has finished.                                                                                                                                                                                          ││ 0.4 s Rendering the LaTeX file to a PDF has started.                                                                                                                                                                                      │╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯2.7 s ━━━━━━━━━━━━━━━━━━━━━━━━╺━━━━━━━━━━━━━━━ (3 out of 5 steps finished)

An error occurred:

Running TinyTeX has failed! For debugging, we suggest running the LaTeX file manually in https://overleaf.com.

If you want to run it locally, run the command below in the terminal:

C:\Scoop\apps\mambaforge\current\lib\site-packages\rendercv\tinytex-release\TinyTeX\bin\windows\pdflatex.exe D:\Home\test\rendercv_output\JiaoYuan_CV.tex

If you can't solve the problem, please open an issue on GitHub.
sinaatalay commented 6 months ago

Hello, thank you for reporting this issue. Unfortunately, RenderCV's built-in TinyTeX distribution cannot compile Chinese.

However, a clean workaround will be available in version 1.9. I will update this issue and provide instructions when the new version is released.

imjiaoyuan commented 6 months ago

Thank you for your help!RenderCN will provide me a beautiful resume!

n1cogrv commented 6 months ago

@sinaatalay It will be a huge deal if rendercv can support CJK character natively. Since I am not quite familiar with TeX, otherwise I would really want to help PR this.

I found this link on Overleaf, hope it helps.

https://www.overleaf.com/learn/latex/Chinese

imjiaoyuan commented 5 months ago

Thank you for your help.

But I think it is my mistake,I still can't input Chinese using version 1.10:

cv:
  name: Licheng
  location: China
...
locale_catalog:
  name: "李成"

There is still an error here:

There are some errors in the data model!

┏━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Location            ┃ Input Value ┃ Error Message                                            ┃
┡━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ locale_catalog.name │ 李成        │ This field is unknown for this object! Please remove it. │
└─────────────────────┴─────────────┴──────────────────────────────────────────────────────────┘

The document only mentions the translation of dates。

n1cogrv commented 5 months ago

I do figure out a way to finish my Chinese version resume. But it is a complete "workaround".

First I new and render my English resume via rendercv using the documented method. And then grab the your-name.tex file to start a new project at overleaf.com.

Rewrite the tex file to use \usepackage{CJKutf8} and wrap Chinese translation resume with \begin{CJK*}{UTF8}{gbsn} and \end{CJK*}.

My Tex file and PDF generated therefrom can be found here https://github.com/n1cogrv/n1cogrv/tree/master/assets.

sinaatalay commented 5 months ago

Thank you for the updates! Chinese characters are still on my TODO list; it will be supported eventually.

For now, you can use the workaround @n1cogrv mentioned. You can also achieve the same thing without Overleaf by updating the templates (the theme folder created with the rendercv new command) and running RenderCV with your local LaTeX distribution with --use-local-latex-command pdflatex option, as described in the user guide.

@yuanj82 locale_cataloge is not for the contents but only for some date-related strings. Content is not language-dependent. Please use JSON Schema while working on your RenderCV input file. It is described here.

sinaatalay commented 5 months ago

Unfortunately, making Chinese characters work by default doesn't seem feasible currently. Therefore, I opened #94, and I am closing this issue for now. Let me know if you have something in your mind.

Aithosa commented 3 months ago

The workflow of rendercv-pipeline report error when the yaml file contains Chinese character. Is it the same question associated with this issue?

Welcome to RenderCV! Some useful links:                                    
┏━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Title             ┃                                                Link ┃
┡━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ Documentation     │                           https://docs.rendercv.com/ │
│ Source code       │             https://github.com/sinaatalay/rendercv/ │
│ Bug reports       │      https://github.com/sinaatalay/rendercv/issues/ │
│ Feature requests  │      https://github.com/sinaatalay/rendercv/issues/ │
│ Discussions       │ https://github.com/sinaatalay/rendercv/discussions/ │
│ RenderCV Pipeline │    https://github.com/sinaatalay/rendercv-pipeline/ │
└───────────────────┴─────────────────────────────────────────────────────┘
╭──────────────────────────────────────────────────────────────────────────────╮
│ 0.1 s Reading and validating the input file has finished.                    │
│ 0.1 s Generating the LaTeX file has finished.                                │
│ 0.3 s Rendering the LaTeX file to a PDF has started.                         │
╰──────────────────────────────────────────────────────────────────────────────╯
0.5 s ━━━━━━━━━━━━━                            (2 out of 6 steps finished)
An error occurred:

RenderCV's built-in TinyTeX binaries couldn't render this LaTeX file into a PDF.
This could be caused by one of two reasons:

1- The theme templates might have been updated in a way RenderCV's TinyTeX 
cannot render. RenderCV's TinyTeX is minified to keep the package size small. As
a result, it doesn't function like a general-purpose LaTeX distribution.
2- Special characters, like Greek or Chinese letters, that are not compatible 
with the fonts used or RenderCV's TinyTeX might have been used.

However, this issue can be resolved by using your own LaTeX distribution instead
of the built-in TinyTeX. This can be done with the '--use-local-latex-command' 
option, as shown below:

rendercv render --use-local-latex-command lualatex John_Doe_CV.yaml

If you ensure that the generated LaTeX file can be compiled by your local LaTeX 
distribution, RenderCV will work successfully. You can debug the generated LaTeX
file in your LaTeX editor to resolve any bugs. Then, you can start using 
RenderCV with your local LaTeX distribution.

If you can't solve the problem, please open an issue on GitHub.

Error: Process completed with exit code 4.