How to use LyX?

When I launch it, or try to edit a real document with it, I get:

Warning: Document class not available
----------------------------------------
The selected document class
        Hebrew Article
requires external files that are not available.
The document class can still be used, but the
document cannot be compiled until the following
prerequisites are installed:
        article.cls
        theorem.sty
See section 3.1.2.2 (Class Availability) of the
User's Guide for more information.

I tried running it with:

nix shell nixpkgs#texlive.combined.scheme-small -c $(nix-build -A lyx)/bin/lyx

But it won’t detect pdflatex? Or it doesn’t use kpsewhich? I tried setting TEXINPUTS with:

env TEXINPUTS=$(nix-build -A texlive.combined.scheme-small)/share/texmf/tex/latex $(nix-build -A lyx)/bin/lyx

And other variants of that path but it didn’t work.

Hi,
Make sure you have a sufficiently large TexLive package, such as nixpkgs.texlive.combined.scheme-medium.
It solved the same kind of problems for me.
That said, the default preview button remains inactive, but I can do a specific preview (e.g. with pdflatex).
Hoping that helps.

Hey! Thanks for replying on such an old post. I just tested, and I experience the same issue:

$ nix shell nixpkgs#texlive.combined.scheme-full nixpkgs#lyx
$ tex2lyx wikibook-example.tex
$ lyx wikibook-example.lyx
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Warning: Document class not available
----------------------------------------
The selected document class
        Article (Standard Class)
requires external files that are not available.
The document class can still be used, but the
document cannot be compiled until the following
prerequisites are installed:
        article.cls
See section 3.1.2.2 (Class Availability) of the
User's Guide for more information.
Warning: Package not available
----------------------------------------
The cite engine biblatex requires a package that is not
available in your LaTeX installation, or a converter that
you have not installed. LaTeX output may not be possible.
Missing prerequisites:
        biblatex.sty
See section 3.1.2.3 (Modules) of the User's Guide for more information.

Where wikibook-example.tex is simply:

\documentclass{article}
\usepackage[backend=biber]{biblatex}
\addbibresource{lauraPhd2016.bib}
\begin{document}
I doubt that there is any useful information here~\cite{wikibook}.

All we know is limited, apart from knowing the answer we all know. Or do we? Wombat and Koala have discovered some interesting things~\cite{wombat2016}.

Some people are too nosy. What can happen to them is described by Laura Lion~\cite[9]{lion2010}.

\printbibliography
\end{document}

Dunno, dropped biblatex so that scheme-medium is enough, tried in a fresh (empty $HOME) environment with only coreutils, vim, lyx, texlive.combined.scheme-medium in $PATH, had to create ~/.lyx, otherwise worked fine and I could view a dvi. I doubt it is flake-specific breakage, maybe you have something interesting leftover in .lyx ?

Thanks for your help @7c6f434c ! Deleting ~/.lyx and ~/.config/LyX indeed helped. It’s interesting that I am able to reproduce the issue if I:

  1. rm -rf ~/.lyx ~/.config/LyX
  2. Run lyx without an available Texlive package in $PATH.
  3. Add a pdflatex to $PATH with nix shell nixpkgs#texlive.combined.scheme-medium.
  4. Run lyx again.
  5. Observe that still basic classes such as article are not available.

OTH, if you do:

rm -rf ~/.lyx ~/.config/LyX
nix shell nixpkgs#texlive.combined.scheme-medium nixpkgs#lyx
lyx

Lyx finally identifies the article class.

This behavior looks like an upstream bug IMO - it should look up for a pdflatex and TeX classes upon every startup…