ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* [NTG-context] Why is only the first frame protruding into the margin?
@ 2024-05-16 22:05 madiazm.eoicc
  2024-05-17  5:27 ` [NTG-context] " garulfo
  2024-05-17  7:46 ` Wolfgang Schuster
  0 siblings, 2 replies; 13+ messages in thread
From: madiazm.eoicc @ 2024-05-16 22:05 UTC (permalink / raw)
  To: ntg-context

Hi,
I used some code from the meta-fun manual to recreate a labelled frame around my sections. But the first framedtext protrudes a couple of mm into the margin. Only the first one in the page. I intentionaly added other sections and the frames aline to the margin ok.
I tried to put something before the first frame (noindentation, dontleavehmode) because I sometimes read it solves problems, but not the case here.
so Why is the first frame protruding and only the first?


\definepapersize[vertical][A4, portrait]
\definepapersize[horizontal][A4, landscape] 
\setuppapersize[vertical]


\setuplayout[location=middle,
             marking=off,
             topspace=1cm,
             topdistance=0cm,
             backspace=2.5cm,           
             height=fit,
             width=fit,
             rightedge=5mm,
             rightedgedistance=0cm,
             rightmargin=20mm,
             rightmargindistance=7mm,
             leftmargin=1.5cm,
             header=1cm,
             headerdistance=.5cm,
             bottomspace=.5cm,
             bottomdistance=0mm,
             footer=.8cm,
             footerdistance=.2cm,
             setup=strict,]



\startuseMPgraphic{FunnyFrame}
picture p ; numeric w, h, o ;
p := textext.rt(\MPstring{FunnyFrame}) ;
w := OverlayWidth ; h := OverlayHeight ; o := BodyFontSize ;
p := p shifted (2o,h-ypart center p) ; draw p ;
drawoptions (withpen pencircle scaled .25pt withcolor blue) ;
draw (2o,h)--(0,h)--(0,0)--(w,0)--(w,h)--(xpart urcorner p,h) ;
%draw boundingbox p ; %%%quitamos el frame pequeño
setbounds currentpicture to unitsquare xyscaled(w,h) ;
\stopuseMPgraphic

\defineoverlay[FunnyFrame][\useMPgraphic{FunnyFrame}]
\defineframedtext[FunnyText][width=.85\textwidth, height=20mm, frame=off,  background=FunnyFrame, align=flushright,location=right, after={\blank[2*big]}]%foregroundsytel amplía la palabra Apartado

\def\FrameTitle#1%
{\setMPtext{FunnyFrame}{\hbox spread 1em{\hss\strut \color[blue]{\tfx Apartado #1}\hss}}}

\setMPtext{FunnyFrame}{} % initialize the text variable



\define[2]\firstHeadings{%
\dontleavehmode \switchtobodyfont[miCorm] 
\FrameTitle#1%

\dontleavehmode \startFunnyText  {\switchtobodyfont[miCorm,20.7pt] #2} \stopFunnyText
}

\setuphead [section] [color=blue, command=\firstHeadings, indentnext=no]


\starttext
\noindentation 
\dontleavehmode 

\startsection[title=Aspectos generales]


Esta guía contiene toda la documentación necesaria para administrar la prueba unificada de certificación que ha diseñado la comisión de alemán. Se ruega al profesorado\footnote{Todas las alusiones a la forma del masculino genérico que se recogen en este documento deberán entenderse referidas a la condición masculina o femenina de cada persona según corresponda.} que se familiarice con las secciones del documento a través del índice y acuda a ellas según vaya siendo necesario, de manera que se pueda administrar y corregir la prueba de la manera más satisfactoria posible.
\stopsection


\startsection[title=another section]
Las carpetas con las pruebas aparecen nombradas por idioma, nivel y set de pruebas, no apareciendo ninguna referencia a convocatorias anuales ni tampoco fechas. Sí aparece la referencia a la convocatoria en cada una de las guías de administración para los diferentes niveles.
 \stopsection
\startsection[title=another section]
La carpeta correspondiente a cada nivel contiene las distintas actividades de lengua, los audios para CTO y el audio/vídeo base para la mediación escrita. Además contiene esta guía con la información necesaria para tener una visión global de la prueba: los solucionarios, transcripciones, tablas de corrección, tablas de conversión y la rúbrica para la mediación escrita. Igualmente se incorporarán o enlazarán subcarpetas con los archivos necesarios para las pruebas orales: monólogos, diálogos y mediaciones orales.
 \stopsection

\stoptext
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2024-05-18 11:14 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-16 22:05 [NTG-context] Why is only the first frame protruding into the margin? madiazm.eoicc
2024-05-17  5:27 ` [NTG-context] " garulfo
2024-05-17  7:38   ` madiazm.eoicc
2024-05-17  7:46 ` Wolfgang Schuster
2024-05-17  9:02   ` madiazm.eoicc
2024-05-17  9:21     ` madiazm.eoicc
2024-05-17 14:44     ` Pablo Rodriguez via ntg-context
2024-05-17 18:22       ` madiazm.eoicc
2024-05-17 18:46         ` madiazm.eoicc
2024-05-18 11:14           ` Pablo Rodriguez via ntg-context
2024-05-17 21:41         ` Hans Hagen via ntg-context
2024-05-17 22:45           ` madiazm.eoicc
2024-05-18 10:57         ` Pablo Rodriguez via ntg-context

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).