modern2-cv icon indicating copy to clipboard operation
modern2-cv copied to clipboard

cvevents and special characters

Open SHogenboom opened this issue 2 years ago • 4 comments

@schochastics - thanks for going through the effort of converting CV template for use with Quarto. So I apologise in advance for raising an ’issue’, but I’m not sure how to resolve the problem on my own...

When using cvevents() only part of the output is as expected: Screenshot 2023-12-27 at 18 43 56

The difference between the entry that is successfully rendered and the other ones is that the unsuccessful entries include special characters ‘(‘ and ‘)’. I already tried changing the characters (they were unicode before, then [], and now ()). Unfortunately, to no avail. When I look at the intermediate .tex file it shows:

Succesful

\cvevent{2010 - 2012}

Unsuccesful

\cvtext{%
\textbackslash cvevent\{2004 - 2010\} …

Do you perhaps have any idea how to resolve this issue? My entire CV is full of texts with brackets, percentages, ‘&’s etc. - so simply removing them is not the preferred solution ;)

Thanks in advance for your time and effort!

SHogenboom avatar Dec 27 '23 17:12 SHogenboom

This looks like an error I had in other context before. I will need to check this in the new year. Quick possible fix that came to mind is that you could try to escape these characters? So instead of "(" you write "\(". Let me know if this doesn't work then I debug more thoroughly :-)

schochastics avatar Dec 27 '23 19:12 schochastics

I continued the puzzle and have found a ’solution’:

  • I replaced all ‘&’ characters with text ‘and’
  • I replaced all ‘%’ characters with text ‘perc.'
  • There was no need to replace brackets “(“, “)” - although they are generally considered special characters they don’t cause an issue.
  • Adding an \ to escape the special characters did not resolve the issue.

I then ran into another unexpected error where my string contained an empty line (i.e., two paragraphs). This caused a code-break where the document could not render because: compilation failed- error Missing } inserted.

This was resolved by removing the paragraph.

The solutions feel more like ‘hacks’, so any formal ideas would still be appreciated. I also found this Github Issue which discusses similar issues. Though I did not really understand the offered solutions.

SHogenboom avatar Dec 27 '23 19:12 SHogenboom

Hmm agreed this is too hacky of a solution but i fear this might go beyond this template. Let me investigate in the new year and I see what I can do

schochastics avatar Dec 28 '23 11:12 schochastics

@SHogenboom The following works for me(forgot that R needs "double escaping"):

  • & -> \&
  • % -> \%
  • new paragraph -> \newline

hope this helps

schochastics avatar Jan 03 '24 07:01 schochastics