Who can help me create this module?

Jürgen Spitzmüller jspitzm at gmail.com
Sat Oct 5 07:57:52 UTC 2024


Am Montag, dem 30.09.2024 um 23:37 +0200 schrieb didiergabory at free.fr:
> Hi,
> 
> I'm working with version 2.4.1 on Windows 10.
> This module is intended for use with KomaScript classes.
> 
> I'd like to add a new ‘photo’ type float using the features of the
> KomaScript family. I'm having two problems:
> 
> 1) As you can see in the attached "floating_photo.module" file, the
> code placed in the body between the ‘float’ and ‘end’ tags is not
> taken into account when pdflatex is exported.  I have to place this
> part of the code between the "AddToPreamble" and "EndPreamble" tags
> for it to work... However, I'd really like to include all this in a
> larger file, and I'd like the code to be incorporated only if this
> type of float is actually used in the document...
> 
> 2) With this way of doing things, which I haven't mastered at all,
> because I'm having a hard time understanding the available
> documentation, I don't currently have the possibility of nesting two
> floats of this type in lyx in the usual way of figure and sub-
> figure...
> 
> Can anyone help me?

If you do not urgently need the KOMA way for some reason, I'd recommend
implementing this via the float package, as this is fully supported in
LyX (you get a "Liste des photos" inset for free). See attached module.

Adding preamble code only if a float is used is currently not yet
supported, see
https://www.lyx.org/trac/ticket/13110

> 
> All the best.

-- 
Jürgen
-------------- next part --------------
#\DeclareLyXModule[]{Flottant Photo}
#\DeclareCategory{Flottants & légendes}
#DescriptionBegin
#Ajoute un flottant pour les photos
#DescriptionEnd

Format 104

OutlinerName photo        "Photos" #no AddToToc

Float
	Type                  photo
	GuiName               Photo
	AllowedPlacement      !htbpH	
	Placement	      tbph
	Extension             loph
	NumberWithin          none
	Style                 plain
	ListName              "Liste des photos"
	IsPredefined          false
	UsesFloatPkg          true
	PrettyFormat          "Photo ##"
End



More information about the lyx-users mailing list