## LaTeX forum ⇒ LyX ⇒ add local .sty and class files

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
ExecutorElassus
Posts: 90
Joined: Wed Sep 07, 2011 3:14 pm

### add local .sty and class files

Presently, my texlive installation stores .sty and .cls files is any of hundreds of subdirectories under /usr/share/texmf-{dist,site}/latex/tex/. There appear to be class definitions, for example, for half a dozen different CV styles, from KOMA-Script and any number of others.

Trouble is, my installation of LyX doesn't see any of them, and instead only lists (under Document→Settings→Document Class) the three or four default classes that shipped with LyX itself.

How can I gain access to all the rest of these document class definitions? Using Tools→Reconfigure doesn't seem to help.

Cheers,

EE

Tags:

scottkosty
Site Moderator
Posts: 525
Joined: Sat Sep 01, 2012 6:38 am
Are those files found with kpsewhich?

ExecutorElassus
Posts: 90
Joined: Wed Sep 07, 2011 3:14 pm
Well, I get this output when I search for one of them:

# kpsewhich koma-moderncvclassic.sty/usr/share/texmf-dist/tex/latex/koma-moderncvclassic/koma-moderncvclassic.sty

So I assume that yes, kpsewhich is able to find them. But they don't show up on Lyx's dropdown menu of available document classes, so how do I get access to them?

scottkosty
Site Moderator
Posts: 525
Joined: Sat Sep 01, 2012 6:38 am
Ah, that's because you have to have a layout file to be able to use the class in LyX. It can be difficult to learn how to make a layout file. If you want to go down that path, you can read Help > Customization. There is also some information on the web. see, e.g. https://wiki.lyx.org/Layouts/Layouts

ExecutorElassus
Posts: 90
Joined: Wed Sep 07, 2011 3:14 pm
ah, thank you for the tip. I'll start reading tutorials. Is there a way to batch-generate layout files? I have probably dozens of .sty and class files as part of my distro; I'd like to avoid having to generate each one manually if I can.

But thank you for the tip. I'll proceed with educating myself and come back if I get stuck.

Cheers,

EE
UPDATE: OK, I created a new layout file, based on the moderncv one, and now I get a bunch of errors about commands being already defined, as follows:

) (/usr/share/texmf-dist/tex/latex/koma-moderncvclassic/koma-moderncvclassic.styPackage: koma-moderncvclassic 2012/01/04 v0.5(/usr/share/texmf-dist/tex/latex/marvosym/marvosym.styPackage: marvosym 2011/07/20 v2.2 Martin Vogel's Symbols font definitions ! LaTeX Error: Command \fax already defined.               Or name \end... illegal, see p.192 of the manual. See the LaTeX manual or LaTeX Companion for explanation.Type  H <return>  for immediate help. ...                                               l.101 \newcommand\fax{\mvchr{116}} Your command was ignored.Type  I <command> <return>  to replace it with another command,or  <return>  to continue without it.

And then output is just a couple lines from the preamble and nothing else.

What did I configure wrong here?

ExecutorElassus
Posts: 90
Joined: Wed Sep 07, 2011 3:14 pm
Update: I'm still having trouble here with the "already defined" error on the cv file. Likewise, I'm having trouble getting access to the invoice class.

I have the file:

/usr/share/texmf-dist/tex/latex/invoice/invoice.{sty,def}

which should provide access to new section types and whatever other tools I might need to create an invoice. But following the instructions at the link you gave, or reading the Customization help file, didn't provide me with the answers I'm looking for. I did create a file invoice.layout in my .lyx local layouts directory, which reads:

#% Do not delete the line below; configure depends on this#  \DeclareLaTeXClass[scrlttr2, invoice.sty]{KOMA-Script Letter/invoice (V. 2)}#  \DeclareCategory{Letters}# KOMA scrlettr2 textclass definition file.# Juergen Spitzmueller <spitz@lyx.org>, 2003/2/17.# Uwe Stöhr <uwestoehr@web.de>, 2008/2/03. Preamble        \usepackage{invoice}EndPreamble

at the top of the file, but that doesn't seem to do anything.

Can you give me some guidance?

Cheers,

EE