Re: how to use custom character styles

2007-06-02 Thread Steve Litt
On Friday 01 June 2007 19:13, Hellmut Weber wrote:

 Here comes a modest example (charstyle.layout), it defines a char style
 to put some piece of a running text into a framed box.
 Note the second line which defines the 'Label' of the Document class!

 How to proceed:

 1) Put your layout file with the char style definition(s) in your local
 folder $HOME/.lyx/layouts
 (Suppose you put my example 'charstyle.layout' there)

 2) start lyx and reconfigure
 (Steve Litt indicateed recently how to do so from the command line, but
 i don't remember exactly how)


http://wiki.lyx.org/Tips/DebuggingLayoutFiles

SteveT


Re: how to use custom character styles

2007-06-02 Thread Richard Heck

Jeremy C. Reed wrote:

On Fri, 1 Jun 2007, Richard Heck wrote:

  

Look at the stdcharstyles.inc file, which you'll find in e.g. /usr/share/lyx/.
You'll need to define yours in a similar way (or use this one), and then
include the file in a custom layout file. This can be as simple as:
#% Do not delete the line below; configure depends on this
# \DeclareLaTeXClass[article.cls]{article (mine)}
Input article.cls
Input mycharstyles.inc
Put this in your user layout directory (e.g., /home/you/.lyx/layouts/),
reconfigure LyX, choose it, and you're off.

That had errors, so I just copied scrbook.layout to my ~/.lyx/layouts/ and 
added the line:


Input mycharstyles.inc

Is there any file that corresponds to stdcharstyles.inc that defines 
\newcommand{} for \filename and the others in that file? Or do I have to 
define all these myself?
  
LaTeX already defines \filename (or something does, on my system), so I 
have to use something else here. And the reason db_stdcharstyles.inc 
doesn't define any of this is that it's a layout for doing DocBook, not 
LaTeX, so yes, you'll have to define them yourself. You can do this in 
the layout file, using a construct like this:

CharStyle Filename
LatexType Command
LatexName fname
Font
Family Typewriter
EndFont
LabelFont
Family Roman
Color blue
EndFont
Preamble
\newcommand{\fname}[1]{\texttt{#1}}
EndPreamble
End

Richard


--
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: how to use custom character styles

2007-06-02 Thread Steve Litt
On Friday 01 June 2007 19:13, Hellmut Weber wrote:

 Here comes a modest example (charstyle.layout), it defines a char style
 to put some piece of a running text into a framed box.
 Note the second line which defines the 'Label' of the Document class!

 How to proceed:

 1) Put your layout file with the char style definition(s) in your local
 folder $HOME/.lyx/layouts
 (Suppose you put my example 'charstyle.layout' there)

 2) start lyx and reconfigure
 (Steve Litt indicateed recently how to do so from the command line, but
 i don't remember exactly how)


http://wiki.lyx.org/Tips/DebuggingLayoutFiles

SteveT


Re: how to use custom character styles

2007-06-02 Thread Richard Heck

Jeremy C. Reed wrote:

On Fri, 1 Jun 2007, Richard Heck wrote:

  

Look at the stdcharstyles.inc file, which you'll find in e.g. /usr/share/lyx/.
You'll need to define yours in a similar way (or use this one), and then
include the file in a custom layout file. This can be as simple as:
#% Do not delete the line below; configure depends on this
# \DeclareLaTeXClass[article.cls]{article (mine)}
Input article.cls
Input mycharstyles.inc
Put this in your user layout directory (e.g., /home/you/.lyx/layouts/),
reconfigure LyX, choose it, and you're off.

That had errors, so I just copied scrbook.layout to my ~/.lyx/layouts/ and 
added the line:


Input mycharstyles.inc

Is there any file that corresponds to stdcharstyles.inc that defines 
\newcommand{} for \filename and the others in that file? Or do I have to 
define all these myself?
  
LaTeX already defines \filename (or something does, on my system), so I 
have to use something else here. And the reason db_stdcharstyles.inc 
doesn't define any of this is that it's a layout for doing DocBook, not 
LaTeX, so yes, you'll have to define them yourself. You can do this in 
the layout file, using a construct like this:

CharStyle Filename
LatexType Command
LatexName fname
Font
Family Typewriter
EndFont
LabelFont
Family Roman
Color blue
EndFont
Preamble
\newcommand{\fname}[1]{\texttt{#1}}
EndPreamble
End

Richard


--
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: how to use custom character styles

2007-06-02 Thread Steve Litt
On Friday 01 June 2007 19:13, Hellmut Weber wrote:

> Here comes a modest example (charstyle.layout), it defines a char style
> to put some piece of a running text into a framed box.
> Note the second line which defines the 'Label' of the Document class!
>
> How to proceed:
>
> 1) Put your layout file with the char style definition(s) in your local
> folder $HOME/.lyx/layouts
> (Suppose you put my example 'charstyle.layout' there)
>
> 2) start lyx and reconfigure
> (Steve Litt indicateed recently how to do so from the command line, but
> i don't remember exactly how)


http://wiki.lyx.org/Tips/DebuggingLayoutFiles

SteveT


Re: how to use custom character styles

2007-06-02 Thread Richard Heck

Jeremy C. Reed wrote:

On Fri, 1 Jun 2007, Richard Heck wrote:

  

Look at the stdcharstyles.inc file, which you'll find in e.g. /usr/share/lyx/.
You'll need to define yours in a similar way (or use this one), and then
include the file in a custom layout file. This can be as simple as:
#% Do not delete the line below; configure depends on this
# \DeclareLaTeXClass[article.cls]{article (mine)}
Input article.cls
Input mycharstyles.inc
Put this in your user layout directory (e.g., /home/you/.lyx/layouts/),
reconfigure LyX, choose it, and you're off.

That had errors, so I just copied scrbook.layout to my ~/.lyx/layouts/ and 
added the line:


Input mycharstyles.inc

Is there any file that corresponds to stdcharstyles.inc that defines 
\newcommand{} for \filename and the others in that file? Or do I have to 
define all these myself?
  
LaTeX already defines \filename (or something does, on my system), so I 
have to use something else here. And the reason db_stdcharstyles.inc 
doesn't define any of this is that it's a layout for doing DocBook, not 
LaTeX, so yes, you'll have to define them yourself. You can do this in 
the layout file, using a construct like this:

CharStyle Filename
LatexType Command
LatexName fname
Font
Family Typewriter
EndFont
LabelFont
Family Roman
Color blue
EndFont
Preamble
\newcommand{\fname}[1]{\texttt{#1}}
EndPreamble
End

Richard


--
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: how to use custom character styles

2007-06-01 Thread Richard Heck

Jeremy C. Reed wrote:
I have a 180+ page book with many (probably over 500) character 
formattings.


I want to have styles defined for:

filenames
command names
command line options
configuration options
command output (I just use lyxcode for that)
command input
etc..

Currently I am just using stuff like typewriter, italics (or emphasis), 
bold, ... but whenever I want to try something different I will have to 
change hundreds of things. So I want to be able to identify something as a 
filename or command for example.


Any examples?
  
Look at the stdcharstyles.inc file, which you'll find in e.g. 
/usr/share/lyx/. You'll need to define yours in a similar way (or use 
this one), and then include the file in a custom layout file. This can 
be as simple as:

#% Do not delete the line below; configure depends on this
# \DeclareLaTeXClass[article.cls]{article (mine)}
Input article.cls
Input mycharstyles.inc
Put this in your user layout directory (e.g., /home/you/.lyx/layouts/), 
reconfigure LyX, choose it, and you're off.



Or why does Google have Playground indexed if it is a practice sandbox?

Because Google's search bots aren't yet perfect.

Richard

--
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: how to use custom character styles

2007-06-01 Thread Steve Litt
On Friday 01 June 2007 13:34, Jeremy C. Reed wrote:
 I have a 180+ page book with many (probably over 500) character
 formattings.

 I want to have styles defined for:

 filenames
 command names
 command line options
 configuration options
 command output (I just use lyxcode for that)
 command input
 etc..

 Currently I am just using stuff like typewriter, italics (or emphasis),
 bold, ... but whenever I want to try something different I will have to
 change hundreds of things. So I want to be able to identify something as a
 filename or command for example.

Hi Jeremy,

You're right that things like filenames and command names should never be 
formatted with generic stuff like typewriter, emphesis and bold. You're right 
that the correct way is to use character styles. I'm going to tell you the 
generics of character styles first.

I defined something like your command line options character style. It's 
typewriter font representing any kind of source code. I called it CharCode. 
Here's the LyX portion of the character style:

CharStyle Charcode
Font
Family  Typewriter
EndFont
LatexName   charcode
LatexType   Command
End

The stuff between Font and EndFont determines how it looks from within LyX. 
You'll notice that the LatexType is Command. That's important -- character 
styles must have a LatexType of Command, never of Environment or anything 
else (as far as I know). The LatexName is charcode. That's the LaTeX command 
that gets run, using the text to which the character style is applied as an 
argument. The following is the LaTeX definition of charcode:

% ### Character style -- monotype for code in paragraph
\newcommand{\charcode}[1]{\texttt{#1}}%

In other words, you make a LaTeX command to format the output the way you want 
it, and then you make a LyX CharStyle to format it within the LyX editor and 
also to call the command.

The only trouble I see your having is if you absolutely must have all the 
different character styles look differently, which I believe usually isn't 
the case in technical books. IIRC Sams Publishing told me to use bold 
monofont for text I typed at the command prompt, and regular monofont for 
what the program output. IIRC Sams told me to use regular monofont to 
represent source code and configuration files. However, you're doing it right 
by making different character styles for all of these things, because if you 
ever DO want to differentiate them, it's as simple as changing the LaTeX 
command.


 Also email from Steve L at
 http://wiki.lyx.org/Tips/KeyboardShortcutForCharacterStyles says:

 - Insert
 - Character Style
 - Pick which character style

 But I don't see that anywhere. (Not on my Insert menu.) Can someone
 explain this?

I can. LyX is smart enough that it doesn't offer that option in the Insert 
menu until you've created at least one character style. The minute you 
successfully create a character style, Character Style will appear as an 
option on your Insert submenu.

If I were in your shoes, I'd create a tiny LyX test document and a tiny layout 
file, and experiment.

Hope this helps.

SteveT

Steve Litt
Author: Universal Troubleshooting Process books and courseware
http://www.troubleshooters.com/


Re: how to use custom character styles

2007-06-01 Thread Jeremy C. Reed
On Fri, 1 Jun 2007, Richard Heck wrote:

 Look at the stdcharstyles.inc file, which you'll find in e.g. /usr/share/lyx/.
 You'll need to define yours in a similar way (or use this one), and then
 include the file in a custom layout file. This can be as simple as:
 #% Do not delete the line below; configure depends on this
 # \DeclareLaTeXClass[article.cls]{article (mine)}
 Input article.cls
 Input mycharstyles.inc
 Put this in your user layout directory (e.g., /home/you/.lyx/layouts/),
 reconfigure LyX, choose it, and you're off.

That had errors, so I just copied scrbook.layout to my ~/.lyx/layouts/ and 
added the line:

Input mycharstyles.inc

Is there any file that corresponds to stdcharstyles.inc that defines 
\newcommand{} for \filename and the others in that file? Or do I have to 
define all these myself?


  Jeremy C. Reed


Re: how to use custom character styles

2007-06-01 Thread Hellmut Weber

Hi Steve,

I can. LyX is smart enough that it doesn't offer that option in the Insert 
menu until you've created at least one character style. The minute you 
successfully create a character style, Character Style will appear asan 
option on your Insert submenu.

I'm surprised because in my installation (gentoo-linux, kde-3.5.7,
tetex-3.0, lyx-1.5.0rc1) it appears here:

Edit TextStyle 

then there appears a submenu:

Customized...

Capitalize
Uppercase
Lowercase

And since the moment my Char Style 'Fboxed' is active, it appears above
the line with 'Customized...'

BTW I agree with your considerations on the use of Char Styles ;-)

Greetings

Hellmut

--
Dr. Hellmut Weber [EMAIL PROTECTED]
Degenfeldstraße 2 tel   +49-89-3081172
D-80803 München-Schwabing mobil +49-172-8450321
please: No DOCs, no PPTs. why: tinyurl.com/cbgq








Re: how to use custom character styles

2007-06-01 Thread Hellmut Weber

Hi Jeremy,


I want to have styles defined for:

filenames

...


etc..

...


Can someone share examples for this?

Here comes a modest example (charstyle.layout), it defines a char style
to put some piece of a running text into a framed box.
Note the second line which defines the 'Label' of the Document class!

How to proceed:

1) Put your layout file with the char style definition(s) in your local
folder $HOME/.lyx/layouts
(Suppose you put my example 'charstyle.layout' there)

2) start lyx and reconfigure
(Steve Litt indicateed recently how to do so from the command line, but
i don't remember exactly how)

4) $ lyx test_char_style.lyx

5) Create a new document (ctrl+N), put some text in, select a piece of text

6) Document Settings Document Class

