Adding new class failed...? ExamDesign
Hello, I've tried to add a new class called exam, and have been unsuccessful. The instructions call for simply placing the exam.cls file in a place where latex coulf find it, so I created a directory in the packages area, placed the file there, ran texhash and reran lyx configure, but was unsuccessful. I tried to add a documentclass statement to the preamble, but that died too. I then moved the file into the lyx subdirectory of that area, noting that other class files were in there as well, reran the configure scripts, and found things still not working. I'm afraid I'm at a bit of a loss. The only other thing I can think of is to try to create a new file (template?) which has its own \documentclass statement. Is this possible? The class is supposed to be more or less an extension of the article class, FWIW. I am curious whether it can set itself up as something which will list all the paragraph options as do the other classes, or if I will need to define some commands to shorten the typing of the latex code need to access the features of the package. ??? Thanks for any help offered, and happy holidays to everyone! Kenward Dr. Kenward Vaughan .'^~;,_ Professor of Chemistry':,'~ Bakersfield College \;:/ 1801 Panorama Drive |,;| Bakersfield, CA 93305 / ', \ 661-395-4243/ o O \ [EMAIL PROTECTED] (work) (oOoOOoOo) [EMAIL PROTECTED] (home) ------ ???$$???
Re: Adding new class failed...? ExamDesign
On Mon, 20 Dec 1999 [EMAIL PROTECTED] wrote: > I've tried to add a new class called exam, and have been unsuccessful. The > instructions call for simply placing the exam.cls file in a place where latex > coulf find it Yes, this means a directory under .../texmf/tex/latex/ > so I created a directory in the packages area, placed the file > there, ran texhash and reran lyx configure, but was unsuccessful. Do you have a corresponding LyX layout? Where is it? It should stay in a directory named ".lyx/layouts" in your home directory or /usr/local/share/lyx/layouts. > add a documentclass statement to the preamble, but that died too. This way your document will have two \documentclass statements. > I then moved the file into the lyx subdirectory of that area, noting that > other class files were in there as well, reran the configure scripts, and > found things still not working. I'm afraid I'm at a bit of a loss. You can put the .cls file in another directory and instruct teTeX to look in that place. In my .profile I have TEXINPUTS=".:$HOME/lib/teTeX:" export TEXINPUTS > The only other thing I can think of is to try to create a new file > (template?) which has its own \documentclass statement. Is this possible? You *should* do it. Read the already existing layouts and you will see that it is not that difficult. > The class is supposed to be more or less an extension of the article > class, FWIW. I am curious whether it can set itself up as something > which will list all the paragraph options as do the other classes, or > if I will need to define some commands to shorten the typing of the > latex code need to access the features of the package. ??? You can add them to your new LyX layout or in last case insert them in TeX mode. Casantos
Re: Adding new class failed...? ExamDesign
In, on 12/20/99 at 05:02 PM, Carlos A M dos Santos <[EMAIL PROTECTED]> said: [...] >Do you have a corresponding LyX layout? Where is it? It should stay in a >directory named ".lyx/layouts" in your home directory or >/usr/local/share/lyx/layouts. Hmm. Haven't looked for such. >> add a documentclass statement to the preamble, but that died too. >This way your document will have two \documentclass statements. Yup. Found that out. Last time I try it. :) That is where the idea of a separate template came from... >> I then moved the file into the lyx subdirectory of that area, noting that >> other class files were in there as well, reran the configure scripts, and >> found things still not working. I'm afraid I'm at a bit of a loss. >You can put the .cls file in another directory and instruct teTeX to look in >that place. In my .profile I have > TEXINPUTS=".:$HOME/lib/teTeX:" > export TEXINPUTS That is done by texhash in my case, I think, since I am keeping the file in the normal part of the tex directory tree. >> The only other thing I can think of is to try to create a new file >> (template?) which has its own \documentclass statement. Is this possible? >You *should* do it. Read the already existing layouts and you will see that >it is not that difficult. >> The class is supposed to be more or less an extension of the article >> class, FWIW. I am curious whether it can set itself up as something >> which will list all the paragraph options as do the other classes, or >> if I will need to define some commands to shorten the typing of the >> latex code need to access the features of the package. ??? >You can add them to your new LyX layout or in last case insert them in TeX >mode. Thanks very much, Carlos! I'll try these things immediately (er, well, after the kids get busy elsewhere... ;) Kenward Dr. Kenward Vaughan .'^~;,_ Professor of Chemistry':,'~ Bakersfield College \;:/ 1801 Panorama Drive |,;| Bakersfield, CA 93305 / ', \ 661-395-4243/ o O \ [EMAIL PROTECTED] (work) (oOoOOoOo) [EMAIL PROTECTED] (home) ------ ???$$???
Re: Adding new class failed...? ExamDesign
On Mon, 20 Dec 1999 [EMAIL PROTECTED] wrote: > >> The class is supposed to be more or less an extension of the article > >> class, FWIW. I am curious whether it can set itself up as something > >> which will list all the paragraph options as do the other classes, or > >> if I will need to define some commands to shorten the typing of the > >> latex code need to access the features of the package. ??? > > >You can add them to your new LyX layout or in last case insert them in TeX > >mode. > > Thanks very much, Carlos! I'll try these things immediately (er, well, after > the kids get busy elsewhere... ;) To speed things along you should be able to just copy article.layout and reword the line at the top that lloks like: # \DeclareLaTeXClass{article} to # \DeclareLaTeXClass{article (exam)} since I think you originally said it was exam.cls. There are new docs being developed all about adding new classes but Mike hasn't resurfaced with them yet. Mike? Are you still up a mountain? Or have you already left on holidays? Allan. (ARRae)
Re: Adding new class failed...? ExamDesign
In <[EMAIL PROTECTED]>, on 12/21/99 at 12:08 PM, Allan Rae <[EMAIL PROTECTED]> said: [...] >To speed things along you should be able to just copy article.layout and >reword the line at the top that lloks like: > # \DeclareLaTeXClass{article} >to > # \DeclareLaTeXClass{article (exam)} >since I think you originally said it was exam.cls. There are new docs being >developed all about adding new classes but Mike hasn't resurfaced with them >yet. I tried doing just that, but found that I am unable to type in even the simplest example without an error about "\end{document}" having no line to end... The package does not appear to require a document having any specific parts in the body. I tried to add either/both \begin{document} and \end{document} statements to no avail. ("Exam" did show up as a class, BTW, after doing the above.) I'm still slowly trying to figure out how to get the various environments into Lyx's drop down list at the top. One of my the biggest problems is a lack of knowledge about Latex itself and how Lyx incorporates that from the .cls files into the layout files. Additionally, can a new command (macro?) be defined in the preamble which causes a substitution of a whole phrase? E.g. "\bmcq" translating to \begin{multiplechoice} \begin{question} ??? This would at least give me a shorthand way of doing several entries at once until things get figured out. I appreciate the help! Kenward Dr. Kenward Vaughan .'^~;,_ Professor of Chemistry':,'~ Bakersfield College \;:/ 1801 Panorama Drive |,;| Bakersfield, CA 93305 / ', \ 661-395-4243/ o O \ [EMAIL PROTECTED] (work) (oOoOOoOo) [EMAIL PROTECTED] (home) ------ ???$$???
Re: Adding new class failed...? ExamDesign
On Mon, 20 Dec 1999 [EMAIL PROTECTED] wrote: > In <[EMAIL PROTECTED]>, on 12/21/99 > >at 12:08 PM, Allan Rae <[EMAIL PROTECTED]> said: > > [...] > >To speed things along you should be able to just copy article.layout and > >reword the line at the top that lloks like: > > > # \DeclareLaTeXClass{article} > >to > > # \DeclareLaTeXClass{article (exam)} > > >since I think you originally said it was exam.cls. There are new docs being > >developed all about adding new classes but Mike hasn't resurfaced with them > >yet. > > I tried doing just that, but found that I am unable to type in even the > simplest example without an error about "\end{document}" having no line to > end... This can happen if you have unmatched '{' and '}' in your latex document. A different error occurs when you have unmatched \begin and \end statements. > The package does not appear to require a document having any specific > parts in the body. I tried to add either/both \begin{document} and > \end{document} statements to no avail. ("Exam" did show up as a class, BTW, > after doing the above.) Adding \begin{document} or \end{document} is just going to confuse latex the same way multiple \documentclass statements do. You've already learned that lesson :-) If "Exam" didn't show up as a class how did you generate a file with lyx for this class? Have you rerun configure for LyX either from the command line or from the menu? Take a look at the output and see if lyx even searched for exam at all. If it did there should be a line with either a "yes" or "no" stating if it was found. You can also check this in your ~/.lyx/textclass.lst file assuming you put the new layout file as ~/.lyx/layouts/exam.layout Remember you have to restart LyX after reconfiguring. > I'm still slowly trying to figure out how to get the various environments > into Lyx's drop down list at the top. One of my the biggest problems is a > lack of knowledge about Latex itself and how Lyx incorporates that from the > .cls files into the layout files. Building the layout file is a trial-and-error process done by hand -- no automated tools. Generally I just copy Styles from other layouts that look similar to whatever new class I happen to trying to use. As a result they (IEEEtran, latex8 and soon ieice) on screen only look approximately like they do on paper. You should take a look at the section on the layout format in Help->Customization. The main things you need to set are the Margin and label info. Fonts can be tuned later. > Additionally, can a new command (macro?) be defined in the preamble which > causes a substitution of a whole phrase? E.g. "\bmcq" translating to > > \begin{multiplechoice} > \begin{question} > > ??? This would at least give me a shorthand way of doing several entries at > once until things get figured out. Something like this is certainly possible. It's been used in the past for the slides environment although now we have support for empty environments this isn't used anymore. You can define the multiple choice environment to have "KeepEmpty 1" which will then allow you to inert new question environment/s. It's likely you'd run into problems with consecutive question environments due to flaw in LyX's handling of environments but there is a simple workaround for this if you do have problems here. Allan. (ARRae)