Setting section color in local layout

Ricardo Berlasso rgb.mldc at gmail.com
Wed Jan 4 21:06:06 UTC 2023


El mié, 4 ene 2023 a las 21:41, Lorenzo Bertini (<lorenzobertini97 at gmail.com>)
escribió:

> Hi,
>
> setting the following in local layout
>
> > Style Section
> >       Font
> >               Color           Pink
> >       EndFont
> > End
>
> makes Lyx's workarea sections pink indeed (it's just a test color, I
> swear it's temporary :)), so Lyx is reading the layout alright. But if I
> output the document, both with Latex and LyXHTML, section labels are
> black. Could someone tell me what I'm doing wrong?
>

In fact, the Font block on the local layout only affect the editing area.
If you want to change the actual heading formatting you need to use the
titlesec package. For example, to set the section heading to use the sans
font defined in the document (\sffamily), in bold and with its size set as
\Large, assigning to it a custom color (I don't like pink), write in the
document preamble,

\usepackage{titlesec}
\usepackage{xcolor}
\definecolor{Greeeeen}{rgb}{.3,.7,.3}
\titleformat*{\section}{
      \Large\bfseries\sffamily
      \color{Greeeeen}}

[[   BTW, I talk about those things in chapter 12 here:
https://frommindtotype.wordpress.com/lyx-book/   ;)    ]]

Regards,
Ricardo



>
> --
> Lorenzo
> --
> lyx-users mailing list
> lyx-users at lists.lyx.org
> http://lists.lyx.org/mailman/listinfo/lyx-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-users/attachments/20230104/ddaa1e84/attachment.html>


More information about the lyx-users mailing list