7) Open the associated pull down list 'Document class' and choose the
document class 'article (Char Style Test)', click OK (or quicker: alt+O)

Now the marked part of the text will be shown inside of some sort of
blue brackets, labelled 'Fboxed'

8) Compile to PDF (alt+V, f) and your pdf-viewer should pop up showing
you the result.

To define char styles you will need some LaTeX knowledge. Once you got
the general idea it's not that difficult.

BTW This afternoon i installed lyx-1.5.0rc1, it's great!
What i described above works with 1.5.0!

I'm working on an IBM Lenovo T60 witrh gentoo-linux, kde-3.5.7, tetex-3.0

HTH + Happy LyXing!

Hellmut

--
Dr. Hellmut Weber [EMAIL PROTECTED]
Degenfeldstraße 2 tel   +49-89-3081172
D-80803 München-Schwabing mobil +49-172-8450321
please: No DOCs, no PPTs. why: tinyurl.com/cbgq

#LyX 1.5.0rc1 created this file. For more info see http://www.lyx.org/
\lyxformat 271
\begin_document
\begin_header
\textclass charstyle
\language ngerman
\inputencoding auto
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\paperfontsize default
\spacing single
\papersize default
\use_geometry false
\use_amsmath 1
\use_esint 1
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\author leo 
\end_header

\begin_body

\begin_layout Standard
asdf
\end_layout

\begin_layout Standard
asdf 
\begin_inset CharStyle Fboxed
show_label true
status inlined

\begin_layout Standard
qewrf
\end_layout

\end_inset

 asdf
\end_layout

\begin_layout Standard
adsf 
\begin_inset CharStyle Fboxed
show_label false
status inlined

\begin_layout Standard
qewrrf
\end_layout

\end_inset

 asdf2345 ycxv
\end_layout

\begin_layout Standard
asddf098u
\end_layout

\end_body
\end_document



newfile2.pdf
Description: Adobe PDF document
#% Do not delete the line below; configure depends on this
#  \DeclareLaTeXClass[scrartcl]{article (Char Style Test)}
#
# Char Style definition file for HWWTest documents
# Hellmut Weber [EMAIL PROTECTED], 2007-06-01 
#
# based on /usr/share/lyx/layouts/scrartcl.layout
# Bernd Rellermeyer [EMAIL PROTECTED], 1998/7/11.

Preamble 
  %
  % === Preamble part from charstyle.layout ===
  %
  \RequirePackage{setspace}
  \RequirePackage{pifont}
  %
  \renewcommand{\familydefault}{cmss}
  %
  \renewcommand{\theenumi}  {\Alph{enumi}}
  \renewcommand{\labelenumi}{\theenumi.}
  \renewcommand{\theenumii} {\Roman{enumii}}
  \renewcommand{\labelenumii}   {\theenumii.}
  \renewcommand{\theenumiii}{\arabic{enumiii}}
  \renewcommand{\labelenumiii}  {\theenumiii.}
  \renewcommand{\theenumiv} {\alph{enumiv}}
  \renewcommand{\labelenumiv}   {\theenumiv)}
  %
  % === End preamble part from charstyle.layout ===
  %
  EndPreamble

# General textclass parameters
Input /usr/share/lyx/layouts/scrartcl.layout

# 2007-04-29 Hw, frame-boxed code-parts
# Jürgen Spitzmüller's answer to my question
# CharStyle Fboxed_Code, ,-( # Here no underscore!
CharStyle Fboxed
  LatexType Command
  LatexName fboxedcode
  LabelFont
