Re: example of layout module for LyX 1.6
Steve Litt wrote: Thanks Oliver, I still don't understand the underlying philosophy of layout modules: 0) What is a layout module? A modular approach to layout files. 1) Why are they better than just writing your own layout file? Flexibility. For example, lets say you need a special kind of markup. (A new charstyle or an extra paragraph type.) This extra stuff can now be used in many different document types. I.e. you can use your layout module in book, article, scrarticle, ... Under the old system, you had to make a new layout file for each of these cases. And what if you had a second special kind of markup? You'd need to make layout files for all combinations of "extra stuff" and various document classes. Now, all you need is one layout module per extra feature. These can be added to existing document classes as needed. So you include "extra math theorem environments" only when you need them, avoiding cluttered menus in all those documents that don't use math. 2) How do you decide when to use them? When you have some nonstandard markup feature that'd be nice to use in several different document classes. And perhaps you don't want to use them _always_, only when needed. Some latex styles increase compile time or introduce conflicts with others. Some are only used for specialized kinds of writing. And some are unusal, not all people have them. So you don't want to add them permanently to one or all document classes. 3) By what design methodology do you create them? They are made the same way as layout files. Typically: A new kind of document (or heavily customized "book") gets a new layout, a new document class. An smaller add-on, like a latex .sty file defining an interesting environment gets a layout module. 4) What are the attributes of a "good" layout module? It is useful, possibly with several document classes. Few conflicts with other stuff, and preferably not dependencies either. A small module adding just one kind of functionality is probably good. If you need several unrelated add-ons, make several distinct modules. Of course a module may define several charstyles/paragraph types, but then they should be related somehow. 5) What are the attributes of a "bad" layout module? Not sure, but an enormous module redefining everything would be bad, in that case a new document class is probably what you want. Fragile setups: A module that works with only one document class, relying on quite a few parameters, other modules, and preamble commands being "just right" or latex will fail. Definitely bad. Helge Hafting
Re: example of layout module for LyX 1.6
G. Milde wrote: On 19.08.08, Steve Litt wrote: I developed these, so let me add a bit. 0) What is a layout module? A file with syntax and content similar to a LyX layout file that can be added to a chosen documentclass' layout definitions on a per-document base. Modules are similar to included files, except in this sense: They are included on a per-document basis, using a GUI in Document>Settings. And, as you put it elsewhere, they allow easy sharing of layout code, without anyone's having to edit a layout file. Put the new module in your layouts/ directory, reconfigure, and use it. 1) Why are they better than just writing your own layout file? It's orthogonal: you can combine document classes with additional features provided by the modules. The advantage is precisely that they can be included on a per-document basis. Suppose, for example, that you sometimes want a "Formula" layout. You want it in articles, books, etc, but not all of them. In 1.5, you could put this into formula.inc and then Input it into various new layouts: article-formula.layout, book-formula.layout, etc. This is very inconvenient, and it gets worse the more customizations you want to mix and match. You need a new layout for every such combination. Modules are a solution. You have formula.module, and you can include it in a document that uses article.layout, book.layout, mycustom.layout, or whatever, all without ever touching those files. 3) By what design methodology do you create them? Take an example from the LyX 1.6 layouts directory and modify. Modules are just layout files, like *.inc files, but with a special extension, and identifying information in the header. 4) What are the attributes of a "good" layout module? Reusability, mostly. And usefulness. 5) What are the attributes of a "bad" layout module? Bugs. ;-) rh
Re: example of layout module for LyX 1.6
Olivier Ripoll wrote: Steve Litt wrote: So is it a way to write once, use many times? Is it a way to use known-debugged LyX/LaTeX code? And is it a way for all of us to trade debugged and tested code without throwing in every silly little feature we put in our book? I think so. At least that's how I see them. But developers and experts might see a bigger picture and envision other uses for the modules. Anything that can go into a layout file can go into a module. So they can do anything from define a whole ton of environments (as theorems-ams.module does) to include a snippet in the premable (as foottoend.module does). I'll be very interested to see what ideas people have for these. rh
Re: example of layout module for LyX 1.6
Steve Litt wrote: Oh, Maybe I do understand it. Is a layout module just a chunk of debugged LyX/LaTeX code that would normally go in a layout file, and gets included in the layout file by reference? So you could mix and match layout modules to get a more granular modularization, similar to #include in C? Yes, pretty much. The thing about modules, however, is that they are dynamically included via Document>Settings. You don't have to edit a layout file to "Input" them. You can change them on the fly. So is it a way to write once, use many times? Is it a way to use known-debugged LyX/LaTeX code? And is it a way for all of us to trade debugged and tested code without throwing in every silly little feature we put in our book? Absolutely. rh
Re: example of layout module for LyX 1.6
On 19.08.08, Steve Litt wrote: > I still don't understand the underlying philosophy of layout modules: > 0) What is a layout module? A file with syntax and content similar to a LyX layout file that can be added to a chosen documentclass' layout definitions on a per-document base. > 1) Why are they better than just writing your own layout file? It's orthogonal: you can combine document classes with additional features provided by the modules. > 2) How do you decide when to use them? In Document>Settings > 3) By what design methodology do you create them? Take an example from the LyX 1.6 layouts directory and modify. > 4) What are the attributes of a "good" layout module? > 5) What are the attributes of a "bad" layout module? This is a matter of taste (to a certain extent). Look at the examples that come with LyX 1.6 for "good" ones. Günter BTW: No TOFU (Text oben full quote unten), please: > On Tuesday 19 August 2008 11:43, Olivier Ripoll wrote: > > Hi, ...
Re: example of layout module for LyX 1.6
On 19.08.08, Olivier Ripoll wrote: > Hi, > I just wanted to share a simple and probably imperfect layout module for > LyX 1.6. ... > As the description says, this module simply defines several useful math > functions that are not available by default. One tip: to get the additional functions nicely rendered in LyX, I use "dummy" math-macros: The definitions goes to the preamble and the math-macro is in a branch or comment (to suppress the \newcommand{}{} definition in the LaTeX file.) This is, however, the <=1.5.x way to do, I do not know how this will fit with the new math-macro implementation in 1.6. The attaced file has such a dummy macro for the sgn function. It is an excerpt of the math-macros for my phd thesis. Günter sgn-macro.lyx Description: application/lyx
Re: example of layout module for LyX 1.6
Steve Litt wrote: On Tuesday 19 August 2008 13:16, Olivier Ripoll wrote: [...] Olivier Oh, Maybe I do understand it. Is a layout module just a chunk of debugged LyX/LaTeX code that would normally go in a layout file, and gets included in the layout file by reference? So you could mix and match layout modules to get a more granular modularization, similar to #include in C? That's how I understand it. I hope there will be more docs written on this topic after 1.6 is out. So is it a way to write once, use many times? Is it a way to use known-debugged LyX/LaTeX code? And is it a way for all of us to trade debugged and tested code without throwing in every silly little feature we put in our book? I think so. At least that's how I see them. But developers and experts might see a bigger picture and envision other uses for the modules. As I said, I am a basic (stupid) user. Best regards, Olivier Thanks SteveT Steve Litt Recession Relief Package http://www.recession-relief.US
Re: example of layout module for LyX 1.6
Hi Steve, Steve Litt wrote: Thanks Oliver, I still don't understand the underlying philosophy of layout modules: 0) What is a layout module? From my (user) point of view, it is a small ".module" file in your "layouts" folder containing class, styles, etc. But the developers might answer that your questions better... 1) Why are they better than just writing your own layout file? I think that's the question I can easily answer: I used LyX years ago to write my PhD thesis. However, I do not know anything about LaTeX, styles, etc. I just took some code from here and there and added them to the preamble (a lot from the now defunct web site that contained many LyX tricks before Wiki even existed). But I never did a layout file. To me, that was (and still is) a too daunting task. When I saw the wiki page on the new features, I jumped into the modules provided with 1.6 and it took me very low time to write the two modules I use. I think the advantage is that a less experienced user like me prefers to add a given module than to touch the preamble, or to write a layout file. Also, I suspect that debugging a trivial module that you can turn on/off is probably easier than debugging a layout file. There are also other advantages: you can add them, remove them, combine several, have different versions, send them to someone, ... it's way more flexible. 2) How do you decide when to use them? When you want to add a functionality for some files only, not for all (e.g. when I write some documents that do not require the erf/sinc functions, then I do not add my math module). It's more flexible than layout I guess. Some of the provided modules implements FAQ stuff, like the one that transforms footnotes to endnotes using the "let" command. LyX can now provide such features in a few mouse clicks. I guess that's another typical use for modules. That's what my math functions module do. 3) By what design methodology do you create them? I have no methodology :-) I just experiment until I am satisfied. 4) What are the attributes of a "good" layout module? 5) What are the attributes of a "bad" layout module? Thanks SteveT Best regards, Olivier
Re: example of layout module for LyX 1.6
On Tue, 19 Aug 2008, Steve Litt wrote: Thanks Oliver, I still don't understand the underlying philosophy of layout modules: 0) What is a layout module? 1) Why are they better than just writing your own layout file? 2) How do you decide when to use them? 3) By what design methodology do you create them? 4) What are the attributes of a "good" layout module? 5) What are the attributes of a "bad" layout module? Hi Steve, I personally have no idea, but I suspect the answer can be found by asking on the developers' list :-) Best regards, /Christian PS. Once 1.6 is out, I think the layout module should be stored somewhere in the wiki. On Tuesday 19 August 2008 11:43, Olivier Ripoll wrote: Hi, I just wanted to share a simple and probably imperfect layout module for LyX 1.6. I do not know much about LaTeX, so I used the examples provided with LyX and google to create this file. I called it "moremathsfunctions.module" (it should be placed in the "layouts" folder in the lyx 1.6 preference folder of your home directory -- in "Application Data" for windows users), and here is the content (between the dashed lines, so people can comment on the code): #\DeclareLyXModule{More Maths Functions} #DescriptionBegin #Additional functions: erf, erfc, sinc, sgn , missing hyperbolic & inverse hyperbolic functions, #Fourier transform & inverse, logarithms in base 10 and 2, floor/ceil (letters and mathematical #notation). #DescriptionEnd # Author : Olivier Ripoll Format 7 Requiresamsmath,mathrsfs AddToPreamble \DeclareMathOperator{\sinc}{sinc} \DeclareMathOperator{\sgn}{sgn} \DeclareMathOperator{\erf}{erf} \DeclareMathOperator{\erfc}{erfc} \DeclareMathOperator{\FT}{\mathscr{F}} \DeclareMathOperator{\iFT}{\mathscr{F}^{-1}} \DeclareMathOperator{\logten}{log_{10}} \DeclareMathOperator{\logtwo}{log_2} \DeclareMathOperator{\sech}{sech} \DeclareMathOperator{\csch}{csch} \DeclareMathOperator{\arsinh}{arsinh} \DeclareMathOperator{\arcosh}{arcosh} \DeclareMathOperator{\artanh}{artanh} \DeclareMathOperator{\arcoth}{arcoth} \DeclareMathOperator{\arsech}{arsech} \DeclareMathOperator{\arcsch}{arcsch} \newcommand{\Floor}[1] {\left\lfloor {#1} \right\rfloor} \DeclareMathOperator{\floor}{floor} \newcommand{\Ceil}[1] {\left\lceil #1 \right\rceil} \DeclareMathOperator{\ceil}{ceil} EndPreamble As the description says, this module simply defines several useful math functions that are not available by default (I hope I did not overwrite existing LaTeX stuff). There are two versions of the "floor" and "ceil" functions, the one with a capital letter must be followed by \{xxx} where xxx is the number to which it is applied. It provides an aspect like in http://en.wikipedia.org/wiki/Floor_function I used http://en.wikipedia.org/wiki/List_of_mathematical_functions as a reference for the functions I added. And before someone says so, Fourier transform and its inverse are not functions, but I do not care ;-) I hope this can be helpful to someone. I like this layout module feature a lot, I created another one with custom char styles for filenames and code, based on Martin Vermeer's "logicalmkup.module". Small question: should I change the "Format 7" to "Format 8" ? Best regards, Olivier PS: be careful, some lines are wrapped by the mail agent in the description. -- Christian Ridderström, +46-8-768 39 44http://www.md.kth.se/~chr
Re: example of layout module for LyX 1.6
On Tuesday 19 August 2008 13:16, Olivier Ripoll wrote: > This layout module is simply adding the definitions to the preamble. > Then, when you type in a formula \erf for instance, it will not be > interpreted by LyX (unless you use preview-latex stuff). But when > generating the pdf, they will be correctly interpreted as functions > (i.e. not in italic, and with a small space afterwards). > The advantage of having them in a layout module is that you do not have > to add them in a preamble by hand. Just add the module to the document > settings, as described in http://wiki.lyx.org/LyX/NewInLyX16#toc4 . > > Of course if someone has any ideas to provide more functionality, any > idea is welcome (that's the reason for posting the module). > > You can also have layouts that will create text styles or environments, > and those will appear in some menus automatically. That's how I have > implemented my "filename" and "code" text styles. See the > "logicalmkup.module" file for an example or my module below. > When I add my "customstyles.module" to the document settings, two > entries appear in the "Edit->Text Style" menu for using them. And when I > use them, LyX correctly change the text style accordingly. Here it is > for reference: > > --- > #\DeclareLyXModule{Custom Styles} > #DescriptionBegin > #Custom character styles for code, filename. > #DescriptionEnd > > # Author : Olivier Ripoll (based on layout by Martin Vermeer) > > Format 7 > > InsetLayout CharStyle:Filename > LyxType charstyle > LabelString filename > LatexType command > LatexName filename > Font > Series Bold > Family Typewriter > EndFont > Preamble > \newcommand{\filename}[1]{\texttt{\textbf{#1}}} > EndPreamble > End > > > InsetLayout CharStyle:Code > LyxType charstyle > LabelString code > LatexType command > LatexName code > Font > Family Typewriter > EndFont > Preamble > \newcommand{\code}[1]{\texttt{#1}} > EndPreamble > End > --- > > Note that I am pretty sure you can create shortcuts for accessing the > styles using what is described on the wiki: > http://wiki.lyx.org/Tips/KeyboardShortcutForCharacterStyles > > Best regards, > > Olivier Oh, Maybe I do understand it. Is a layout module just a chunk of debugged LyX/LaTeX code that would normally go in a layout file, and gets included in the layout file by reference? So you could mix and match layout modules to get a more granular modularization, similar to #include in C? So is it a way to write once, use many times? Is it a way to use known-debugged LyX/LaTeX code? And is it a way for all of us to trade debugged and tested code without throwing in every silly little feature we put in our book? Thanks SteveT Steve Litt Recession Relief Package http://www.recession-relief.US
Re: example of layout module for LyX 1.6
Thanks Oliver, I still don't understand the underlying philosophy of layout modules: 0) What is a layout module? 1) Why are they better than just writing your own layout file? 2) How do you decide when to use them? 3) By what design methodology do you create them? 4) What are the attributes of a "good" layout module? 5) What are the attributes of a "bad" layout module? Thanks SteveT On Tuesday 19 August 2008 11:43, Olivier Ripoll wrote: > Hi, > > I just wanted to share a simple and probably imperfect layout module for > LyX 1.6. I do not know much about LaTeX, so I used the examples provided > with LyX and google to create this file. I called it > "moremathsfunctions.module" (it should be placed in the "layouts" folder > in the lyx 1.6 preference folder of your home directory -- in > "Application Data" for windows users), and here is the content (between > the dashed lines, so people can comment on the code): > > > #\DeclareLyXModule{More Maths Functions} > #DescriptionBegin > #Additional functions: erf, erfc, sinc, sgn , missing hyperbolic & > inverse hyperbolic functions, > #Fourier transform & inverse, logarithms in base 10 and 2, floor/ceil > (letters and mathematical > #notation). > #DescriptionEnd > > # Author : Olivier Ripoll > > Format 7 > > Requires amsmath,mathrsfs > > AddToPreamble > \DeclareMathOperator{\sinc}{sinc} > \DeclareMathOperator{\sgn}{sgn} > \DeclareMathOperator{\erf}{erf} > \DeclareMathOperator{\erfc}{erfc} > \DeclareMathOperator{\FT}{\mathscr{F}} > \DeclareMathOperator{\iFT}{\mathscr{F}^{-1}} > \DeclareMathOperator{\logten}{log_{10}} > \DeclareMathOperator{\logtwo}{log_2} > \DeclareMathOperator{\sech}{sech} > \DeclareMathOperator{\csch}{csch} > \DeclareMathOperator{\arsinh}{arsinh} > \DeclareMathOperator{\arcosh}{arcosh} > \DeclareMathOperator{\artanh}{artanh} > \DeclareMathOperator{\arcoth}{arcoth} > \DeclareMathOperator{\arsech}{arsech} > \DeclareMathOperator{\arcsch}{arcsch} > \newcommand{\Floor}[1] >{\left\lfloor {#1} \right\rfloor} > \DeclareMathOperator{\floor}{floor} > \newcommand{\Ceil}[1] >{\left\lceil #1 \right\rceil} > \DeclareMathOperator{\ceil}{ceil} > EndPreamble > > > As the description says, this module simply defines several useful math > functions that are not available by default (I hope I did not overwrite > existing LaTeX stuff). There are two versions of the "floor" and "ceil" > functions, the one with a capital letter must be followed by \{xxx} > where xxx is the number to which it is applied. It provides an aspect > like in http://en.wikipedia.org/wiki/Floor_function > > I used http://en.wikipedia.org/wiki/List_of_mathematical_functions as a > reference for the functions I added. And before someone says so, Fourier > transform and its inverse are not functions, but I do not care ;-) > > I hope this can be helpful to someone. I like this layout module feature > a lot, I created another one with custom char styles for filenames and > code, based on Martin Vermeer's "logicalmkup.module". > > Small question: should I change the "Format 7" to "Format 8" ? > > Best regards, > > Olivier > > PS: be careful, some lines are wrapped by the mail agent in the > description.
Re: example of layout module for LyX 1.6
Manveru wrote: I do not have 1.6 yet... but I do not understand how LyX understands how to handle these new commands? From my understanding these go only to preamble of document, but how to add these to some buttons on toolbar for example? This layout module is simply adding the definitions to the preamble. Then, when you type in a formula \erf for instance, it will not be interpreted by LyX (unless you use preview-latex stuff). But when generating the pdf, they will be correctly interpreted as functions (i.e. not in italic, and with a small space afterwards). The advantage of having them in a layout module is that you do not have to add them in a preamble by hand. Just add the module to the document settings, as described in http://wiki.lyx.org/LyX/NewInLyX16#toc4 . Of course if someone has any ideas to provide more functionality, any idea is welcome (that's the reason for posting the module). You can also have layouts that will create text styles or environments, and those will appear in some menus automatically. That's how I have implemented my "filename" and "code" text styles. See the "logicalmkup.module" file for an example or my module below. When I add my "customstyles.module" to the document settings, two entries appear in the "Edit->Text Style" menu for using them. And when I use them, LyX correctly change the text style accordingly. Here it is for reference: --- #\DeclareLyXModule{Custom Styles} #DescriptionBegin #Custom character styles for code, filename. #DescriptionEnd # Author : Olivier Ripoll (based on layout by Martin Vermeer) Format 7 InsetLayout CharStyle:Filename LyxType charstyle LabelString filename LatexType command LatexName filename Font Series Bold Family Typewriter EndFont Preamble \newcommand{\filename}[1]{\texttt{\textbf{#1}}} EndPreamble End InsetLayout CharStyle:Code LyxType charstyle LabelString code LatexType command LatexName code Font Family Typewriter EndFont Preamble \newcommand{\code}[1]{\texttt{#1}} EndPreamble End --- Note that I am pretty sure you can create shortcuts for accessing the styles using what is described on the wiki: http://wiki.lyx.org/Tips/KeyboardShortcutForCharacterStyles Best regards, Olivier 2008/8/19 Olivier Ripoll <[EMAIL PROTECTED]> Hi, I just wanted to share a simple and probably imperfect layout module for LyX 1.6. I do not know much about LaTeX, so I used the examples provided with LyX and google to create this file. I called it "moremathsfunctions.module" (it should be placed in the "layouts" folder in the lyx 1.6 preference folder of your home directory -- in "Application Data" for windows users), and here is the content (between the dashed lines, so people can comment on the code): #\DeclareLyXModule{More Maths Functions} #DescriptionBegin #Additional functions: erf, erfc, sinc, sgn , missing hyperbolic & inverse hyperbolic functions, #Fourier transform & inverse, logarithms in base 10 and 2, floor/ceil (letters and mathematical #notation). #DescriptionEnd # Author : Olivier Ripoll Format 7 Requiresamsmath,mathrsfs AddToPreamble \DeclareMathOperator{\sinc}{sinc} \DeclareMathOperator{\sgn}{sgn} \DeclareMathOperator{\erf}{erf} \DeclareMathOperator{\erfc}{erfc} \DeclareMathOperator{\FT}{\mathscr{F}} \DeclareMathOperator{\iFT}{\mathscr{F}^{-1}} \DeclareMathOperator{\logten}{log_{10}} \DeclareMathOperator{\logtwo}{log_2} \DeclareMathOperator{\sech}{sech} \DeclareMathOperator{\csch}{csch} \DeclareMathOperator{\arsinh}{arsinh} \DeclareMathOperator{\arcosh}{arcosh} \DeclareMathOperator{\artanh}{artanh} \DeclareMathOperator{\arcoth}{arcoth} \DeclareMathOperator{\arsech}{arsech} \DeclareMathOperator{\arcsch}{arcsch} \newcommand{\Floor}[1] {\left\lfloor {#1} \right\rfloor} \DeclareMathOperator{\floor}{floor} \newcommand{\Ceil}[1] {\left\lceil #1 \right\rceil} \DeclareMathOperator{\ceil}{ceil} EndPreamble As the description says, this module simply defines several useful math functions that are not available by default (I hope I did not overwrite existing LaTeX stuff). There are two versions of the "floor" and "ceil" functions, the one with a capital letter must be followed by \{xxx} where xxx is the number to which it is applied. It provides an aspect like in http://en.wiki
Re: example of layout module for LyX 1.6
I do not have 1.6 yet... but I do not understand how LyX understands how to handle these new commands? From my understanding these go only to preamble of document, but how to add these to some buttons on toolbar for example? 2008/8/19 Olivier Ripoll <[EMAIL PROTECTED]> > Hi, > > I just wanted to share a simple and probably imperfect layout module for > LyX 1.6. I do not know much about LaTeX, so I used the examples provided > with LyX and google to create this file. I called it > "moremathsfunctions.module" (it should be placed in the "layouts" folder in > the lyx 1.6 preference folder of your home directory -- in "Application > Data" for windows users), and here is the content (between the dashed lines, > so people can comment on the code): > > > #\DeclareLyXModule{More Maths Functions} > #DescriptionBegin > #Additional functions: erf, erfc, sinc, sgn , missing hyperbolic & inverse > hyperbolic functions, > #Fourier transform & inverse, logarithms in base 10 and 2, floor/ceil > (letters and mathematical > #notation). > #DescriptionEnd > > # Author : Olivier Ripoll > > Format 7 > > Requiresamsmath,mathrsfs > > AddToPreamble >\DeclareMathOperator{\sinc}{sinc} >\DeclareMathOperator{\sgn}{sgn} >\DeclareMathOperator{\erf}{erf} >\DeclareMathOperator{\erfc}{erfc} >\DeclareMathOperator{\FT}{\mathscr{F}} >\DeclareMathOperator{\iFT}{\mathscr{F}^{-1}} >\DeclareMathOperator{\logten}{log_{10}} >\DeclareMathOperator{\logtwo}{log_2} >\DeclareMathOperator{\sech}{sech} >\DeclareMathOperator{\csch}{csch} >\DeclareMathOperator{\arsinh}{arsinh} >\DeclareMathOperator{\arcosh}{arcosh} >\DeclareMathOperator{\artanh}{artanh} >\DeclareMathOperator{\arcoth}{arcoth} >\DeclareMathOperator{\arsech}{arsech} >\DeclareMathOperator{\arcsch}{arcsch} >\newcommand{\Floor}[1] > {\left\lfloor {#1} \right\rfloor} >\DeclareMathOperator{\floor}{floor} >\newcommand{\Ceil}[1] > {\left\lceil #1 \right\rceil} >\DeclareMathOperator{\ceil}{ceil} > EndPreamble > > > As the description says, this module simply defines several useful math > functions that are not available by default (I hope I did not overwrite > existing LaTeX stuff). There are two versions of the "floor" and "ceil" > functions, the one with a capital letter must be followed by \{xxx} where > xxx is the number to which it is applied. It provides an aspect like in > http://en.wikipedia.org/wiki/Floor_function > > I used http://en.wikipedia.org/wiki/List_of_mathematical_functions as a > reference for the functions I added. And before someone says so, Fourier > transform and its inverse are not functions, but I do not care ;-) > > I hope this can be helpful to someone. I like this layout module feature a > lot, I created another one with custom char styles for filenames and code, > based on Martin Vermeer's "logicalmkup.module". > > Small question: should I change the "Format 7" to "Format 8" ? > > Best regards, > > Olivier > > PS: be careful, some lines are wrapped by the mail agent in the > description. > > -- Manveru jabber: [EMAIL PROTECTED] gg: 1624001 http://www.manveru.pl
example of layout module for LyX 1.6
Hi, I just wanted to share a simple and probably imperfect layout module for LyX 1.6. I do not know much about LaTeX, so I used the examples provided with LyX and google to create this file. I called it "moremathsfunctions.module" (it should be placed in the "layouts" folder in the lyx 1.6 preference folder of your home directory -- in "Application Data" for windows users), and here is the content (between the dashed lines, so people can comment on the code): #\DeclareLyXModule{More Maths Functions} #DescriptionBegin #Additional functions: erf, erfc, sinc, sgn , missing hyperbolic & inverse hyperbolic functions, #Fourier transform & inverse, logarithms in base 10 and 2, floor/ceil (letters and mathematical #notation). #DescriptionEnd # Author : Olivier Ripoll Format 7 Requiresamsmath,mathrsfs AddToPreamble \DeclareMathOperator{\sinc}{sinc} \DeclareMathOperator{\sgn}{sgn} \DeclareMathOperator{\erf}{erf} \DeclareMathOperator{\erfc}{erfc} \DeclareMathOperator{\FT}{\mathscr{F}} \DeclareMathOperator{\iFT}{\mathscr{F}^{-1}} \DeclareMathOperator{\logten}{log_{10}} \DeclareMathOperator{\logtwo}{log_2} \DeclareMathOperator{\sech}{sech} \DeclareMathOperator{\csch}{csch} \DeclareMathOperator{\arsinh}{arsinh} \DeclareMathOperator{\arcosh}{arcosh} \DeclareMathOperator{\artanh}{artanh} \DeclareMathOperator{\arcoth}{arcoth} \DeclareMathOperator{\arsech}{arsech} \DeclareMathOperator{\arcsch}{arcsch} \newcommand{\Floor}[1] {\left\lfloor {#1} \right\rfloor} \DeclareMathOperator{\floor}{floor} \newcommand{\Ceil}[1] {\left\lceil #1 \right\rceil} \DeclareMathOperator{\ceil}{ceil} EndPreamble As the description says, this module simply defines several useful math functions that are not available by default (I hope I did not overwrite existing LaTeX stuff). There are two versions of the "floor" and "ceil" functions, the one with a capital letter must be followed by \{xxx} where xxx is the number to which it is applied. It provides an aspect like in http://en.wikipedia.org/wiki/Floor_function I used http://en.wikipedia.org/wiki/List_of_mathematical_functions as a reference for the functions I added. And before someone says so, Fourier transform and its inverse are not functions, but I do not care ;-) I hope this can be helpful to someone. I like this layout module feature a lot, I created another one with custom char styles for filenames and code, based on Martin Vermeer's "logicalmkup.module". Small question: should I change the "Format 7" to "Format 8" ? Best regards, Olivier PS: be careful, some lines are wrapped by the mail agent in the description.