- Questo topic ha 3 risposte, 2 partecipanti ed è stato aggiornato l'ultima volta 15 anni, 5 mesi fa da .
-
Topic
-
Salve a tutti,ho un un problema con la definizione degli stili per i titoli. Vorrei avere la dimensione della numerazione che si centri e si adatti dinamicamente al crescere del numero di righe del testo del titolo.
Vi sottopongo nel seguito i due stili con cui sto “giocando” e che presentano il problema:
`
\definefont[BigFontOne][Sans sa 3]\setupcolors[state=start] % otherwise you get greyscale
%definizione di un colore
\definecolor[headingcolor][r=0.4,b=0.4,g=0.4]
\definecolor[textheadcolor][r=0.3,b=0.3,g=0.3]
\definecolor[numberheadcolor][r=0,b=0.7,g=0]%Coloriamo i titoli
%\setuphead[section,chapter,subject,subsection]
\setuphead[section,chapter,subject,subsection][numbercolor=numberheadcolor, textcolor=textheadcolor]%font del capitolo
%\setuphead[chapter][numberstyle=\BigFontOne,textstyle={\ss\bfd},%style={\ss\bfd}, before={}, after={\nowhitespace\hairline\blank[2*line]}]\setuphead[chapter]
[
numberstyle=\BigFontOne,
textstyle={\ss\bfd},
before={},
after={\nowhitespace\color[darkred]\hl[38]\blank[2*line]}
]\setuphead[section,subject]
[
%numberstyle=\BigFontTwo\bf,
%textstyle={\ss\bfc},
style={\ss\bfc},
before={\bigskip},
after={\nowhitespace\color[darkred]\hl[38]\blank} %\hairline
]\setuphead[subsubject,subsection]
[
%numberstyle=\BigFontTwo\bf,
%textstyle={\ss\bfc},
style={\ss\bfb},
before={\bigskip},
after={\nowhitespace\color[darkred]\hl[38]\blank} %\hairline
]\starttext
\chapter{foo dsfdsf fdsf dsfdsf dsf fdsf f dsf ds f dsf ds f dsf dsf f w fds f ds fds f sdf dsf }
\section{goo}
hello
\stoptext
`e
`
\def\BookchapterCommand#1#2{\framed[frame=off,rightframe=off]{\hbox{#1}\space}\framed[frame=off,leftframe=on]{\space\vbox{#2}}}
\setuphead[chapter][command=\BookchapterCommand,page=chapter,numbercolor=red,alternative=inmargin,numberstyle=\ss\bfd]
\setupcolors[state=start]
\setupcolor[rgb]
\definecolor[lightred][r=0.8,g=0.85,b=1]\def\SectionCommand#1#2%
{\framed
[frame=off,
width=\textwidth,
align={right},
background=color,
backgroundcolor=lightred]
{\hbox to.011\textwidth{}\hbox to.05\textwidth{\strut#1}\quad
\vtop{\hsize\dimexpr\hsize-.061\textwidth-1em\relax\begstrut#2
\endstrut}}}\setuphead[section][command=\SectionCommand,numbercolor=red]
\def\SubsectionCommand#1#2%
{\framed
[frame=off,
width=\textwidth,
align={right},
background=color,
backgroundcolor=lightgray]
{\hbox to.011\textwidth{\strut#1}\vtop{\hsize\dimexpr\hsize-.011\textwidth-1em\relax\begstrut#2
\endstrut}}}\setuphead[subsection][command=\SubsectionCommand,number=no,style=\ss]
\setuphead[subsubsection][command=,style=slanted,number=no,before={\blank[big]},before={\testpage[1]},after=\nowhitespace]
\starttext
\chapter{foo}
\section{goo}
hello
\stoptext\starttext
\chapter{test cxvxvdfgdf dfsds fg d dfg df gdfhghf vb chdfc cffbgdfgdg}
fdsfsfdsf
\section{test vbcvbcxvd dfdf df s fs s dzs xz x sd s fs fs f sf sf s fs df sdf scx xz cxz c xzc zxc z f zsf sf d fd f dzv cz v cv cv xcv xc vcx}
sfsdfdsfdf
dsfdsfsdfdsfdsfdsfds\subsection{test}
fgddsgdfgdfgdf
\stoptext
`Grazie
- Devi essere connesso per rispondere a questo topic.