Family  Roman
Color   blue
EndFont
  Preamble
% === Start preamble part of Char style fboxed ===
\newcommand{\fboxedcode}[1]{%
  \fbox{\texttt{\small%
#1%
}}% texttt fbox
  }%
% === End   preamble part of Char style fboxed ===
EndPreamble
  End




Re: how to use custom character styles

2007-06-01 Thread Steve Litt
On Friday 01 June 2007 19:11, Hellmut Weber wrote:
 Hi Steve,

  I can. LyX is smart enough that it doesn't offer that option in the
  Insert menu until you've created at least one character style. The minute
  you successfully create a character style, Character Style will appear
  asan option on your Insert submenu.

 I'm surprised because in my installation (gentoo-linux, kde-3.5.7,

 tetex-3.0, lyx-1.5.0rc1) it appears here:
  Edit TextStyle 

 then there appears a submenu:

 Customized...
 
 Capitalize
 Uppercase
 Lowercase

Thanks Hellmut,

Jeremy and I are using 1.4.x. Sounds like 1.5.x is better and more 
sophisticated. Something to look forward to.

I hope with 1.5.x I can still do it the way I do it in 1.4.x, because the way 
I've been doing it can create almost any conceivable text appearance. In my 
new book Learn Vim Tonight: Use the Worlds Most Productive Editor Tomorrow 
I had a text style called ex, which I used only on the word ex (the line 
editor part of vi) so that it stood out, looked funky, and was immediately 
recognizable as a special word.

Thanks

SteveT


Re: how to use custom character styles

2007-06-01 Thread Hellmut Weber

Hi Steve,
i don't have much experience so far with Char Styles, but i'm pretty 
sure you can do everything you want, i.e. possible with a latex command.


Jeremy and I are using 1.4.x. Sounds like 1.5.x is better and more 
sophisticated. Something to look forward to.
I suppose we will get very quickly used to the new menus. For me LyX is 
probably the most used too of all.


Good Luck with your books

Hellmut


--
Dr. Hellmut Weber [EMAIL PROTECTED]
Degenfeldstraße 2 tel   +49-89-3081172
D-80803 München-Schwabing mobil +49-172-8450321
please: No DOCs, no PPTs. why: tinyurl.com/cbgq



Re: how to use custom character styles

2007-06-01 Thread Richard Heck

Jeremy C. Reed wrote:
I have a 180+ page book with many (probably over 500) character 
formattings.


I want to have styles defined for:

filenames
command names
command line options
configuration options
command output (I just use lyxcode for that)
command input
etc..

Currently I am just using stuff like typewriter, italics (or emphasis), 
bold, ... but whenever I want to try something different I will have to 
change hundreds of things. So I want to be able to identify something as a 
filename or command for example.


Any examples?
  
Look at the stdcharstyles.inc file, which you'll find in e.g. 
/usr/share/lyx/. You'll need to define yours in a similar way (or use 
this one), and then include the file in a custom layout file. This can 
be as simple as:

#% Do not delete the line below; configure depends on this
# \DeclareLaTeXClass[article.cls]{article (mine)}
Input article.cls
Input mycharstyles.inc
Put this in your user layout directory (e.g., /home/you/.lyx/layouts/), 
reconfigure LyX, choose it, and you're off.



Or why does Google have Playground indexed if it is a practice sandbox?

Because Google's search bots aren't yet perfect.

Richard

--
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: how to use custom character styles

2007-06-01 Thread Steve Litt
On Friday 01 June 2007 13:34, Jeremy C. Reed wrote:
 I have a 180+ page book with many (probably over 500) character
 formattings.

 I want to have styles defined for:

 filenames
 command names
 command line options
 configuration options
 command output (I just use lyxcode for that)
 command input
 etc..

 Currently I am just using stuff like typewriter, italics (or emphasis),
 bold, ... but whenever I want to try something different I will have to
 change hundreds of things. So I want to be able to identify something as a
 filename or command for example.

Hi Jeremy,

You're right that things like filenames and command names should never be 
formatted with generic stuff like typewriter, emphesis and bold. You're right 
that the correct way is to use character styles. I'm going to tell you the 
generics of character styles first.

I defined something like your command line options character style. It's 
typewriter font representing any kind of source code. I called it CharCode. 
Here's the LyX portion of the character style:

CharStyle Charcode
Font
Family  Typewriter
EndFont
LatexName   charcode
LatexType   Command
End

The stuff between Font and EndFont determines how it looks from within LyX. 
You'll notice that the LatexType is Command. That's important -- character 
styles must have a LatexType of Command, never of Environment or anything 
else (as far as I know). The LatexName is charcode. That's the LaTeX command 
that gets run, using the text to which the character style is applied as an 
argument. The following is the LaTeX definition of charcode:

