Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplication of CV sections #254

Closed
psalveson opened this issue May 16, 2024 · 18 comments
Closed

Duplication of CV sections #254

psalveson opened this issue May 16, 2024 · 18 comments
Assignees
Labels
bug Something isn't working

Comments

@psalveson
Copy link

psalveson commented May 16, 2024

If I make a new RMarkdown file from a Vitae template (which template doesn't matter) and render the file, then the sections within the PDF or HTML file are duplicated. I'm using a fresh install of R, vitae , Rstudio Server, and TinyTex. I'm running on Debian. Example output:
Untitled.pdf

The "Render" tab produces the following warnings:

Warning: LaTeX Warning: Label `ref-R-vitae' multiply defined.
Warning: LaTeX Warning: Label `ref-R-tibble' multiply defined.
Warning: LaTeX Warning: Label `refs-9ab79af7a94489e94e6182750a67b967' multiply defined.
Warning: LaTeX Warning: There were multiply-defined labels.

I've uninstalled and reinstalled the relevant software a few times, but no luck. I've tried both development and CRAN versions of Vitae. I've progressively removed sections from the template, to see if one of them is problematic, but that hasn't worked. Whatever sections are present are duplicated. I have not been able to replicate this behavior in documents outside of Vitae (everything else renders as expected).

Ideas?

@aldeetropolis
Copy link

I have same issue here, I tried updating the base R but the issue is still persist.

@melina-leite
Copy link

I have the same issue, it has just started today while updating my CV.
I reinstalled R, Rstudio, Pandoc, BasicTex, etc.
I'm using a MacBook M1 (macOS 13.6.6).

@roman91DE
Copy link

Same issue here on M2 - Mac Mini

@psalveson
Copy link
Author

I'm not super familiar about the render path for Rmarkdown, but it appears that the file knits correctly (no duplication of sections from Rmd -> md). Dupllication occurs in the md -> tex step (I think that is done by Pandoc). However, I've tried several older versions of Pandoc (3.1.*) and the newest version (3.2), and the problem persists.

@psalveson
Copy link
Author

psalveson commented May 20, 2024

Here's a work-around that requires manual editing of a TeX file. I'm going to use the TwentySeconds template as an example. Make the following change to the YAML portion of the Rmd file:

output: vitae::twentyseconds

to

output: 
  vitae::twentyseconds:
    keep_tex: true

If you render your file, you will see a TEX file in your working directory. Manually remove the duplicated sections from the TEX file in Rstudio or the text editor of your choice. Save the TEX file. Open a command prompt and navigate to your working directory. Run the following command :

pdflatex your-file.tex

You'll need to have pdflatex in your PATH, otherwise you may need to specify the location of the pdflatex executable.

Edit: I just realized that you can create a PDF from a TeX file using the Rstudio GUI. Open the TeX file, remove the duplicated sections, and then click "Compile PDF".

Edit 2: Depending on which template you're using, pdflatex may or may not work. You may need to experiment with using XeLaTeX or LuaLaTeX to typeset PDF documents from TeX. The easiest way to do this is to go into project/global settings in Rstudio -> Sweave -> Change "Typeset LaTeX into PDF using:"

@phrsilva
Copy link

If you render your file, you will see a TEX file in your working directory. Manually remove the duplicated sections from the TEX file in Rstudio or the text editor of your choice. Save the TEX file. Open a command prompt and navigate to your working directory. Run the following command :

Even when i remove the duplicated labels on the tex file i can't Knit it, be it on RStudio or direct prompt commands (i've tried xelatex and pdflatex)

Through RStudio the error i get is
Running pdflatex.exe on Untitled.tex...failed Error running C:/Program Files/MiKTeX/miktex/bin/x64/pdflatex.exe (exit code -1073740791)

Are there any other ways around this?

@jmmartinf
Copy link

jmmartinf commented May 29, 2024

I found a temporary solution, the problem comes from knitr update (this isn`t the first time...)

My solution was a downgrade in knitr and xfun packages that were updated recently. The other dependecy (highr) don't have any issue.

For a simple fix you can use this code in R:
library(remotes)

knitr_1.45

version <- c("knitr", 1.45)
install_version(version[1], version[2])

xfun 0.42

version <- c("xfun", 0.42)
install_version(version[1], version[2])

@psalveson
Copy link
Author

@jmmartinf Works as expected. Thank you.

@Robinlovelace
Copy link

Same here, odd issue, thanks for the fix, testing it now!

@Robinlovelace
Copy link

Confirmed.

@Abeluis
Copy link

Abeluis commented Jun 4, 2024

I tried using @jmmartinf but I couldn't downgrade the packages, this worked for me:

Knitr

