LaTeX forum ⇒ LyXadd 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

Postby ExecutorElassus » Tue Feb 20, 2018 7:26 pm

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

Postby scottkosty » Tue Feb 20, 2018 11:31 pm

Are those files found with kpsewhich?

ExecutorElassus
Posts: 90
Joined: Wed Sep 07, 2011 3:14 pm

Postby ExecutorElassus » Wed Feb 21, 2018 9:35 am

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

  1. # kpsewhich koma-moderncvclassic.sty
  2. /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

Postby scottkosty » Thu Feb 22, 2018 10:07 pm

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

Postby ExecutorElassus » Sat Mar 03, 2018 2:49 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:

  1. ) (/usr/share/texmf-dist/tex/latex/koma-moderncvclassic/koma-moderncvclassic.st
  2. y
  3. Package: koma-moderncvclassic 2012/01/04 v0.5
  4. (/usr/share/texmf-dist/tex/latex/marvosym/marvosym.sty
  5. Package: marvosym 2011/07/20 v2.2 Martin Vogel's Symbols font definitions
  6.  
  7. ! LaTeX Error: Command \fax already defined.
  8. Or name \end... illegal, see p.192 of the manual.
  9.  
  10. See the LaTeX manual or LaTeX Companion for explanation.
  11. Type H <return> for immediate help.
  12. ...
  13.  
  14. l.101 \newcommand\fax{\mvchr{116}}
  15.  
  16. Your command was ignored.
  17. Type I <command> <return> to replace it with another command,
  18. 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

Postby ExecutorElassus » Mon Mar 05, 2018 10:45 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:

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


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

Can you give me some guidance?

Cheers,

EE


Return to “LyX”

Who is online

Users browsing this forum: No registered users and 5 guests