% ### Character style -- monotype for code in paragraph
\newcommand{\charcode}[1]{\texttt{#1}}%

In other words, you make a LaTeX command to format the output the way you want 
it, and then you make a LyX CharStyle to format it within the LyX editor and 
also to call the command.

The only trouble I see your having is if you absolutely must have all the 
different character styles look differently, which I believe usually isn't 
the case in technical books. IIRC Sams Publishing told me to use bold 
monofont for text I typed at the command prompt, and regular monofont for 
what the program output. IIRC Sams told me to use regular monofont to 
represent source code and configuration files. However, you're doing it right 
by making different character styles for all of these things, because if you 
ever DO want to differentiate them, it's as simple as changing the LaTeX 
command.


 Also email from Steve L at
 http://wiki.lyx.org/Tips/KeyboardShortcutForCharacterStyles says:

 - Insert
 - Character Style
 - Pick which character style

 But I don't see that anywhere. (Not on my Insert menu.) Can someone
 explain this?

I can. LyX is smart enough that it doesn't offer that option in the Insert 
menu until you've created at least one character style. The minute you 
successfully create a character style, Character Style will appear as an 
option on your Insert submenu.

If I were in your shoes, I'd create a tiny LyX test document and a tiny layout 
file, and experiment.

Hope this helps.

SteveT

Steve Litt
Author: Universal Troubleshooting Process books and courseware
http://www.troubleshooters.com/


Re: how to use custom character styles

2007-06-01 Thread Jeremy C. Reed
On Fri, 1 Jun 2007, Richard Heck wrote:

 Look at the stdcharstyles.inc file, which you'll find in e.g. /usr/share/lyx/.
 You'll need to define yours in a similar way (or use this one), and then
 include the file in a custom layout file. This can be as simple as:
 #% Do not delete the line below; configure depends on this
 # \DeclareLaTeXClass[article.cls]{article (mine)}
 Input article.cls
 Input mycharstyles.inc
 Put this in your user layout directory (e.g., /home/you/.lyx/layouts/),
 reconfigure LyX, choose it, and you're off.

That had errors, so I just copied scrbook.layout to my ~/.lyx/layouts/ and 
added the line:

Input mycharstyles.inc

Is there any file that corresponds to stdcharstyles.inc that defines 
\newcommand{} for \filename and the others in that file? Or do I have to 
define all these myself?


  Jeremy C. Reed


Re: how to use custom character styles

2007-06-01 Thread Hellmut Weber

Hi Steve,

I can. LyX is smart enough that it doesn't offer that option in the Insert 
menu until you've created at least one character style. The minute you 
successfully create a character style, Character Style will appear asan 
option on your Insert submenu.

I'm surprised because in my installation (gentoo-linux, kde-3.5.7,
tetex-3.0, lyx-1.5.0rc1) it appears here:

Edit TextStyle 

then there appears a submenu:

Customized...

Capitalize
Uppercase
Lowercase

And since the moment my Char Style 'Fboxed' is active, it appears above
the line with 'Customized...'

BTW I agree with your considerations on the use of Char Styles ;-)

Greetings

Hellmut

--
Dr. Hellmut Weber [EMAIL PROTECTED]
Degenfeldstraße 2 tel   +49-89-3081172
D-80803 München-Schwabing mobil +49-172-8450321
please: No DOCs, no PPTs. why: tinyurl.com/cbgq








Re: how to use custom character styles

2007-06-01 Thread Hellmut Weber

Hi Jeremy,


I want to have styles defined for:

filenames

...


etc..

...


Can someone share examples for this?

Here comes a modest example (charstyle.layout), it defines a char style
to put some piece of a running text into a framed box.
Note the second line which defines the 'Label' of the Document class!

How to proceed:

1) Put your layout file with the char style definition(s) in your local
folder $HOME/.lyx/layouts
(Suppose you put my example 'charstyle.layout' there)

2) start lyx and reconfigure
(Steve Litt indicateed recently how to do so from the command line, but
i don't remember exactly how)

4) $ lyx test_char_style.lyx

5) Create a new document (ctrl+N), put some text in, select a piece of text

6) Document Settings Document Class

7) Open the associated pull down list 'Document class' and choose the
document class 'article (Char Style Test)', click OK (or quicker: alt+O)

Now the marked part of the text will be shown inside of some sort of
blue brackets, labelled 'Fboxed'

8) Compile to PDF (alt+V, f) and your pdf-viewer should pop up showing
you the result.

To define char styles you will need some LaTeX knowledge. Once you got
the general idea it's not that difficult.

BTW This afternoon i installed lyx-1.5.0rc1, it's great!
What i described above works with 1.5.0!

I'm working on an IBM Lenovo T60 witrh gentoo-linux, kde-3.5.7, tetex-3.0

HTH + Happy LyXing!

Hellmut

--
Dr. Hellmut Weber [EMAIL PROTECTED]
Degenfeldstraße 2 tel   +49-89-3081172
D-80803 München-Schwabing mobil +49-172-8450321
please: No DOCs, no PPTs. why: tinyurl.com/cbgq

#LyX 1.5.0rc1 created this file. For more info see http://www.lyx.org/
\lyxformat 271
\begin_document
\begin_header
\textclass charstyle
\language ngerman
\inputencoding auto
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\paperfontsize default
\spacing single
\papersize default
\use_geometry false
\use_amsmath 1
\use_esint 1
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\author leo 
\end_header

\begin_body

\begin_layout Standard
asdf
\end_layout

\begin_layout Standard
asdf 
\begin_inset CharStyle Fboxed
show_label true
status inlined

\begin_layout Standard
qewrf
\end_layout

\end_inset

 asdf
\end_layout

\begin_layout Standard
adsf 
\begin_inset CharStyle Fboxed
show_label false
status inlined

\begin_layout Standard
qewrrf
\end_layout

\end_inset

 asdf2345 ycxv
\end_layout

\begin_layout Standard
asddf098u
\end_layout

\end_body
\end_document



newfile2.pdf
Description: Adobe PDF document
#% Do not delete the line below; configure depends on this
#  \DeclareLaTeXClass[scrartcl]{article (Char Style Test)}
#
# Char Style definition file for HWWTest documents
# Hellmut Weber [EMAIL PROTECTED], 2007-06-01 
#
# based on /usr/share/lyx/layouts/scrartcl.layout
# Bernd Rellermeyer [EMAIL PROTECTED], 1998/7/11.

