0

I am new to LaTeX and relatively new to RMarkdown, so I hope this is not a dumb question but I have been stuck on this for a few days.

I am trying to knit a pdf report using rmarkdown and a previously created latex template documents. In the template a svg picture of the logo of my company is added to the top of the page using the packages svg, eso-pic and graphicx. The following LaTeX code is used for that:

\usepackage{eso-pic, graphicx}   
\usepackage{svg}   
\AddToShipoutPicture*{%  
      \AtPageUpperLeft{%  
          \raisebox{-\height}{%  
           \hspace*{0.5\paperwidth}\hspace{-0.6615cm}\includesvg{sjablonen//logo.svg}%  
         }%       
}   
} 

However, each time I try to knit the pdf file I get the following error:

! Package svg Error: File `logo_svg-tex.pdf' is missing.\

I found out that the graphicx package was not installed when installing the tinytex package, however each time I try to install it using tinytex::tlmgr_install("graphicx") I get another error:

tlmgr install graphicx 
'\\path\to\project' CMD.EXE was started with the above path as the current directory. UNC paths are not supported.  Defaulting to Windows directory. 
tlmgr.pl install: package graphicx not present in repository. 
tlmgr.pl: action install returned an error; continuing. 
tlmgr.pl: package repository https://mirror.lyrahosting.com/CTAN/systems/texlive/tlnet (not verified: pubkey missing) 
tlmgr.pl: An error has occurred. 
See above messages. Exiting. 
tlmgr update --self tlmgr 
install graphicx 
'\\path\to\project' CMD.EXE was started with the above path as the current directory. UNC paths are not supported.  Defaulting to Windows directory. 
tlmgr.pl install: package graphicx not present in repository. 
tlmgr.pl: action install returned an error; continuing. 
tlmgr.pl: package repository https://ftp.snt.utwente.nl/pub/software/tex/systems/texlive/tlnet (not verified: pubkey missing) 
tlmgr.pl: An error has occurred. 
See above messages. Exiting.

When I try to google the issue I can only find that the graphicx package should be installed when installing tinytex. I tried reinstalling tinytex and using tinytex::tlmrg_search("graphicx"), which showed me that the following packages do exist: graphicx-psmin graphicxbox graphicxpsd pst-graphicx, but didn't show me graphicx again.

What can I do?

JaimeB
  • 1
  • 1
  • 1
    `! Package svg Error: File logo_svg-tex.pdf is missing.` does not mean that the graphicx package is missing. It rather indicates that something when wrong while the svg package tried to convert the svg into a file format which is understandable by latex. Most probable cause is that either inkscape is not installed, the svg package can't find your inkscape installation or you don't compile your document with `--shell-escape` enabled. But honestly, using the svg package and converting the svg to a pdf all the time for a simple logo is such a waste of time. – samcarter_is_at_topanswers.xyz Jul 11 '23 at 09:10
  • I suggest to manually convert the svg to pdf once (e.g. with inkscape) and then include the pdf with the usual `\includegraphics` – samcarter_is_at_topanswers.xyz Jul 11 '23 at 09:10
  • The reason for the tlmgr error is that the `graphicx` package is part of the `graphics` bundle, you have to install this instead of individual packages (but honestly I would be surprised if you don't already have it installed. Even such an incomplete tex distribution like tinytex should have such a basic package.) – samcarter_is_at_topanswers.xyz Jul 11 '23 at 09:13

0 Answers0