2

I am using tikzDevice to run my R-scripts within latex.

This is my code --

\documentclass{article}
\usepackage[acronym]{glossaries}
\usepackage{tikz} 


\makeglossaries

\newacronym{gcd}{GCD}{Greatest Common Divisor}

\newacronym{lcm}{LCM}{Least Common Multiple}

\begin{document}


    Given a set of numbers, there are elementary methods to compute 
    its \acrlong{gcd}, which is abbreviated \acrshort{gcd}. This 
    process is similar to that used for the \acrfull{lcm}.


    \begin{figure}[!ht]
    \centering
    \input{rtikzFile}
    \end{figure}

\end{document}

where rtikzFile is created using R as follows --

library(tikzDevice)
tikz("rtikzFile.tex" )
options( tikzLatexPackages = c( getOption( "tikzLatexPackages" ), "\\usepackage[acronym]{glossaries}"))
plot(1,1,xlab="XXX")
dev.off()

Now, I would like to use \gls{lcm} instead of XXX as x-label. I have tried using \\gls\\{lcm\\} and also \\gls{lcm}. Everything just return errors, something like --

File: pgfcorepathusage.code.tex 2013/12/13 (rss-revision 1.23) \Error in getMetricsFromLatex(TeXMetrics, verbose = verbose) : TeX was unable to calculate metrics for the following string or character:

\gls{lcm}

Edit after comments -

Problem is (Guess) : - I need to pass \makeglossaries and also the compiled glossary files to it. I don't know how to do it.

Alternatively, I can just use \gls{lcm} in the rtikzFile.tex file generated after executing with R. But this is not an automated way.

  • same question on another platform, see the actual problem here -- github.com/yihui/tikzDevice/issues/144#issuecomment-227581146 – novice Jun 21 '16 at 21:43
  • Where can tiki.sty be found? – cfr Jun 22 '16 at 0:48
  • A typo... It is tikz. – novice Jun 22 '16 at 5:11
  • I've never use R or tikzdevice, but I'm guessing if you have to supply "\\usepackage[acronym]{glossaries}" then you'll also need to supply the entry definitions. – Nicola Talbot Jun 22 '16 at 10:21
  • exactly, that's the problem. I must pass compiled glossary to it. I will edit the post now. – novice Jun 22 '16 at 10:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.