Thank you very much, Jürgen - works like a charm!
I am a bit surprised about the way character styles are represented in the
GUI (with this kind of inset and the name below). I had expected it to be
more like "Emphasis" and the other text styles so that one can defines, how
the text *itself* does appear - and not the character style label.
I suppose the reason is support for nesting? (Just figured out that you can
nest character styles, which definitely makes sense. Pretty cool!) Problem
is just that it makes the text a bit uneasy to read on the screen, as a
line containing a word with applied character style(s) takes additional
space, resulting in different line spacings.
Is there any way to define own "text styles" such as "Emphasis" or "Noun"?
As I understand it, this should conceptually be a character style as well,
even though it seems to be implemented differently.
Thanks again!
Daniel
Juergen Spitzmueller schrieb:
Daniel Lohmann wrote:
1) I would like to use character styles in my documents. In our papers, we
frequently have to refer to identifiers from C++ listings that should be
set in "typewriter" and either "small" or "smaller" and I would like to
define a character style for that.
Currently, charstyles are only available on a general (document-class or
several-document-classes) level.
You have to define your character styles either in the *.layout file or in a
mycharstyles.inc file, which is then to be included in the layout file(s)
with
Input mycharstyles.inc
All those files have to be placed in your ./lyx-directory.
The char styles are then available through the menu (Input->Character Styles)
The syntax is pretty straightforward, in your case it's something like:
CharStyle Identifier
LatexType Command
LatexName identif
LabelFont
Family Typewriter
Color blue
EndFont
Preamble
\newcommand\identif[1]{\small\texttt{#1}}
EndPreamble
End
Note that the "Family" and "Color" options only refer to the appearance on
screen.
HTH,
Jürgen
------------------------------------------------------------------------
# Textclass definition file for docbook.
# Author : José Abílio Oliveira Matos <[EMAIL PROTECTED]>
# Character Styles definition
Format 2
CharStyle Versal
LatexType Command
LatexName versal
LabelFont
Family Roman
Color blue
EndFont
Preamble
[EMAIL PROTECTED]
\usepackage{soul}
}{}
[EMAIL PROTECTED]
\DeclareRobustCommand*\versal[1]{%
\MakeUppercase{\scalefont{.92}\null{\caps{#1}}}%
}
}{}
EndPreamble
End
CharStyle Enquote*
LatexType Command
LatexName enquote*
Font
Family Typewriter
EndFont
LabelFont
Family Roman
Color green
EndFont
End
CharStyle Enquote
LatexType Command
LatexName enquote
LabelFont
Family Roman
Color green
EndFont
End