LyXadd local .sty and class files

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

add local .sty and class files

Post by ExecutorElassus »

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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

add local .sty and class files

Post by scottkosty »

Are those files found with kpsewhich?
ExecutorElassus
Posts: 94
Joined: Wed Sep 07, 2011 3:14 pm

add local .sty and class files

Post by ExecutorElassus »

Well, I get this output when I search for one of them:

Code: Select all

# 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: 542
Joined: Sat Sep 01, 2012 6:38 am

add local .sty and class files

Post by scottkosty »

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: 94
Joined: Wed Sep 07, 2011 3:14 pm

add local .sty and class files

Post by ExecutorElassus »

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:

Code: Select all

) (/usr/share/texmf-dist/tex/latex/koma-moderncvclassic/koma-moderncvclassic.st
y
Package: koma-moderncvclassic 2012/01/04 v0.5
(/usr/share/texmf-dist/tex/latex/marvosym/marvosym.sty
Package: 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: 94
Joined: Wed Sep 07, 2011 3:14 pm

add local .sty and class files

Post by ExecutorElassus »

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:

Code: Select all

#% 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
Post Reply