Preamble 
  %
  % === Preamble part from charstyle.layout ===
  %
  \RequirePackage{setspace}
  \RequirePackage{pifont}
  %
  \renewcommand{\familydefault}{cmss}
  %
  \renewcommand{\theenumi}  {\Alph{enumi}}
  \renewcommand{\labelenumi}{\theenumi.}
  \renewcommand{\theenumii} {\Roman{enumii}}
  \renewcommand{\labelenumii}   {\theenumii.}
  \renewcommand{\theenumiii}{\arabic{enumiii}}
  \renewcommand{\labelenumiii}  {\theenumiii.}
  \renewcommand{\theenumiv} {\alph{enumiv}}
  \renewcommand{\labelenumiv}   {\theenumiv)}
  %
  % === End preamble part from charstyle.layout ===
  %
  EndPreamble

# General textclass parameters
Input /usr/share/lyx/layouts/scrartcl.layout

# 2007-04-29 Hw, frame-boxed code-parts
# Jürgen Spitzmüller's answer to my question
# CharStyle Fboxed_Code, ,-( # Here no underscore!
CharStyle Fboxed
  LatexType Command
  LatexName fboxedcode
  LabelFont
Family  Roman
Color   blue
EndFont
  Preamble
% === Start preamble part of Char style fboxed ===
\newcommand{\fboxedcode}[1]{%
  \fbox{\texttt{\small%
#1%
}}% texttt fbox
  }%
% === End   preamble part of Char style fboxed ===
EndPreamble
  End




Re: how to use custom character styles

2007-06-01 Thread Steve Litt
On Friday 01 June 2007 19:11, Hellmut Weber wrote:
 Hi Steve,

  I can. LyX is smart enough that it doesn't offer that option in the
  Insert menu until you've created at least one character style. The minute
  you successfully create a character style, Character Style will appear
  asan option on your Insert submenu.

 I'm surprised because in my installation (gentoo-linux, kde-3.5.7,

 tetex-3.0, lyx-1.5.0rc1) it appears here:
  Edit TextStyle 

 then there appears a submenu:

 Customized...
 
 Capitalize
 Uppercase
 Lowercase

Thanks Hellmut,

Jeremy and I are using 1.4.x. Sounds like 1.5.x is better and more 
sophisticated. Something to look forward to.

I hope with 1.5.x I can still do it the way I do it in 1.4.x, because the way 
I've been doing it can create almost any conceivable text appearance. In my 
new book Learn Vim Tonight: Use the Worlds Most Productive Editor Tomorrow 
I had a text style called ex, which I used only on the word ex (the line 
editor part of vi) so that it stood out, looked funky, and was immediately 
recognizable as a special word.

Thanks

SteveT


Re: how to use custom character styles

2007-06-01 Thread Hellmut Weber

Hi Steve,
i don't have much experience so far with Char Styles, but i'm pretty 
sure you can do everything you want, i.e. possible with a latex command.


Jeremy and I are using 1.4.x. Sounds like 1.5.x is better and more 
sophisticated. Something to look forward to.
I suppose we will get very quickly used to the new menus. For me LyX is 
probably the most used too of all.


Good Luck with your books

Hellmut


--
Dr. Hellmut Weber [EMAIL PROTECTED]
Degenfeldstraße 2 tel   +49-89-3081172
D-80803 München-Schwabing mobil +49-172-8450321
please: No DOCs, no PPTs. why: tinyurl.com/cbgq



Re: how to use custom character styles

2007-06-01 Thread Richard Heck

Jeremy C. Reed wrote:
I have a 180+ page book with many (probably over 500) character 
formattings.


I want to have styles defined for:

filenames
command names
command line options
configuration options
command output (I just use lyxcode for that)
command input
etc..

Currently I am just using stuff like typewriter, italics (or emphasis), 
bold, ... but whenever I want to try something different I will have to 
change hundreds of things. So I want to be able to identify something as a 
"filename" or "command" for example.


Any examples?
  
Look at the stdcharstyles.inc file, which you'll find in e.g. 
/usr/share/lyx/. You'll need to define yours in a similar way (or use 
this one), and then include the file in a custom layout file. This can 
be as simple as:

#% Do not delete the line below; configure depends on this
# \DeclareLaTeXClass[article.cls]{article (mine)}
Input article.cls
Input mycharstyles.inc
Put this in your user layout directory (e.g., /home/you/.lyx/layouts/), 
reconfigure LyX, choose it, and you're off.



Or why does Google have Playground indexed if it is a practice sandbox?

Because Google's search bots aren't yet perfect.

Richard

--
==
Richard G Heck, Jr
Professor of Philosophy
Brown University
http://frege.brown.edu/heck/
==
Get my public key from http://sks.keyserver.penguin.de
Hash: 0x1DE91F1E66FFBDEC
Learn how to sign your email using Thunderbird and GnuPG at:
http://dudu.dyn.2-h.org/nist/gpg-enigmail-howto



Re: how to use custom character styles

2007-06-01 Thread Steve Litt
On Friday 01 June 2007 13:34, Jeremy C. Reed wrote:
> I have a 180+ page book with many (probably over 500) character
> formattings.
>
> I want to have styles defined for:
>
> filenames
> command names
> command line options
> configuration options
> command output (I just use lyxcode for that)
> command input
> etc..
>
> Currently I am just using stuff like typewriter, italics (or emphasis),
> bold, ... but whenever I want to try something different I will have to
> change hundreds of things. So I want to be able to identify something as a
> "filename" or "command" for example.

