0

I'm trying to use the PGFPlots package in order to create some graphs on LyX. I'm following this tutorial (link). It told to insert \usepackage{pgfplots} in the Latex Preamble section, so I did. Also I entered the following code in a TeX box:

\begin{tikzpicture}
    \begin{axis}
    \end{axis}
\end{tikzpicture}

But it shows nothing. So I guess the package is not installed and I have to install it. After some research, I understood that I need to find the .lyx directory and insert the package into the modules directory. But how can I find the .lyx directory? I tried to check the home directory ~ but didn't find it there. Is it possible to somehow find the path to that directory?

2
  • guessing that you are using MikTeX, first test if some simple plot example in LateX from this site works on TeXworks. If still the package is not found, try again but after some minutes, as maybe MikTeX could be now installing automatically. If still do not work, try to install it manually (but in MikTeX, not in LyX). Once it works in Texworks, go to LyX > Tools > Reconfigure. Then try to reproduce the same example in LyX.
    – Fran
    Commented Dec 29, 2018 at 5:07
  • Putting a LaTeX package in the LyX modules directory is a bit weird, as a LaTeX package is not a LyX module. They're quite different things. I don't know which TeX distribution (MikTeX, MacTeX, TeX Live) you've installed, but the "proper" way would be to use the package manager of that distribution. That said, if pgfplots was not installed in the first place, you should get an error when generating the PDF I'd think. Commented Dec 31, 2018 at 19:55

1 Answer 1

0

I solved the issue. The Help→About LyX dialog contains information about where your user directory is:

enter image description here

Also, if you use windows, ~ is %userprofile%.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .