Re: Module allocating variable in preable
Am Dienstag, 26. Februar 2019 01:35:52 CET schrieb Christian : > Sorry, but I don't see how this solves the problem. This solution > assumes that the variable allocation is always fixed, so that loading > the module would be equivalent to have a set of variables > automatically allocated by "% some stuff to go in the preamble". This > is not what I was aiming for. The idea is to create some LyX layout > (environment, or similar, like "Author", or "Abstract"). Is it > possible to do it? It is exactly as Riki posted. Look for example in acmsiggraph-0-92.layout Style "Copyright_year" Kornel > On Fri, Feb 22, 2019 at 10:18 AM Richard Kimberly Heck > wrote: > > > > On 2/22/19 12:35 AM, Christian wrote: > > > Hello, > > > > > > I am trying to code a module that allocates a variable in the > > > preamble. More specifically, I am using a package that requires to > > > allocate a variable in the preamble. For example, if the package is > > > called "thepackage" and the variable is called "myvariable" my LaTeX > > > code is: > > > > > > \documentclass{book} > > > \makeatletter > > > \usepackage{thepackage} > > > \myvariable{Some stuff here} > > > \makeatother > > > \begin{document} > > > \end{document} > > > > > > I know how to define an environment using a module, but that just > > > includes the definition of the environment in the preamble. I also > > > tried to use the option > > > > > > InPreamble 1 > > > > > > but that doesn't seem to work. > > > > No, you don't want that. > > > > > > > What I am looking for is a LyX > > > layout/style where I can write "Some stuff here", and that this shows > > > up in the preamble as \myvariable{Some stuff here}. > > > > Just put in your module: > > > > AddToPreamble > > % some stuff to go in the preamble. > > EndPreamble > > > > Note that this does not go into any style or inset declaration but just > > sits by itself. > > > > Alternatively, if this material is needed only if a certain style is > > used, then you can put, within that style: > > > > Preamble > > % stuff to add to preamble if this style is used > > EndPreamble > > > > The enumitem module uses both mechanisms, and many of the others use one > > or the other. > > > > Riki > > > > > > > > > > Right now, I am doing this using ERT boxes and the "title and preamble > > > hacks" module. I have more than one of those custom variables, so > > > editing a large ERT box(es) becomes tedious in LyX. Any ideas? > > > > > signature.asc Description: This is a digitally signed message part.
Re: Module allocating variable in preable
On Tue, 26 Feb 2019 01:35:52 -0500 Christian wrote: > Sorry, but I don't see how this solves the problem. This solution > assumes that the variable allocation is always fixed, so that loading > the module would be equivalent to have a set of variables > automatically allocated by "% some stuff to go in the preamble". This > is not what I was aiming for. The idea is to create some LyX layout > (environment, or similar, like "Author", or "Abstract"). Is it > possible to do it? If all you want to do is define an environment within a layout, here's how I do it: Preamble \newenvironment{storyL}{ \par \begingroup \leftskip 0.4in\rightskip 0.4in \it \noindent{.\dotfill{}.\par} %~\vskip -0.3in }{ %~\vskip -0.05in \par\noindent{.\dotfill{}.\par} \endgroup %~\vskip 0.0in ~\\ } %%% Other LaTeX stuff necessary for LyX environments %%% and character styles EndPreamble Style Story LatexType Environment LatexName storyL LeftMargin"MM" RightMargin "MM" ParSkip 0.7 ParSep0.7 TopSep0.7 BottomSep 0.7 Font Series Medium ShapeItalic Size Normal EndFont End The preceding is directly from the layout file for my book, "Key to Everyday Excellence." I made a lot of appearance modifications for both LyX's authoring environment (Story) and the output appearance (StoryL). It could be much simpler. The main thing is that the LyX environment be LateXType "Environment" and have a LatexName identical to a LaTeX environment coded between a Preamble and an EndPreamble. SteveT
Re: Module allocating variable in preable
Sorry, but I don't see how this solves the problem. This solution assumes that the variable allocation is always fixed, so that loading the module would be equivalent to have a set of variables automatically allocated by "% some stuff to go in the preamble". This is not what I was aiming for. The idea is to create some LyX layout (environment, or similar, like "Author", or "Abstract"). Is it possible to do it? On Fri, Feb 22, 2019 at 10:18 AM Richard Kimberly Heck wrote: > > On 2/22/19 12:35 AM, Christian wrote: > > Hello, > > > > I am trying to code a module that allocates a variable in the > > preamble. More specifically, I am using a package that requires to > > allocate a variable in the preamble. For example, if the package is > > called "thepackage" and the variable is called "myvariable" my LaTeX > > code is: > > > > \documentclass{book} > > \makeatletter > > \usepackage{thepackage} > > \myvariable{Some stuff here} > > \makeatother > > \begin{document} > > \end{document} > > > > I know how to define an environment using a module, but that just > > includes the definition of the environment in the preamble. I also > > tried to use the option > > > > InPreamble 1 > > > > but that doesn't seem to work. > > No, you don't want that. > > > > What I am looking for is a LyX > > layout/style where I can write "Some stuff here", and that this shows > > up in the preamble as \myvariable{Some stuff here}. > > Just put in your module: > > AddToPreamble > % some stuff to go in the preamble. > EndPreamble > > Note that this does not go into any style or inset declaration but just > sits by itself. > > Alternatively, if this material is needed only if a certain style is > used, then you can put, within that style: > > Preamble > % stuff to add to preamble if this style is used > EndPreamble > > The enumitem module uses both mechanisms, and many of the others use one > or the other. > > Riki > > > > > > Right now, I am doing this using ERT boxes and the "title and preamble > > hacks" module. I have more than one of those custom variables, so > > editing a large ERT box(es) becomes tedious in LyX. Any ideas? > >
Re: characters marked in red
On Mon, Jan 21, 2019 at 09:50:55AM +0100, paolo m. wrote: > Jean-Marc Lasgouttes wrote: > > > Le 19/01/2019 à 10:34, paolo m. a écrit : > >> Jean-Marc Lasgouttes wrote: > >> > >>> > >>> This is a feature (good or bad) : previews that are too small, where > >>> "small" is defined as 0.1in (used to be hardcoded to 10 pixels) are > >>> marked in red. > >>> > >>> This is probably what you see here. > >>> > >> > >> That happens on Lenovo B590 /ubuntu , not on hp elitebook / opensuse . > >> same lyx 2.3.2 > > > > What other differences in terms of screen resolution and zoom level? We > > may have a bug in this respect. > > > >> How to change preview? > > > > Well, you can disable previews for math in the preferences, but it is > > probably too much. > > > > JMarc > > While my test file is open, as I change the instant preview size from 1.0 to > 1.2 i get : > > Assertion false violated in > file: ../../src/CoordCache.cpp, line: 31 > There has been an error with this document. > LyX will attempt to close it safely. > The current document was closed. > > Followed by : > > SIGSEGV signal caught! > Sorry, you have found a bug in LyX, hope you have not lost any data. > Please read the bug-reporting instructions in 'Help->Introduction' and send > us a bug report, if necessary. Thanks! > Bye. > > Then I open another file and perform the above change in preview size, > eveything is ok. > Reopening my test file afterwards, red marks are not shown any more Do you compile LyX by chance? Scott signature.asc Description: PGP signature