Risposte nei forum create
-
AutoreRisposte
-
::
Si funziona! sei troppo bravo.
Se proprio si vuole essere precisi, l’allineamento verticale non è sempre corretto, per esempio se si sostituisce la formula con
`a=\int_\sum b^2`
si vede abbastanza bene.Infine ci sarebbe da sistemare la questione se la formula finale \`e numerata.
Comunque mi ritengo soddisfatto.
Grazie
ES
::
ecco una soluzione che funziona solo per mkiv:
`\definedescription
[proof]
[text=Proof.]\setupdescriptions
[proof]
[width=broad,
distance=0.5em,
location=serried,
headstyle=it,
indentnext=yes,
indenting=yes,
closesymbol=\mathematics{\square},
closecommand=\ifmmode\eqno\else\wordright\fi]`ES
::
Probabilmente è scritto male, comunque c’è qualcosa.`\setuplist
[part,chapter,section,subsection,subsubsection]
[partnumber=no]\def\PartCommand#1#2#3{%
\bfb \color[red]{\cap{#2}}}
\setuplist[part]
[alternative=none,
before={\blank[1em]},
command={\PartCommand},
color=red]
\setuplist[chapter][width=0mm,style=bold, color=red, before={\blank[medium]}, after={\blank[small]}]
\setuplist[section]
[width=0mm]
\setuplist[subsection][width=0mm]`Ricordati se metti le parti con il comando \part{} forse ti interesserà includere anche
`\setuppagenumbering
[alternative=doublesided,
style=cap,
location={footer,margin},
way=bytext,
partnumber=no]`Ciao
ES
::
Ecco una prima soluzione (ovviamente opera di Luigi) per un testo che si spezza al più su due pagine`\newdimen\SpaceLeft
\def\CheckSpace{%
\ifdim\pagetotal=0pt\SpaceLeft=\vsize\else\SpaceLeft=\pagegoal\advance\SpaceLeft
by -\pagetotal\advance\SpaceLeft by -2\lineheight\fi}%\setupcolors[state=start]
\long\def\StartBg#1\StopBg{%
\bgroup
\setbox8000=\vbox{\hsize=\dimexpr\textwidth-1em\relax#1}
\CheckSpace% \the\SpaceLeft\the\ht8000 \the\dp8000
\ifdim\dimexpr(\ht8000+\dp8000)>\SpaceLeft\relax
%
\setbox8001=\vsplit8000 to \SpaceLeft%
\setbox8001=\vbox{\unvbox8001}%
%
\setupbackground
[bottomframe=off,
rulethickness=1pt,
rightframe=on,width=\textwidth,
leftframe=on]
\startbackground\unvbox8001\stopbackground%\setupbackground
[bottomframe=on,
rulethickness=1pt,
rightframe=on,width=\textwidth,
leftframe=on]
\startbackground\unvbox8000\stopbackground%
\else
\setupbackground
[bottomframe=on,
rulethickness=1pt,
rightframe=on,
leftframe=on]
\startbackground #1\stopbackground%
\fi
\egroup
}\setupbackground
[bottomframe=on,
rulethickness=1pt,
rightframe=on,
leftframe=on]\starttext
\startbackground
\input knuth
\stopbackgrounde poi
\StartBg
\input knuth
\input knuth
\input knuth
\StopBg\stoptext`
Una soluzione alternativa potrebbe essere usare il comando \definetextbackground e settare la variabile mp in modo adeguato.
`\setupcolors[state=start]
\enableregime[utf]
\def\Linea{\startMPcode
draw (0,0) — (\the\textwidth-1,0) withpen pencircle scaled 1bp withcolor red;
\stopMPcode
}
\definetextbackground
[Prova]
[
mp=background:mp,
location=paragraph,
rulethickness=1pt,
width=broad,
leftoffset=1em,
rightoffset=1em,
after={\Linea}
]
\startuseMPgraphic{background:mp}
path p;
for i = 1 upto nofmultipars :
p = (multipars
topenlarged 5pt
bottomenlarged 10pt);
fill p withcolor lightgray ;
draw leftboundary p withpen pencircle scaled 1bp withcolor red ;
draw rightboundary p withpen pencircle scaled 1bp withcolor red ;
endfor;
\stopuseMPgraphic\starttext
\startProva
\input knuth
\input knuth
\input knuth
\input knuth
\input knuth
\stopProva\stoptext`
Può succedere però che la “\Linea” venga disegnata a pagina nuova 🙁
::
Probabilmente c’è una soluzione più elegante che non fa uso del pacchetto TikZ.Anche se non è la risposta a quello che chiedi tu , ti mostro il codice (spero corretto) per fare quello che dici tu in ConTeXt
`
\setupcolors[state=start]\setuphead[section]
[command=\TheSectionCommand]
\def\TheSectionCommand#1#2{\framed[frame=off,background=color,backgroundcolor=red]{\vbox{#1 \ #2}}}\starttext
\section{Sezione in riquadro}\stoptext`
da compilare con texexec nomefile.tex.
CiaoES
::
Un modo, forse non elegante, lo puoi trovare qui
http://www.texample.net/tikz/examples/fancy-chapter-headings/.Fa uso dei due pacchetti titlesec e TikZ.
Ciao
ES
-
AutoreRisposte