LyXDefining optional parameter for InsetLayout

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
johnkiro
Posts: 2
Joined: Thu Apr 28, 2011 11:29 am

Defining optional parameter for InsetLayout

Post by johnkiro »

Hello There,

this is my first post in the LaTeX community :)

I'm trying to create a layout inset to simplify using the bclogo package, which uses TikZ to add nice looking notes to documents.

Here is how I define the inset:

Code: Select all

InsetLayout ImportantNote
	LabelString           Important Note
	LatexType             environment
	LatexName             bclogo
	LatexParam            [couleur=blue!5\,couleurBord=blue!30]
	LyxType               custom
	BgColor               cyan
	LabelFont
	  Color               green
	  Size                Small
	EndFont
	MultiPar              true
	CustomPars            true
	ForcePlain            false
	Decoration            classic
End
The problem is with the LatexParam line; it doesn't seem to accept the comma-separated list of key-value parameters :( The behavior is that the part following the comma is chopped!

Any reason does it behave this way, and how can I define this inset?

Thanks
John

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

johnkiro
Posts: 2
Joined: Thu Apr 28, 2011 11:29 am

Defining optional parameter for InsetLayout

Post by johnkiro »

Hello again,

Fortunately it was easy to overcome this problem by wrapping the bclogo environment inside a command as follows:

Code: Select all

Preamble
\usepackage[tikz]{bclogo}
\newcommand{\importantnote}[1]
{
  \begin{bclogo}[couleur=blue!5,couleurBord=blue!30,logo=\bccrayon,arrondi=0.1]
    {Note}#1
  \end{bclogo}
}
EndPreamble

Format 11

InsetLayout ImportantNote
	LabelString           Important Note
	LatexType             command
	LatexName             importantnote
	LyxType               custom
	BgColor               cyan
	LabelFont
	  Color               green
	  Size                Small
	EndFont
	MultiPar              true
	CustomPars            true
	ForcePlain            false
	Decoration            classic
End
Regards,
John
Post Reply