Hi Jeremy,

You're right that things like filenames and command names should never be 
formatted with generic stuff like typewriter, emphesis and bold. You're right 
that the correct way is to use character styles. I'm going to tell you the 
generics of character styles first.

I defined something like your command line options character style. It's 
typewriter font representing any kind of source code. I called it CharCode. 
Here's the LyX portion of the character style:

CharStyle Charcode
Font
Family  Typewriter
EndFont
LatexName   charcode
LatexType   Command
End

The stuff between Font and EndFont determines how it looks from within LyX. 
You'll notice that the LatexType is Command. That's important -- character 
styles must have a LatexType of Command, never of Environment or anything 
else (as far as I know). The LatexName is charcode. That's the LaTeX command 
that gets run, using the text to which the character style is applied as an 
argument. The following is the LaTeX definition of charcode:

% ### Character style -- monotype for code in paragraph
\newcommand{\charcode}[1]{\texttt{#1}}%

In other words, you make a LaTeX command to format the output the way you want 
it, and then you make a LyX CharStyle to format it within the LyX editor and 
also to call the command.

The only trouble I see your having is if you absolutely must have all the 
different character styles look differently, which I believe usually isn't 
the case in technical books. IIRC Sams Publishing told me to use bold 
monofont for text I typed at the command prompt, and regular monofont for 
what the program output. IIRC Sams told me to use regular monofont to 
represent source code and configuration files. However, you're doing it right 
by making different character styles for all of these things, because if you 
ever DO want to differentiate them, it's as simple as changing the LaTeX 
command.


> Also email from Steve L at
> http://wiki.lyx.org/Tips/KeyboardShortcutForCharacterStyles says:
>
> - Insert
> - Character Style
> - Pick which character style
>
> But I don't see that anywhere. (Not on my Insert menu.) Can someone
> explain this?

I can. LyX is smart enough that it doesn't offer that option in the Insert 
menu until you've created at least one character style. The minute you 
successfully create a character style, "Character Style" will appear as an 
option on your Insert submenu.

If I were in your shoes, I'd create a tiny LyX test document and a tiny layout 
file, and experiment.

Hope this helps.

SteveT

Steve Litt
Author: Universal Troubleshooting Process books and courseware
http://www.troubleshooters.com/


Re: how to use custom character styles

2007-06-01 Thread Jeremy C. Reed
On Fri, 1 Jun 2007, Richard Heck wrote:

> Look at the stdcharstyles.inc file, which you'll find in e.g. /usr/share/lyx/.
> You'll need to define yours in a similar way (or use this one), and then
> include the file in a custom layout file. This can be as simple as:
> #% Do not delete the line below; configure depends on this
> # \DeclareLaTeXClass[article.cls]{article (mine)}
> Input article.cls
> Input mycharstyles.inc
> Put this in your user layout directory (e.g., /home/you/.lyx/layouts/),
> reconfigure LyX, choose it, and you're off.

That had errors, so I just copied scrbook.layout to my ~/.lyx/layouts/ and 
added the line:

Input mycharstyles.inc

Is there any file that corresponds to stdcharstyles.inc that defines 
\newcommand{} for \filename and the others in that file? Or do I have to 
define all these myself?


  Jeremy C. Reed


Re: how to use custom character styles

2007-06-01 Thread Hellmut Weber

Hi Steve,

I can. LyX is smart enough that it doesn't offer that option in the Insert 
menu until you've created at least one character style. The minute you 
successfully create a character style, "Character Style" will appear asan 
option on your Insert submenu.

I'm surprised because in my installation (gentoo-linux, kde-3.5.7,
tetex-3.0, lyx-1.5.0rc1) it appears here:

>>Edit >TextStyle >

then there appears a submenu:

Customized...

Capitalize
Uppercase
Lowercase

And since the moment my Char Style 'Fboxed' is active, it appears above
the line with 'Customized...'

BTW I agree with your considerations on the use of Char Styles ;-)

Greetings

Hellmut

--
Dr. Hellmut Weber [EMAIL PROTECTED]
Degenfeldstraße 2 tel   +49-89-3081172
D-80803 München-Schwabing mobil +49-172-8450321
please: No DOCs, no PPTs. why: tinyurl.com/cbgq








Re: how to use custom character styles

2007-06-01 Thread Hellmut Weber

Hi Jeremy,


I want to have styles defined for:

filenames

...


etc..

...


Can someone share examples for this?

Here comes a modest example (charstyle.layout), it defines a char style
to put some piece of a running text into a framed box.
Note the second line which defines the 'Label' of the Document class!

How to proceed:

1) Put your layout file with the char style definition(s) in your local
folder $HOME/.lyx/layouts
(Suppose you put my example 'charstyle.layout' there)

2) start lyx and reconfigure
(Steve Litt indicateed recently how to do so from the command line, but
i don't remember exactly how)

4) $ lyx test_char_style.lyx

5) Create a new document (ctrl+N), put some text in, select a piece of text

6) >>Document >Settings >Document Class

7) Open the associated pull down list 'Document class' and choose the
document class 'article (Char Style Test)', click OK (or quicker: alt+O)

Now the marked part of the text will be shown inside of some sort of
blue brackets, labelled 'Fboxed'

8) Compile to PDF (alt+V, f) and your pdf-viewer should pop up showing
you the result.

