Re: LyX generated preamble package loading order.

2023-08-04 Thread Folsk Pratima

On 04/08/2023 11:07, Scott Kostyshak wrote:

On Fri, Aug 04, 2023 at 10:27:28AM +0300, Folsk Pratima wrote:


Then there is still a question as to why the declared module does not do
what it is supposed to do? Or do you think I should create a different
thread for this question?

Could you please attach a simple example .lyx file?

Thanks,
Scott


*customTitles.module* is the aforementioned module. I put it in 
*~/.lyx/layouts*, because I am not sure if putting it in Document -> 
Settings -> Local Layout would be correct. *example.lyx* is the file you 
request.
#\DeclareLyXModule[titlesec.sty]{Custom Titles}
#DescriptionBegin
#Adds titlesec package functionality to redefine appearance
#of existing titles, such as \section{} or \paragraph{}
#DescriptionEnd

Format 66

Style ModulePleaseWork
CopyStyle Quotation
End


example.lyx
Description: application/lyx
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: LyX generated preamble package loading order.

2023-08-04 Thread Scott Kostyshak
On Fri, Aug 04, 2023 at 10:27:28AM +0300, Folsk Pratima wrote:

> Then there is still a question as to why the declared module does not do
> what it is supposed to do? Or do you think I should create a different
> thread for this question?

Could you please attach a simple example .lyx file?

Thanks,
Scott


signature.asc
Description: PGP signature
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: LyX generated preamble package loading order.

2023-08-04 Thread Folsk Pratima

/On Thu Aug 3 13:42:06 UTC 2023///, *Pavel Sanda* wrote:

>I am afraid you will need to use the hackish solution. 
>https://www.lyx.org/trac/ticket/5366


Then there is still a question as to why the declared module does not do 
what it is supposed to do? Or do you think I should create a different 
thread for this question? As far as I understand from reading LyX 
Customization manual it seems to me that the .module files exist exactly 
for the purpose of user declared modules. I assumed that I need to 
"trigger" LyX to use my module, so I modified it as shown at the end of 
this message. I then used the style in my document. The resulting LaTeX 
code it there as well. As you can see, no *titlesec* at all.


/On Thu Aug 3 15:08:25 UTC 2023/, *Kornel Benko* wrote:

>Maybe a local format containing > >    Format 104 >    Provides 
hyperref 1 >helps?


Not really. Because I can disable *hyperref* support in Document -> 
Settings -> PDF Properties as well, with pretty much the same result. 
The "hackish" part about this is that I have to enable *hyperref* 
support, then look up the generated code in the preamble, copy it to my 
custom preamble and then disable it again. I do not consider this to be 
a lot of trouble, because you are likely to only do it once, yet it 
seems to me we could have a cleaner solution.


Module source code:

   #\DeclareLyXModule[titlesec.sty]{Custom Titles} #DescriptionBegin
   #Adds titlesec package functionality to redefine appearance #of
   existing titles, such as \section{} or \paragraph{} #DescriptionEnd
   Format 66 Style ModulePleaseWork CopyStyle Quotation End

Generated LaTeX code:

   % Preview source code %% LyX 2.3.6 created this file. For more info,
   see http://www.lyx.org/. %% Do not edit unless you really know what
   you are doing. \documentclass[english]{article}
   \usepackage[T1]{fontenc} \usepackage[latin9]{inputenc}
   \usepackage{babel} \begin{document} \begin{quotation} Module please
   work! \end{quotation} \end{document}
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: LyX generated preamble package loading order.

2023-08-03 Thread Kornel Benko
Am Thu, 3 Aug 2023 15:42:06 +0200
schrieb Pavel Sanda :

> On Wed, Aug 02, 2023 at 08:39:14PM +0300, Folsk Pratima wrote:
> > One solution to this problem is loading *hyperref* manually, however, I
> > think of this as of a hack. Is it possible to somehow make *titlesec* to be
> > loaded before *hyperref*?  
> 
> I am afraid you will need to use the hackish solution.
> https://www.lyx.org/trac/ticket/5366
> 
> Pavel

Maybe a local format containing

Format 104
Provides hyperref 1
helps?
This disables loading of hyperref, so that it has to be loaded in the user 
preamble.
Just my 2 cents.

Kornel


pgpkDYMbS9LbY.pgp
Description: Digitale Signatur von OpenPGP
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: LyX generated preamble package loading order.

2023-08-03 Thread Pavel Sanda
On Wed, Aug 02, 2023 at 08:39:14PM +0300, Folsk Pratima wrote:
> One solution to this problem is loading *hyperref* manually, however, I
> think of this as of a hack. Is it possible to somehow make *titlesec* to be
> loaded before *hyperref*?

I am afraid you will need to use the hackish solution.
https://www.lyx.org/trac/ticket/5366

Pavel
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


LyX generated preamble package loading order.

2023-08-02 Thread Folsk Pratima

LyX generated preamble package loading order.

Greetings.


Debian 11. LyX 2.3.6 (2020-11-27).


I want to use *titlesec* package in my document. However, if it is 
loaded /after/ *hyperref* package, it causes inconsistent behavior. For 
example, ToC entries might point to wrong places.



One solution to this problem is loading *hyperref* manually, however, I 
think of this as of a hack. Is it possible to somehow make *titlesec* to 
be loaded before *hyperref*? I tried to declare a .module, but it 
failed. The module code is listed at the end. The module appears in 
Document -> Settings -> Modules, however, loading it does not cause the 
\usepackage{titlesec} to be added to preamble. I tried using 
AddToPreamble block, however, its contents come after *hyperref* is loaded.



#\DeclareLyXModule[titlesec.sty]{Custom Titles}
#DescriptionBegin
#Adds titlesec package functionality to redefine appearance
#of existing titles, such as \section{} or \paragraph{}
#DescriptionEnd
-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users