Dear Jürgen
Excellent, exactly what I needed, thanks so much for your help!!
Matthieu
Le 24. 06. 14 16:17, Jürgen Spitzmüller a écrit :
2014-06-19 10:36 GMT+02:00 Matthieu:
Dear Lyx users list
I would like to use the mdframed package in Lyx, which offers nice
boxes. In its simplest form, mdframed is just used with (see below
for reproduciible latex code):
\begin{mdframed}
A box
\end{mdframed}
Eventually with [frametitle=A title]
I was trying to create a Lyx inset for this, made it somehow, but
this is a very rough draft, and I would appreciate any help, in
particular:
-how to give the new inset a feeling of box?
Add
Decoration classic
to the InsetLayout definition.
-For the title of the box, the user needs to add herself:
frametitle=A title Ideally, one would not need to do this... is
this avoidable in Lyx (make him add automatically "frametitle="),
or does one need to rewrite slightly the environment mdframed?
Currently keyval syntax is not natively supported. So users either
need to enter the keyval syntax completely, or you need to rewrite the
mdframed environment.
-More generally, I choose to use it as a custom inset, but could
have done defining it as a new style.. is this choice sound?
Yes, looks completely sane.
Jürgen
Thanks!!
###
#Lyx module:
###
#\DeclareLyXModule[mdframed.sty]{MD frame}
#DescriptionBegin
# Try to use package mdframed
#DescriptionEnd
Format 49
InsetLayout Flex:MDbox
LyXType custom
LatexName mdframed
LatexType Environment
LabelString "Md frame"
Requiresmdframed
LabelFont
Color blue
Sizelarge
EndFont
MultiPartrue
HTMLStyle
div.Frameless { margin: 1em; }
EndHTMLStyle
Preamble
\usepackage{mdframed}
EndPreamble
Argument 1
LabelString"Box Title, write: frametitle=AA"
Tooltip"Enter the box title here"
Mandatory 0
Decoration conglomerate
Font
Colorblue
Size large
EndFont
AutoInsert 1
EndArgument
End
#LaTeX minimal mdframed:
\documentclass[a4paper,10pt]{article}
\usepackage{mdframed}
\begin{document}
\begin{mdframed}
A box
\end{mdframed}
And
\begin{mdframed}[frametitle=A title]
A box
\end{mdframed}
\end{document}