To define char styles you will need some LaTeX knowledge. Once you got
the general idea it's not that difficult.

BTW This afternoon i installed lyx-1.5.0rc1, it's great!
What i described above works with 1.5.0!

I'm working on an IBM Lenovo T60 witrh gentoo-linux, kde-3.5.7, tetex-3.0

HTH + Happy LyXing!

Hellmut

--
Dr. Hellmut Weber [EMAIL PROTECTED]
Degenfeldstraße 2 tel   +49-89-3081172
D-80803 München-Schwabing mobil +49-172-8450321
please: No DOCs, no PPTs. why: tinyurl.com/cbgq

#LyX 1.5.0rc1 created this file. For more info see http://www.lyx.org/
\lyxformat 271
\begin_document
\begin_header
\textclass charstyle
\language ngerman
\inputencoding auto
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\paperfontsize default
\spacing single
\papersize default
\use_geometry false
\use_amsmath 1
\use_esint 1
\cite_engine basic
\use_bibtopic false
\paperorientation portrait
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\defskip medskip
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\author "leo" 
\end_header

\begin_body

\begin_layout Standard
asdf
\end_layout

\begin_layout Standard
asdf 
\begin_inset CharStyle Fboxed
show_label true
status inlined

\begin_layout Standard
qewrf
\end_layout

\end_inset

 asdf
\end_layout

\begin_layout Standard
adsf 
\begin_inset CharStyle Fboxed
show_label false
status inlined

\begin_layout Standard
qewrrf
\end_layout

\end_inset

 asdf2345 ycxv
\end_layout

\begin_layout Standard
asddf098u
\end_layout

\end_body
\end_document



newfile2.pdf
Description: Adobe PDF document
#% Do not delete the line below; configure depends on this
#  \DeclareLaTeXClass[scrartcl]{article (Char Style Test)}
#
# Char Style definition file for HWWTest documents
# Hellmut Weber <[EMAIL PROTECTED]>, 2007-06-01 
#
# based on /usr/share/lyx/layouts/scrartcl.layout
# Bernd Rellermeyer <[EMAIL PROTECTED]>, 1998/7/11.

Preamble 
  %
  % === Preamble part from charstyle.layout ===
  %
  \RequirePackage{setspace}
  \RequirePackage{pifont}
  %
  \renewcommand{\familydefault}{cmss}
  %
  \renewcommand{\theenumi}  {\Alph{enumi}}
  \renewcommand{\labelenumi}{\theenumi.}
  \renewcommand{\theenumii} {\Roman{enumii}}
  \renewcommand{\labelenumii}   {\theenumii.}
  \renewcommand{\theenumiii}{\arabic{enumiii}}
  \renewcommand{\labelenumiii}  {\theenumiii.}
  \renewcommand{\theenumiv} {\alph{enumiv}}
  \renewcommand{\labelenumiv}   {\theenumiv)}
  %
  % === End preamble part from charstyle.layout ===
  %
  EndPreamble

# General textclass parameters
Input /usr/share/lyx/layouts/scrartcl.layout

# 2007-04-29 Hw, frame-boxed code-parts
# Jürgen Spitzmüller's answer to my question
# CharStyle Fboxed_Code, ,-( # Here no underscore!
CharStyle Fboxed
  LatexType Command
  LatexName fboxedcode
  LabelFont
Family  Roman
Color   blue
EndFont
  Preamble
% === Start preamble part of Char style fboxed ===
\newcommand{\fboxedcode}[1]{%
  \fbox{\texttt{\small%
#1%
}}% texttt fbox
  }%
% === End   preamble part of Char style fboxed ===
EndPreamble
  End




Re: how to use custom character styles

2007-06-01 Thread Steve Litt
On Friday 01 June 2007 19:11, Hellmut Weber wrote:
> Hi Steve,
>
> > I can. LyX is smart enough that it doesn't offer that option in the
> > Insert menu until you've created at least one character style. The minute
> > you successfully create a character style, "Character Style" will appear
> > asan option on your Insert submenu.
>
> I'm surprised because in my installation (gentoo-linux, kde-3.5.7,
>
> tetex-3.0, lyx-1.5.0rc1) it appears here:
>  >>Edit >TextStyle >
>
> then there appears a submenu:
>
> Customized...
> 
> Capitalize
> Uppercase
> Lowercase

Thanks Hellmut,

Jeremy and I are using 1.4.x. Sounds like 1.5.x is better and more 
sophisticated. Something to look forward to.

I hope with 1.5.x I can still do it the way I do it in 1.4.x, because the way 
I've been doing it can create almost any conceivable text appearance. In my 
new book "Learn Vim Tonight: Use the Worlds Most Productive Editor Tomorrow" 
I had a text style called ex, which I used only on the word ex (the line 
editor part of vi) so that it stood out, looked funky, and was immediately 
recognizable as a special word.

Thanks

SteveT


Re: how to use custom character styles

2007-06-01 Thread Hellmut Weber

Hi Steve,
i don't have much experience so far with Char Styles, but i'm pretty 
sure you can do everything you want, i.e. possible with a latex command.


Jeremy and I are using 1.4.x. Sounds like 1.5.x is better and more 
sophisticated. Something to look forward to.
I suppose we will get very quickly used to the new menus. For me LyX is 
probably the most used too of all.


Good Luck with your books

Hellmut


--
Dr. Hellmut Weber [EMAIL PROTECTED]
Degenfeldstraße 2 tel   +49-89-3081172
D-80803 München-Schwabing mobil +49-172-8450321
please: No DOCs, no PPTs. why: tinyurl.com/cbgq