Re: Custom module: inset for mdframed boxes

2014-06-26 Thread Matthieu

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}







Re: Custom module: inset for mdframed boxes

2014-06-24 Thread Jürgen Spitzmüller
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}
>
>
>


Re: Custom module: inset for mdframed boxes

2014-06-23 Thread Matthieu

Dear lyx users list

I was wondering whether someone would have any insights for the question 
(see below) I asked a few days ago on this list, regarding help for 
writing a custom module. Maybe I should rather ask on the lyx-devel, 
where people might be more familiar with customising Lyx?


Thanks!

Matthieu


Le 19. 06. 14 10:36, Matthieu a écrit :

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? I tried adding:
CopyStyle Box
or:
HTMLStyle
div.Frameless { margin: 1em; }
EndHTMLStyle

as I saw for boxes, but it does not work.

-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?


-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?

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}






Custom module: inset for mdframed boxes

2014-06-19 Thread 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? I tried adding:
CopyStyle Box
or:
HTMLStyle
div.Frameless { margin: 1em; }
EndHTMLStyle

as I saw for boxes, but it does not work.

-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?


-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?

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}