Re: help - some questions

2009-08-23 Thread Olivier Ripoll

rgheck wrote:

On 08/21/2009 06:08 AM, Sam Liddicott wrote:

* Olivier Ripoll wrote, On 21/08/09 10:29:
  

Sam Liddicott wrote:


(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)
   

Isn't that what layout modules are for ?
 

Sure, but as you can't embed a layout module in the lyx document, ERT
can sometimes be easier and more portable, and for small chunks of text
is already clearly delineated in the Lyx document by the red box.

   
Actually, LyX does support embedded layout. But it's an Advanced Feature 
because it is somewhat dangerous, so it is not widely advertised. There 
is also, at the moment, no GUI for it.


Have a look at the file Customization.lyx in your favorite text editor. 
Some way down you will find these lines:


\begin_local_layout
Format 7
InsetLayout CharStyle:MenuItem
LyxType   charstyle
LabelString   menu
LatexType command
LatexName menuitem
Font
Family  Sans
EndFont
Preamble
\newcommand*{\menuitem}[1]{{\sffamily #1}}
EndPreamble
End
\end_local_layout

If you want to include local layout in your document, you can open it in 
a text editor and add similar lines. Make sure they are well tested 
first, and be real careful about the first and last line. Unpredictable 
things might happen otherwise.


I hope to add a GUI for this in the next LyX release (now looking like 
1.7). I'd be really, really happy if someone else wanted to jump in and 
do it. It should actually be quite easy. (More or less just copy the GUI 
for the preamble.)


Richard



Hi,

Wouldn't it make sense to have some option somewhere to include external 
modules to the .lyx file this way? I mean, the ones that are included at 
present from the GUI.


Best regards,

Olivier





Re: help - some questions

2009-08-23 Thread rgheck

On 08/23/2009 05:49 AM, Olivier Ripoll wrote:

rgheck wrote:

On 08/21/2009 06:08 AM, Sam Liddicott wrote:

* Olivier Ripoll wrote, On 21/08/09 10:29:

Sam Liddicott wrote:

(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)

Isn't that what layout modules are for ?

Sure, but as you can't embed a layout module in the lyx document, ERT
can sometimes be easier and more portable, and for small chunks of text
is already clearly delineated in the Lyx document by the red box.

Actually, LyX does support embedded layout. But it's an Advanced 
Feature because it is somewhat dangerous, so it is not widely 
advertised. There is also, at the moment, no GUI for it.


Have a look at the file Customization.lyx in your favorite text 
editor. Some way down you will find these lines:


\begin_local_layout
Format 7
InsetLayout CharStyle:MenuItem
LyxType   charstyle
LabelString   menu
LatexType command
LatexName menuitem
Font
Family  Sans
EndFont
Preamble
\newcommand*{\menuitem}[1]{{\sffamily #1}}
EndPreamble
End
\end_local_layout

If you want to include local layout in your document, you can open it 
in a text editor and add similar lines. Make sure they are well 
tested first, and be real careful about the first and last line. 
Unpredictable things might happen otherwise.


I hope to add a GUI for this in the next LyX release (now looking 
like 1.7). I'd be really, really happy if someone else wanted to jump 
in and do it. It should actually be quite easy. (More or less just 
copy the GUI for the preamble.)


Richard



Hi,

Wouldn't it make sense to have some option somewhere to include 
external modules to the .lyx file this way? I mean, the ones that are 
included at present from the GUI.


Do you mean an option to embed the content of the external module as 
local layout?


rh



Re: help - some questions

2009-08-23 Thread Olivier Ripoll

rgheck wrote:

On 08/21/2009 06:08 AM, Sam Liddicott wrote:

* Olivier Ripoll wrote, On 21/08/09 10:29:
  

Sam Liddicott wrote:


(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)
   

Isn't that what layout modules are for ?
 

Sure, but as you can't embed a layout module in the lyx document, ERT
can sometimes be easier and more portable, and for small chunks of text
is already clearly delineated in the Lyx document by the red box.

   
Actually, LyX does support embedded layout. But it's an Advanced Feature 
because it is somewhat dangerous, so it is not widely advertised. There 
is also, at the moment, no GUI for it.


Have a look at the file Customization.lyx in your favorite text editor. 
Some way down you will find these lines:


\begin_local_layout
Format 7
InsetLayout CharStyle:MenuItem
LyxType   charstyle
LabelString   menu
LatexType command
LatexName menuitem
Font
Family  Sans
EndFont
Preamble
\newcommand*{\menuitem}[1]{{\sffamily #1}}
EndPreamble
End
\end_local_layout

If you want to include local layout in your document, you can open it in 
a text editor and add similar lines. Make sure they are well tested 
first, and be real careful about the first and last line. Unpredictable 
things might happen otherwise.


I hope to add a GUI for this in the next LyX release (now looking like 
1.7). I'd be really, really happy if someone else wanted to jump in and 
do it. It should actually be quite easy. (More or less just copy the GUI 
for the preamble.)


Richard



Hi,

Wouldn't it make sense to have some option somewhere to include external 
modules to the .lyx file this way? I mean, the ones that are included at 
present from the GUI.


Best regards,

Olivier





Re: help - some questions

2009-08-23 Thread rgheck

On 08/23/2009 05:49 AM, Olivier Ripoll wrote:

rgheck wrote:

On 08/21/2009 06:08 AM, Sam Liddicott wrote:

* Olivier Ripoll wrote, On 21/08/09 10:29:

Sam Liddicott wrote:

(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)

Isn't that what layout modules are for ?

Sure, but as you can't embed a layout module in the lyx document, ERT
can sometimes be easier and more portable, and for small chunks of text
is already clearly delineated in the Lyx document by the red box.

Actually, LyX does support embedded layout. But it's an Advanced 
Feature because it is somewhat dangerous, so it is not widely 
advertised. There is also, at the moment, no GUI for it.


Have a look at the file Customization.lyx in your favorite text 
editor. Some way down you will find these lines:


\begin_local_layout
Format 7
InsetLayout CharStyle:MenuItem
LyxType   charstyle
LabelString   menu
LatexType command
LatexName menuitem
Font
Family  Sans
EndFont
Preamble
\newcommand*{\menuitem}[1]{{\sffamily #1}}
EndPreamble
End
\end_local_layout

If you want to include local layout in your document, you can open it 
in a text editor and add similar lines. Make sure they are well 
tested first, and be real careful about the first and last line. 
Unpredictable things might happen otherwise.


I hope to add a GUI for this in the next LyX release (now looking 
like 1.7). I'd be really, really happy if someone else wanted to jump 
in and do it. It should actually be quite easy. (More or less just 
copy the GUI for the preamble.)


Richard



Hi,

Wouldn't it make sense to have some option somewhere to include 
external modules to the .lyx file this way? I mean, the ones that are 
included at present from the GUI.


Do you mean an option to embed the content of the external module as 
local layout?


rh



Re: help - some questions

2009-08-23 Thread Olivier Ripoll

rgheck wrote:

On 08/21/2009 06:08 AM, Sam Liddicott wrote:

* Olivier Ripoll wrote, On 21/08/09 10:29:
  

Sam Liddicott wrote:


(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)
   

Isn't that what layout modules are for ?
 

Sure, but as you can't embed a layout module in the lyx document, ERT
can sometimes be easier and more portable, and for small chunks of text
is already clearly delineated in the Lyx document by the red box.

   
Actually, LyX does support embedded layout. But it's an Advanced Feature 
because it is somewhat dangerous, so it is not widely advertised. There 
is also, at the moment, no GUI for it.


Have a look at the file Customization.lyx in your favorite text editor. 
Some way down you will find these lines:


\begin_local_layout
Format 7
InsetLayout CharStyle:MenuItem
LyxType   charstyle
LabelString   menu
LatexType command
LatexName menuitem
Font
Family  Sans
EndFont
Preamble
\newcommand*{\menuitem}[1]{{\sffamily #1}}
EndPreamble
End
\end_local_layout

If you want to include local layout in your document, you can open it in 
a text editor and add similar lines. Make sure they are well tested 
first, and be real careful about the first and last line. Unpredictable 
things might happen otherwise.


I hope to add a GUI for this in the next LyX release (now looking like 
1.7). I'd be really, really happy if someone else wanted to jump in and 
do it. It should actually be quite easy. (More or less just copy the GUI 
for the preamble.)


Richard



Hi,

Wouldn't it make sense to have some option somewhere to include external 
modules to the .lyx file this way? I mean, the ones that are included at 
present from the GUI.


Best regards,

Olivier





Re: help - some questions

2009-08-23 Thread rgheck

On 08/23/2009 05:49 AM, Olivier Ripoll wrote:

rgheck wrote:

On 08/21/2009 06:08 AM, Sam Liddicott wrote:

* Olivier Ripoll wrote, On 21/08/09 10:29:

Sam Liddicott wrote:

(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)

Isn't that what layout modules are for ?

Sure, but as you can't embed a layout module in the lyx document, ERT
can sometimes be easier and more portable, and for small chunks of text
is already clearly delineated in the Lyx document by the red box.

Actually, LyX does support embedded layout. But it's an Advanced 
Feature because it is somewhat dangerous, so it is not widely 
advertised. There is also, at the moment, no GUI for it.


Have a look at the file Customization.lyx in your favorite text 
editor. Some way down you will find these lines:


\begin_local_layout
Format 7
InsetLayout CharStyle:MenuItem
LyxType   charstyle
LabelString   menu
LatexType command
LatexName menuitem
Font
Family  Sans
EndFont
Preamble
\newcommand*{\menuitem}[1]{{\sffamily #1}}
EndPreamble
End
\end_local_layout

If you want to include local layout in your document, you can open it 
in a text editor and add similar lines. Make sure they are well 
tested first, and be real careful about the first and last line. 
Unpredictable things might happen otherwise.


I hope to add a GUI for this in the next LyX release (now looking 
like 1.7). I'd be really, really happy if someone else wanted to jump 
in and do it. It should actually be quite easy. (More or less just 
copy the GUI for the preamble.)


Richard



Hi,

Wouldn't it make sense to have some option somewhere to include 
external modules to the .lyx file this way? I mean, the ones that are 
included at present from the GUI.


Do you mean an option to embed the content of the external module as 
local layout?


rh



Re: help - some questions

2009-08-21 Thread Sam Liddicott
* Ricardo Perrone wrote, On 21/08/09 04:05:
 Hi,
 
 I need a little help with some questions:

I've thought of such things from time to time, and concluded that the
style authors have more knowledge of typesetting than I do, and that my
opinion of more appropriate space probably enjoys less acceptance than
their opinion.

However there is a case to make for being able to change it... you just
first need to ask yourself if you are sure that you know better than the
class designers. If you decision is based purely on it's too wide then
you probably don't know better and you should leave it alone.

 1- Lyx has some default font size like Normal, small, smallest, etc. But how 
 can I change it to a specific font size to be applied in some places of my 
 document? For instance 10.5pt.

Font sizes in Lyx and Latex are given names:
http://www.image.ufl.edu/help/latex/fonts.shtml

So first you need to think if you literally want 10.5pt or if you want
to set the size of one of the name styles or sizes to 10.5pt.

You can mess with tie \fontsize{}{} command; insert this in your pre-amble:

\newcommand\sizetf[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}

then you can use the command

\sizetf{I'm in 10.5pt}

in ERT in your document.

(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)


 2- I am using enumerate environment, but it adds a large space between the 
 paragraph and the first item of environment. Is there a way to change it to a 
 more appropriated space? I am using book.cls template.

You probably want to read this:
http://tkcs-collins.com/truman/latex/list_examp.shtml

And you may find it easier to use these if you define a lyx .module file
to go with them. Look at existing lyx module files to work this out, and
install your own in ~/.lyx/layouts

Sam


Re: help - some questions

2009-08-21 Thread Olivier Ripoll

Sam Liddicott wrote:

* Ricardo Perrone wrote, On 21/08/09 04:05:

Hi,


[...]


You can mess with tie \fontsize{}{} command; insert this in your pre-amble:

\newcommand\sizetf[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}

then you can use the command

\sizetf{I'm in 10.5pt}

in ERT in your document.

(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)


Isn't that what layout modules are for ? Something like the following 
seems to work fine (I set the aspect to green in LyX to clearly 
differentiate from the normal text):


InsetLayout CharStyle:FontSize10.5
LyxType   charstyle
LabelString   FontSize10.5
LatexType command
LatexName SizeTenPointFive
Font
  Color   green
  Sizenormal
EndFont
Preamble

\newcommand\SizeTenPointFive[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}
EndPreamble
End


I attach an example module with font sizes from 8 to 12.5 with step 0.5. 
It works fine for me on 1.6.3. Once it is copied to the layout folder 
(*), you reconfigure, close  reopen lyx, and add the Font Size Styles 
module in the Document-Settings, Modules tab. Apply and you 
automatically have those styles in Edit-Text Styles or better, in the 
right-click contextual menu.


However, I do not encourage the use of font size this way. Better is to 
use logical styles.


Best regards,

Olivier

(*) On windows, it is
C:\Documents and Settings\###?\Application Data\lyx16\layouts
where ### is the user name
on linux, it should be in the home folder, in something like .lyx16/layouts

#\DeclareLyXModule{Font Size Styles}
#DescriptionBegin
#Custom font sizes.
#DescriptionEnd

# Author : ORi (based on code by Sam Liddicott)

Format 11

InsetLayout CharStyle:FontSize8
LyxType   charstyle
LabelString   FontSize8
LatexType command
LatexName SizeEight
Font
  Color   green
  Sizesmall
EndFont
Preamble

\newcommand\SizeEight[1]{\begingroup\fontsize{8}{9.5}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize8.5
LyxType   charstyle
LabelString   FontSize8.5
LatexType command
LatexName SizeEightPointFive
Font
  Color   green
  Sizesmall
EndFont
Preamble

\newcommand\SizeEightPointFive[1]{\begingroup\fontsize{8.5}{10}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize9
LyxType   charstyle
LabelString   FontSize9
LatexType command
LatexName SizeNine
Font
  Color   green
  Sizesmall
EndFont
Preamble

\newcommand\SizeNine[1]{\begingroup\fontsize{9}{10.5}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize9.5
LyxType   charstyle
LabelString   FontSize9.5
LatexType command
LatexName SizeNinePointFive
Font
  Color   green
  Sizesmall
EndFont
Preamble

\newcommand\SizeNinePointFive[1]{\begingroup\fontsize{9.5}{11}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize10
LyxType   charstyle
LabelString   FontSize10
LatexType command
LatexName SizeTen
Font
  Color   green
  Sizenormal
EndFont
Preamble

\newcommand\SizeTen[1]{\begingroup\fontsize{10}{11.5}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize10.5
LyxType   charstyle
LabelString   FontSize10.5
LatexType command
LatexName SizeTenPointFive
Font
  Color   green
  Sizenormal
EndFont
Preamble

\newcommand\SizeTenPointFive[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize11
LyxType   charstyle
LabelString   FontSize11
LatexType command
LatexName SizeEleven
Font
  Color   green
  Sizenormal
EndFont
Preamble

\newcommand\SizeEleven[1]{\begingroup\fontsize{11}{13}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize11.5

Re: help - some questions

2009-08-21 Thread Sam Liddicott
* Olivier Ripoll wrote, On 21/08/09 10:29:
 Sam Liddicott wrote:
 * Ricardo Perrone wrote, On 21/08/09 04:05:
 Hi,

 [...]
 
 You can mess with tie \fontsize{}{} command; insert this in your
 pre-amble:

 \newcommand\sizetf[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}


 then you can use the command

 \sizetf{I'm in 10.5pt}

 in ERT in your document.

 (I wish Lyx supported adding per-document layouts and elements in the
 same way that it supports adding Latex commands in the preamble)
 
 Isn't that what layout modules are for ? 

Sure, but as you can't embed a layout module in the lyx document, ERT
can sometimes be easier and more portable, and for small chunks of text
is already clearly delineated in the Lyx document by the red box.

(I suggested a layout module for his enums, it would be nuts to do those
with ERT)

And thanks for providing the examples that I was too lazy to provide..

Sam


Re: help - some questions

2009-08-21 Thread Olivier Ripoll

Sam Liddicott wrote:

* Olivier Ripoll wrote, On 21/08/09 10:29:

Sam Liddicott wrote:

* Ricardo Perrone wrote, On 21/08/09 04:05:

Hi,


[...]


You can mess with tie \fontsize{}{} command; insert this in your
pre-amble:

\newcommand\sizetf[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}


then you can use the command

\sizetf{I'm in 10.5pt}

in ERT in your document.

(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)
Isn't that what layout modules are for ? 


Sure, but as you can't embed a layout module in the lyx document, ERT
can sometimes be easier and more portable, and for small chunks of text
is already clearly delineated in the Lyx document by the red box.


Okay, I see what you meant now. Hopefully, the layout modules will be 
somehow integrated in the embedded format, when it is available.



(I suggested a layout module for his enums, it would be nuts to do those
with ERT)

And thanks for providing the examples that I was too lazy to provide..


It was a good challenge for me, and I learnt a lot: it seems latex 
command names cannot contain numbers nor . or _ characters. I had to 
go for the ugly number in full letters way. I also learnt the LyX font 
size this way (no numbers).


This illustrates the big 'drawback' of LyX: After ~8 years using LyX, 
writing a Thesis and several documents, I haven't learnt much of LaTeX 
because LyX does all for me. LyX encourages laziness !


Regards,

Olivier



Re: help - some questions

2009-08-21 Thread Steve Litt
On Thursday 20 August 2009 23:05:20 Ricardo Perrone wrote:
 Hi,

 2- I am using enumerate environment, but
 it adds a large space between the paragraph and the first item of
 environment. Is there a way to change it to a more appropriated space? I am
 using book.cls template.

Hi Ricardo,

The following comes right out of my layout file, which is based on book.cls:

% ### MyEnumerate: Vertically denser version of Enumerate style ###
\newenvironment{myenumerateL}{%
~\\[-1.2\baselineskip]
\begin{enumerate}%
\setlength{\parsep}{-2pt}
\setlength{\parskip}{-2pt}
\setlength{\partopsep}{-3pt}
\setstretch{0.7}
}{
\end{enumerate}
~\\[-0.5\baselineskip]
}

The preceding's main effect is to space all list items closer to each other, 
but the top ~\\[-1.2\baselineskip] controls the distance of the list to the 
preceding paragraph.

I chose to make a brand new environment, but you could have just as easily 
done it in place like this:

\let\oldenumerate\enumerate
\let\oldendenumerate\endenumerate

And then oldenumerate in the begin and end.

HTH

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt




Re: help - some questions

2009-08-21 Thread rgheck

On 08/21/2009 06:08 AM, Sam Liddicott wrote:

* Olivier Ripoll wrote, On 21/08/09 10:29:
   

Sam Liddicott wrote:
 

(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)
   

Isn't that what layout modules are for ?
 

Sure, but as you can't embed a layout module in the lyx document, ERT
can sometimes be easier and more portable, and for small chunks of text
is already clearly delineated in the Lyx document by the red box.

   
Actually, LyX does support embedded layout. But it's an Advanced Feature 
because it is somewhat dangerous, so it is not widely advertised. There 
is also, at the moment, no GUI for it.


Have a look at the file Customization.lyx in your favorite text editor. 
Some way down you will find these lines:


\begin_local_layout
Format 7
InsetLayout CharStyle:MenuItem
LyxType   charstyle
LabelString   menu
LatexType command
LatexName menuitem
Font
Family  Sans
EndFont
Preamble
\newcommand*{\menuitem}[1]{{\sffamily #1}}
EndPreamble
End
\end_local_layout

If you want to include local layout in your document, you can open it in 
a text editor and add similar lines. Make sure they are well tested 
first, and be real careful about the first and last line. Unpredictable 
things might happen otherwise.


I hope to add a GUI for this in the next LyX release (now looking like 
1.7). I'd be really, really happy if someone else wanted to jump in and 
do it. It should actually be quite easy. (More or less just copy the GUI 
for the preamble.)


Richard



Re: help - some questions

2009-08-21 Thread Guenter Milde
On 2009-08-21, Sam Liddicott wrote:
 * Ricardo Perrone wrote, On 21/08/09 04:05:

 2- I am using enumerate environment, but it adds a large space between
 the paragraph and the first item of environment. Is there a way to
 change it to a more appropriated space? I am using book.cls template.

 You probably want to read this:
 http://tkcs-collins.com/truman/latex/list_examp.shtml

 And you may find it easier to use these if you define a lyx .module file
 to go with them. Look at existing lyx module files to work this out, and
 install your own in ~/.lyx/layouts

There is a module for list styling, search wiki.lyx.org for 'enumitem'::

#\DeclareLyXModule[enumitem.sty]{Customisable Lists (enumitem)}
#DescriptionBegin
# Control the layout of enumerate, itemize and description
# with an optional argument.
# See http://dante.ctan.org/CTAN/macros/latex/contrib/enumitem/enumitem.pdf
#DescriptionEnd


Günter



Re: help - some questions

2009-08-21 Thread Sam Liddicott
* Ricardo Perrone wrote, On 21/08/09 04:05:
 Hi,
 
 I need a little help with some questions:

I've thought of such things from time to time, and concluded that the
style authors have more knowledge of typesetting than I do, and that my
opinion of more appropriate space probably enjoys less acceptance than
their opinion.

However there is a case to make for being able to change it... you just
first need to ask yourself if you are sure that you know better than the
class designers. If you decision is based purely on it's too wide then
you probably don't know better and you should leave it alone.

 1- Lyx has some default font size like Normal, small, smallest, etc. But how 
 can I change it to a specific font size to be applied in some places of my 
 document? For instance 10.5pt.

Font sizes in Lyx and Latex are given names:
http://www.image.ufl.edu/help/latex/fonts.shtml

So first you need to think if you literally want 10.5pt or if you want
to set the size of one of the name styles or sizes to 10.5pt.

You can mess with tie \fontsize{}{} command; insert this in your pre-amble:

\newcommand\sizetf[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}

then you can use the command

\sizetf{I'm in 10.5pt}

in ERT in your document.

(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)


 2- I am using enumerate environment, but it adds a large space between the 
 paragraph and the first item of environment. Is there a way to change it to a 
 more appropriated space? I am using book.cls template.

You probably want to read this:
http://tkcs-collins.com/truman/latex/list_examp.shtml

And you may find it easier to use these if you define a lyx .module file
to go with them. Look at existing lyx module files to work this out, and
install your own in ~/.lyx/layouts

Sam


Re: help - some questions

2009-08-21 Thread Olivier Ripoll

Sam Liddicott wrote:

* Ricardo Perrone wrote, On 21/08/09 04:05:

Hi,


[...]


You can mess with tie \fontsize{}{} command; insert this in your pre-amble:

\newcommand\sizetf[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}

then you can use the command

\sizetf{I'm in 10.5pt}

in ERT in your document.

(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)


Isn't that what layout modules are for ? Something like the following 
seems to work fine (I set the aspect to green in LyX to clearly 
differentiate from the normal text):


InsetLayout CharStyle:FontSize10.5
LyxType   charstyle
LabelString   FontSize10.5
LatexType command
LatexName SizeTenPointFive
Font
  Color   green
  Sizenormal
EndFont
Preamble

\newcommand\SizeTenPointFive[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}
EndPreamble
End


I attach an example module with font sizes from 8 to 12.5 with step 0.5. 
It works fine for me on 1.6.3. Once it is copied to the layout folder 
(*), you reconfigure, close  reopen lyx, and add the Font Size Styles 
module in the Document-Settings, Modules tab. Apply and you 
automatically have those styles in Edit-Text Styles or better, in the 
right-click contextual menu.


However, I do not encourage the use of font size this way. Better is to 
use logical styles.


Best regards,

Olivier

(*) On windows, it is
C:\Documents and Settings\###?\Application Data\lyx16\layouts
where ### is the user name
on linux, it should be in the home folder, in something like .lyx16/layouts

#\DeclareLyXModule{Font Size Styles}
#DescriptionBegin
#Custom font sizes.
#DescriptionEnd

# Author : ORi (based on code by Sam Liddicott)

Format 11

InsetLayout CharStyle:FontSize8
LyxType   charstyle
LabelString   FontSize8
LatexType command
LatexName SizeEight
Font
  Color   green
  Sizesmall
EndFont
Preamble

\newcommand\SizeEight[1]{\begingroup\fontsize{8}{9.5}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize8.5
LyxType   charstyle
LabelString   FontSize8.5
LatexType command
LatexName SizeEightPointFive
Font
  Color   green
  Sizesmall
EndFont
Preamble

\newcommand\SizeEightPointFive[1]{\begingroup\fontsize{8.5}{10}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize9
LyxType   charstyle
LabelString   FontSize9
LatexType command
LatexName SizeNine
Font
  Color   green
  Sizesmall
EndFont
Preamble

\newcommand\SizeNine[1]{\begingroup\fontsize{9}{10.5}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize9.5
LyxType   charstyle
LabelString   FontSize9.5
LatexType command
LatexName SizeNinePointFive
Font
  Color   green
  Sizesmall
EndFont
Preamble

\newcommand\SizeNinePointFive[1]{\begingroup\fontsize{9.5}{11}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize10
LyxType   charstyle
LabelString   FontSize10
LatexType command
LatexName SizeTen
Font
  Color   green
  Sizenormal
EndFont
Preamble

\newcommand\SizeTen[1]{\begingroup\fontsize{10}{11.5}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize10.5
LyxType   charstyle
LabelString   FontSize10.5
LatexType command
LatexName SizeTenPointFive
Font
  Color   green
  Sizenormal
EndFont
Preamble

\newcommand\SizeTenPointFive[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize11
LyxType   charstyle
LabelString   FontSize11
LatexType command
LatexName SizeEleven
Font
  Color   green
  Sizenormal
EndFont
Preamble

\newcommand\SizeEleven[1]{\begingroup\fontsize{11}{13}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize11.5

Re: help - some questions

2009-08-21 Thread Sam Liddicott
* Olivier Ripoll wrote, On 21/08/09 10:29:
 Sam Liddicott wrote:
 * Ricardo Perrone wrote, On 21/08/09 04:05:
 Hi,

 [...]
 
 You can mess with tie \fontsize{}{} command; insert this in your
 pre-amble:

 \newcommand\sizetf[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}


 then you can use the command

 \sizetf{I'm in 10.5pt}

 in ERT in your document.

 (I wish Lyx supported adding per-document layouts and elements in the
 same way that it supports adding Latex commands in the preamble)
 
 Isn't that what layout modules are for ? 

Sure, but as you can't embed a layout module in the lyx document, ERT
can sometimes be easier and more portable, and for small chunks of text
is already clearly delineated in the Lyx document by the red box.

(I suggested a layout module for his enums, it would be nuts to do those
with ERT)

And thanks for providing the examples that I was too lazy to provide..

Sam


Re: help - some questions

2009-08-21 Thread Olivier Ripoll

Sam Liddicott wrote:

* Olivier Ripoll wrote, On 21/08/09 10:29:

Sam Liddicott wrote:

* Ricardo Perrone wrote, On 21/08/09 04:05:

Hi,


[...]


You can mess with tie \fontsize{}{} command; insert this in your
pre-amble:

\newcommand\sizetf[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}


then you can use the command

\sizetf{I'm in 10.5pt}

in ERT in your document.

(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)
Isn't that what layout modules are for ? 


Sure, but as you can't embed a layout module in the lyx document, ERT
can sometimes be easier and more portable, and for small chunks of text
is already clearly delineated in the Lyx document by the red box.


Okay, I see what you meant now. Hopefully, the layout modules will be 
somehow integrated in the embedded format, when it is available.



(I suggested a layout module for his enums, it would be nuts to do those
with ERT)

And thanks for providing the examples that I was too lazy to provide..


It was a good challenge for me, and I learnt a lot: it seems latex 
command names cannot contain numbers nor . or _ characters. I had to 
go for the ugly number in full letters way. I also learnt the LyX font 
size this way (no numbers).


This illustrates the big 'drawback' of LyX: After ~8 years using LyX, 
writing a Thesis and several documents, I haven't learnt much of LaTeX 
because LyX does all for me. LyX encourages laziness !


Regards,

Olivier



Re: help - some questions

2009-08-21 Thread Steve Litt
On Thursday 20 August 2009 23:05:20 Ricardo Perrone wrote:
 Hi,

 2- I am using enumerate environment, but
 it adds a large space between the paragraph and the first item of
 environment. Is there a way to change it to a more appropriated space? I am
 using book.cls template.

Hi Ricardo,

The following comes right out of my layout file, which is based on book.cls:

% ### MyEnumerate: Vertically denser version of Enumerate style ###
\newenvironment{myenumerateL}{%
~\\[-1.2\baselineskip]
\begin{enumerate}%
\setlength{\parsep}{-2pt}
\setlength{\parskip}{-2pt}
\setlength{\partopsep}{-3pt}
\setstretch{0.7}
}{
\end{enumerate}
~\\[-0.5\baselineskip]
}

The preceding's main effect is to space all list items closer to each other, 
but the top ~\\[-1.2\baselineskip] controls the distance of the list to the 
preceding paragraph.

I chose to make a brand new environment, but you could have just as easily 
done it in place like this:

\let\oldenumerate\enumerate
\let\oldendenumerate\endenumerate

And then oldenumerate in the begin and end.

HTH

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt




Re: help - some questions

2009-08-21 Thread rgheck

On 08/21/2009 06:08 AM, Sam Liddicott wrote:

* Olivier Ripoll wrote, On 21/08/09 10:29:
   

Sam Liddicott wrote:
 

(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)
   

Isn't that what layout modules are for ?
 

Sure, but as you can't embed a layout module in the lyx document, ERT
can sometimes be easier and more portable, and for small chunks of text
is already clearly delineated in the Lyx document by the red box.

   
Actually, LyX does support embedded layout. But it's an Advanced Feature 
because it is somewhat dangerous, so it is not widely advertised. There 
is also, at the moment, no GUI for it.


Have a look at the file Customization.lyx in your favorite text editor. 
Some way down you will find these lines:


\begin_local_layout
Format 7
InsetLayout CharStyle:MenuItem
LyxType   charstyle
LabelString   menu
LatexType command
LatexName menuitem
Font
Family  Sans
EndFont
Preamble
\newcommand*{\menuitem}[1]{{\sffamily #1}}
EndPreamble
End
\end_local_layout

If you want to include local layout in your document, you can open it in 
a text editor and add similar lines. Make sure they are well tested 
first, and be real careful about the first and last line. Unpredictable 
things might happen otherwise.


I hope to add a GUI for this in the next LyX release (now looking like 
1.7). I'd be really, really happy if someone else wanted to jump in and 
do it. It should actually be quite easy. (More or less just copy the GUI 
for the preamble.)


Richard



Re: help - some questions

2009-08-21 Thread Guenter Milde
On 2009-08-21, Sam Liddicott wrote:
 * Ricardo Perrone wrote, On 21/08/09 04:05:

 2- I am using enumerate environment, but it adds a large space between
 the paragraph and the first item of environment. Is there a way to
 change it to a more appropriated space? I am using book.cls template.

 You probably want to read this:
 http://tkcs-collins.com/truman/latex/list_examp.shtml

 And you may find it easier to use these if you define a lyx .module file
 to go with them. Look at existing lyx module files to work this out, and
 install your own in ~/.lyx/layouts

There is a module for list styling, search wiki.lyx.org for 'enumitem'::

#\DeclareLyXModule[enumitem.sty]{Customisable Lists (enumitem)}
#DescriptionBegin
# Control the layout of enumerate, itemize and description
# with an optional argument.
# See http://dante.ctan.org/CTAN/macros/latex/contrib/enumitem/enumitem.pdf
#DescriptionEnd


Günter



Re: help - some questions

2009-08-21 Thread Sam Liddicott
* Ricardo Perrone wrote, On 21/08/09 04:05:
> Hi,
> 
> I need a little help with some questions:

I've thought of such things from time to time, and concluded that the
style authors have more knowledge of typesetting than I do, and that my
opinion of "more appropriate space" probably enjoys less acceptance than
their opinion.

However there is a case to make for being able to change it... you just
first need to ask yourself if you are sure that you know better than the
class designers. If you decision is based purely on "it's too wide" then
you probably don't know better and you should leave it alone.

> 1- Lyx has some default font size like Normal, small, smallest, etc. But how 
> can I change it to a specific font size to be applied in some places of my 
> document? For instance 10.5pt.

Font sizes in Lyx and Latex are given names:
http://www.image.ufl.edu/help/latex/fonts.shtml

So first you need to think if you literally want "10.5pt" or if you want
to set the size of one of the name styles or sizes to 10.5pt.

You can mess with tie \fontsize{}{} command; insert this in your pre-amble:

\newcommand\sizetf[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}

then you can use the command

\sizetf{I'm in 10.5pt}

in ERT in your document.

(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)


> 2- I am using enumerate environment, but it adds a large space between the 
> paragraph and the first item of environment. Is there a way to change it to a 
> more appropriated space? I am using book.cls template.

You probably want to read this:
http://tkcs-collins.com/truman/latex/list_examp.shtml

And you may find it easier to use these if you define a lyx .module file
to go with them. Look at existing lyx module files to work this out, and
install your own in ~/.lyx/layouts

Sam


Re: help - some questions

2009-08-21 Thread Olivier Ripoll

Sam Liddicott wrote:

* Ricardo Perrone wrote, On 21/08/09 04:05:

Hi,


[...]


You can mess with tie \fontsize{}{} command; insert this in your pre-amble:

\newcommand\sizetf[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}

then you can use the command

\sizetf{I'm in 10.5pt}

in ERT in your document.

(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)


Isn't that what layout modules are for ? Something like the following 
seems to work fine (I set the aspect to green in LyX to clearly 
differentiate from the normal text):


InsetLayout CharStyle:FontSize10.5
LyxType   charstyle
LabelString   FontSize10.5
LatexType command
LatexName SizeTenPointFive
Font
  Color   green
  Sizenormal
EndFont
Preamble

\newcommand\SizeTenPointFive[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}
EndPreamble
End


I attach an example module with font sizes from 8 to 12.5 with step 0.5. 
It works fine for me on 1.6.3. Once it is copied to the layout folder 
(*), you reconfigure, close & reopen lyx, and add the "Font Size Styles" 
module in the Document->Settings, "Modules" tab. Apply and you 
automatically have those styles in "Edit->Text Styles" or better, in the 
right-click contextual menu.


However, I do not encourage the use of font size this way. Better is to 
use logical styles.


Best regards,

Olivier

(*) On windows, it is
C:\Documents and Settings\###?\Application Data\lyx16\layouts
where ### is the user name
on linux, it should be in the home folder, in something like .lyx16/layouts

#\DeclareLyXModule{Font Size Styles}
#DescriptionBegin
#Custom font sizes.
#DescriptionEnd

# Author : ORi (based on code by Sam Liddicott)

Format 11

InsetLayout CharStyle:FontSize8
LyxType   charstyle
LabelString   FontSize8
LatexType command
LatexName SizeEight
Font
  Color   green
  Sizesmall
EndFont
Preamble

\newcommand\SizeEight[1]{\begingroup\fontsize{8}{9.5}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize8.5
LyxType   charstyle
LabelString   FontSize8.5
LatexType command
LatexName SizeEightPointFive
Font
  Color   green
  Sizesmall
EndFont
Preamble

\newcommand\SizeEightPointFive[1]{\begingroup\fontsize{8.5}{10}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize9
LyxType   charstyle
LabelString   FontSize9
LatexType command
LatexName SizeNine
Font
  Color   green
  Sizesmall
EndFont
Preamble

\newcommand\SizeNine[1]{\begingroup\fontsize{9}{10.5}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize9.5
LyxType   charstyle
LabelString   FontSize9.5
LatexType command
LatexName SizeNinePointFive
Font
  Color   green
  Sizesmall
EndFont
Preamble

\newcommand\SizeNinePointFive[1]{\begingroup\fontsize{9.5}{11}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize10
LyxType   charstyle
LabelString   FontSize10
LatexType command
LatexName SizeTen
Font
  Color   green
  Sizenormal
EndFont
Preamble

\newcommand\SizeTen[1]{\begingroup\fontsize{10}{11.5}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize10.5
LyxType   charstyle
LabelString   FontSize10.5
LatexType command
LatexName SizeTenPointFive
Font
  Color   green
  Sizenormal
EndFont
Preamble

\newcommand\SizeTenPointFive[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout CharStyle:FontSize11
LyxType   charstyle
LabelString   FontSize11
LatexType command
LatexName SizeEleven
Font
  Color   green
  Sizenormal
EndFont
Preamble

\newcommand\SizeEleven[1]{\begingroup\fontsize{11}{13}\selectfont{#1}\endgroup}
EndPreamble
End

InsetLayout 

Re: help - some questions

2009-08-21 Thread Sam Liddicott
* Olivier Ripoll wrote, On 21/08/09 10:29:
> Sam Liddicott wrote:
>> * Ricardo Perrone wrote, On 21/08/09 04:05:
>>> Hi,
>>>
> [...]
> 
>> You can mess with tie \fontsize{}{} command; insert this in your
>> pre-amble:
>>
>> \newcommand\sizetf[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}
>>
>>
>> then you can use the command
>>
>> \sizetf{I'm in 10.5pt}
>>
>> in ERT in your document.
>>
>> (I wish Lyx supported adding per-document layouts and elements in the
>> same way that it supports adding Latex commands in the preamble)
> 
> Isn't that what layout modules are for ? 

Sure, but as you can't embed a layout module in the lyx document, ERT
can sometimes be easier and more portable, and for small chunks of text
is already clearly delineated in the Lyx document by the red box.

(I suggested a layout module for his enums, it would be nuts to do those
with ERT)

And thanks for providing the examples that I was too lazy to provide..

Sam


Re: help - some questions

2009-08-21 Thread Olivier Ripoll

Sam Liddicott wrote:

* Olivier Ripoll wrote, On 21/08/09 10:29:

Sam Liddicott wrote:

* Ricardo Perrone wrote, On 21/08/09 04:05:

Hi,


[...]


You can mess with tie \fontsize{}{} command; insert this in your
pre-amble:

\newcommand\sizetf[1]{\begingroup\fontsize{10.5}{12}\selectfont{#1}\endgroup}


then you can use the command

\sizetf{I'm in 10.5pt}

in ERT in your document.

(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)
Isn't that what layout modules are for ? 


Sure, but as you can't embed a layout module in the lyx document, ERT
can sometimes be easier and more portable, and for small chunks of text
is already clearly delineated in the Lyx document by the red box.


Okay, I see what you meant now. Hopefully, the layout modules will be 
somehow integrated in the "embedded" format, when it is available.



(I suggested a layout module for his enums, it would be nuts to do those
with ERT)

And thanks for providing the examples that I was too lazy to provide..


It was a good "challenge" for me, and I learnt a lot: it seems latex 
command names cannot contain numbers nor "." or "_" characters. I had to 
go for the ugly "number in full letters" way. I also learnt the LyX font 
size this way (no numbers).


This illustrates the big 'drawback' of LyX: After ~8 years using LyX, 
writing a Thesis and several documents, I haven't learnt much of LaTeX 
because LyX does all for me. LyX encourages laziness !


Regards,

Olivier



Re: help - some questions

2009-08-21 Thread Steve Litt
On Thursday 20 August 2009 23:05:20 Ricardo Perrone wrote:
> Hi,
>
> 2- I am using enumerate environment, but
> it adds a large space between the paragraph and the first item of
> environment. Is there a way to change it to a more appropriated space? I am
> using book.cls template.

Hi Ricardo,

The following comes right out of my layout file, which is based on book.cls:

% ### MyEnumerate: Vertically denser version of Enumerate style ###
\newenvironment{myenumerateL}{%
~\\[-1.2\baselineskip]
\begin{enumerate}%
\setlength{\parsep}{-2pt}
\setlength{\parskip}{-2pt}
\setlength{\partopsep}{-3pt}
\setstretch{0.7}
}{
\end{enumerate}
~\\[-0.5\baselineskip]
}

The preceding's main effect is to space all list items closer to each other, 
but the top "~\\[-1.2\baselineskip]" controls the distance of the list to the 
preceding paragraph.

I chose to make a brand new environment, but you could have just as easily 
done it in place like this:

\let\oldenumerate\enumerate
\let\oldendenumerate\endenumerate

And then oldenumerate in the begin and end.

HTH

SteveT

Steve Litt
Recession Relief Package
http://www.recession-relief.US
Twitter: http://www.twitter.com/stevelitt




Re: help - some questions

2009-08-21 Thread rgheck

On 08/21/2009 06:08 AM, Sam Liddicott wrote:

* Olivier Ripoll wrote, On 21/08/09 10:29:
   

Sam Liddicott wrote:
 

(I wish Lyx supported adding per-document layouts and elements in the
same way that it supports adding Latex commands in the preamble)
   

Isn't that what layout modules are for ?
 

Sure, but as you can't embed a layout module in the lyx document, ERT
can sometimes be easier and more portable, and for small chunks of text
is already clearly delineated in the Lyx document by the red box.

   
Actually, LyX does support embedded layout. But it's an Advanced Feature 
because it is somewhat dangerous, so it is not widely advertised. There 
is also, at the moment, no GUI for it.


Have a look at the file Customization.lyx in your favorite text editor. 
Some way down you will find these lines:


\begin_local_layout
Format 7
InsetLayout CharStyle:MenuItem
LyxType   charstyle
LabelString   menu
LatexType command
LatexName menuitem
Font
Family  Sans
EndFont
Preamble
\newcommand*{\menuitem}[1]{{\sffamily #1}}
EndPreamble
End
\end_local_layout

If you want to include local layout in your document, you can open it in 
a text editor and add similar lines. Make sure they are well tested 
first, and be real careful about the first and last line. Unpredictable 
things might happen otherwise.


I hope to add a GUI for this in the next LyX release (now looking like 
1.7). I'd be really, really happy if someone else wanted to jump in and 
do it. It should actually be quite easy. (More or less just copy the GUI 
for the preamble.)


Richard



Re: help - some questions

2009-08-21 Thread Guenter Milde
On 2009-08-21, Sam Liddicott wrote:
> * Ricardo Perrone wrote, On 21/08/09 04:05:

>> 2- I am using enumerate environment, but it adds a large space between
>> the paragraph and the first item of environment. Is there a way to
>> change it to a more appropriated space? I am using book.cls template.

> You probably want to read this:
> http://tkcs-collins.com/truman/latex/list_examp.shtml

> And you may find it easier to use these if you define a lyx .module file
> to go with them. Look at existing lyx module files to work this out, and
> install your own in ~/.lyx/layouts

There is a module for list styling, search wiki.lyx.org for 'enumitem'::

#\DeclareLyXModule[enumitem.sty]{Customisable Lists (enumitem)}
#DescriptionBegin
# Control the layout of enumerate, itemize and description
# with an optional argument.
# See http://dante.ctan.org/CTAN/macros/latex/contrib/enumitem/enumitem.pdf
#DescriptionEnd


Günter



help - some questions

2009-08-20 Thread Ricardo Perrone
Hi,

I need a little help with some questions:
1- Lyx has some default font size like Normal, small, smallest, etc. But how 
can I change it to a specific font size to be applied in some places of my 
document? For instance 10.5pt.
2- I am using enumerate environment, but it adds a large space between the 
paragraph and the first item of environment. Is there a way to change it to a 
more appropriated space? I am using book.cls template.

Thanks a lot
Ricardo



  


help - some questions

2009-08-20 Thread Ricardo Perrone
Hi,

I need a little help with some questions:
1- Lyx has some default font size like Normal, small, smallest, etc. But how 
can I change it to a specific font size to be applied in some places of my 
document? For instance 10.5pt.
2- I am using enumerate environment, but it adds a large space between the 
paragraph and the first item of environment. Is there a way to change it to a 
more appropriated space? I am using book.cls template.

Thanks a lot
Ricardo



  


help - some questions

2009-08-20 Thread Ricardo Perrone
Hi,

I need a little help with some questions:
1- Lyx has some default font size like Normal, small, smallest, etc. But how 
can I change it to a specific font size to be applied in some places of my 
document? For instance 10.5pt.
2- I am using enumerate environment, but it adds a large space between the 
paragraph and the first item of environment. Is there a way to change it to a 
more appropriated space? I am using book.cls template.

Thanks a lot
Ricardo