packageurl <- "https://cran.r-project.org/src/contrib/Archive/knitr/knitr_1.45.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

Xfun

packageurl <- "https://cran.r-project.org/src/contrib/Archive/xfun/xfun_0.42.tar.gz"
install.packages(packageurl, repos=NULL, type="source")

@jjuri-socialmining
Copy link

Works for me as well Thanks Abeluis!!! 😄

@jjuri-socialmining
Copy link

It no longer duplicates the entry data but overlaps the titles how can I fix this issue? Do I need to update another package?
Screen Shot 2024-06-04 at 12 08 24 AM

@jmmartinf
Copy link

I don't know... but you could list here the version of your packages...

@jjuri-socialmining
Copy link

jjuri-socialmining commented Jun 5, 2024

it is hard to figure out what is the issue. Here are my packages:

R6 R6 2.5.1
askpass askpass 1.2.0
base64enc base64enc 0.1-3
bit bit 4.0.5
bit64 bit64 4.0.5
bslib bslib 0.7.0
cachem cachem 1.1.0
cellranger cellranger 1.1.0
cli cli 3.6.2
clipr clipr 0.8.0
cpp11 cpp11 0.4.7
crayon crayon 1.5.2
curl curl 5.2.1
digest digest 0.6.35
dplyr dplyr 1.1.4
evaluate evaluate 0.23
fansi fansi 1.0.6
fastmap fastmap 1.2.0
fontawesome fontawesome 0.5.2
fs fs 1.6.4
gargle gargle 1.5.2
generics generics 0.1.3
glue glue 1.7.0
googledrive googledrive 2.1.1
googlesheets4 googlesheets4 1.1.1
highr highr 0.10
hms hms 1.1.3
htmltools htmltools 0.5.8.1
httr httr 1.4.7
ids ids 1.0.1
jquerylib jquerylib 0.1.4
jsonlite jsonlite 1.8.8
knitr knitr 1.45
lifecycle lifecycle 1.0.4
lubridate lubridate 1.9.3
magrittr magrittr 2.0.3
memoise memoise 2.0.1
mime mime 0.12
openssl openssl 2.2.0
pillar pillar 1.9.0
pkgconfig pkgconfig 2.0.3
prettyunits prettyunits 1.2.0
progress progress 1.2.3
purrr purrr 1.0.2
rappdirs rappdirs 0.3.3
readr readr 2.1.5
rematch rematch 2.0.0
rematch2 rematch2 2.1.2
renv renv 1.0.7
rlang rlang 1.1.3
rmarkdown rmarkdown 2.27
sass sass 0.4.9
stringi stringi 1.8.4
stringr stringr 1.5.1
sys sys 3.4.2
tibble tibble 3.2.1
tidyr tidyr 1.3.1
tidyselect tidyselect 1.2.1
timechange timechange 0.3.0
tinytex tinytex 0.51
tzdb tzdb 0.4.0
utf8 utf8 1.2.4
uuid uuid 1.2-0
vctrs vctrs 0.6.5
vitae vitae 0.5.4
vroom vroom 1.6.5
withr withr 3.0.0
xfun xfun 0.42
yaml yaml 2.3.8

@christelinda-laureijs
Copy link

I am experiencing a similar issue as @jjuri-socialmining regarding the spacing on the awesome-cv template. I fixed it by adjusting the \vspace{} command within the cvitems environment definition. I changed line 703 of the awesome-cv.cls file.

\newenvironment{cvitems}{%
  \vspace{-4.0mm}
  \begin{justify}
  \begin{itemize}[leftmargin=2ex, rightmargin=5ex, nosep, noitemsep]
    \setlength{\parskip}{0pt}
    \renewcommand{\labelitemi}{\bullet}
}{%
  \end{itemize}
  \end{justify}
  \vspace{2.0mm}  % Changed this from -4.0mm to 2.0mm
}

When I changed the \vspace{} command to +2 mm, this increased the space between bullet points and the next section.

@jjuri-socialmining
Copy link

jjuri-socialmining commented Jun 5, 2024

Thank you so much, I just figured out 30 minutes ago this coding line. Now the issue is 100% solved. It is curious because all the templates have - 4.0mm. This makes sense to overlap, why doesn't this error happen before... It is very interesting

@mitchelloharawild mitchelloharawild self-assigned this Jun 12, 2024
@mitchelloharawild mitchelloharawild added the bug Something isn't working label Jun 12, 2024
@mitchelloharawild
Copy link
Owner

Fixed in f32ca0b, you can install the fixed version with

# install.packages("remotes")
remotes::install_github("mitchelloharawild/vitae")

I'll be submitting a new version to CRAN shortly. Thanks for the patience, workarounds, and other useful discussion everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests