Re: [NTG-context] orphan headline

2016-05-27 Thread Wolfgang Schuster

Pablo Rodriguez 
26. Mai 2016 um 21:29

In a much simpler case, it seems to work:

\setuphead[section]
[style=\ss\tfa, after={\hrule\blank[samepage,big]}]
%~ [style=\ss\tfa, after={\hrule\blank[big]}]

\setuphead[subsection]
[style=\ss, after={\hrule\blank[samepage,medium]}]
%~ [style=\ss, after={\hrule\blank[medium]}]

\starttext
\dorecurse{10}{\section{Section}
\input knuth
\subsection{Subsection}
\input zapf}
\stoptext

Do you really need headings to be inside framed texts?

A good idea but it can be improved.

\definevspace[sectionrule][3mm]

\setuphead
  [section]
  [   width=0.8\textwidth,
   commandafter={\vspace[sectionrule]\hrule},
 before={\blank[0.5cm]},
  after={\blank[1cm]}]

\starttext

\section{\input ward }

\subject{\input ward }

\stoptext

Wolfgang
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Adjusting Kerning/Spacing between Letter

2016-05-27 Thread Hans Hagen

On 5/25/2016 9:44 AM, Meer, Hans van der wrote:



On 02 Jan 2015, at 11:42, Hans Hagen  wrote:

On 1/2/2015 12:56 AM, Malte Stien wrote:

Hi,

I am trying to typeset some strings in {\tt ...}, but they turn out to be 
pretty wide. So, I would like to compress those bits of text a little. Any 
hints on how I could do that locally, that is without adjusting the entire font.


\starttext
   \definecharacterkerning[tight][factor=-.5]

   test {\tt \setcharacterkerning[tight]tight} test

\stoptext

(Btw, there is a narrow monospaced lm font)


I implemented it by redefining \tt:
  \definecharacterkerning[tight][factor=-.075]
  \let\oldtt=\tt
  \def\tt{\setcharacterkerning[tight]\oldtt}

However, I find this a bit of a kludge. But opinions may differ, of course.
Can this be done in a more general way? For example by setting some font 
feature?


no, becasue it is independent of font features (and also less efficient 
that using a narrow tt font)


Hans

-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] Buffered metapost function freezes random numbers

2016-05-27 Thread Hans Hagen

On 5/25/2016 7:09 PM, DesdeChaves wrote:

For educational purposes I try to simulate a ammeter for reading practice.
I would like create six or more ammeter with different readings, but i'm
not able to do that because metapost create the same random number every
time I call the buffer that defines my ammeter.

How can I fix that?

Thanks

Jorge

My code:


\startbuffer[ammeter]
\startMPcode
   r := 4cm; len := 10bp; min_thickness := 1.75bp; hour_thickness := 3bp;
  path cadran; cadran = fullcircle scaled (2r);
 numeric escala;
 escala := 0;
 for i = 50 upto 70:
if i mod 5 = 0:
  j := i div 5; angl := 90-30j;
  freelabel("\tfb\bf" & decimal escala, (r+len)*dir angl, r*dir
angl);
  draw ((r, 0) -- (r - len, 0)) rotated angl withpen pencircle
scaled min_thickness;
  escala:= escala + 0.5;
else:
  angl := 90 - 6i;
  draw ((r, 0) -- (r - .5len, 0)) rotated angl;
fi
 endfor
pickup pencircle scaled min_thickness;
numeric  minute;
%randomseed := uniformdeviate infinity;
minute:= 50 + uniformdeviate(20);
 pair A, B, C;
A:=1.6r*right+.5r*up;
C:=1.6r*right+.8r*up;
B:=1.1r*left;
 drawarrow origin -- r*dir(90-minute*6) cutends (0, 1.5len);
fill fullcircle scaled .75len;
draw unitsquare xscaled 3.2r yscaled 1.5r shifted B;
label("\tfb I (A)", 1.2r*up+1.6r*right) withcolor red;
draw fullcircle scaled 2len shifted A;
draw fullcircle scaled 2len shifted C;
\stopMPcode
\stopbuffer



\startbuffer[programa]

\placefigure[center,nonumber]{}{
\startcombination[2*1]
{\externalfigure[ammeter][type=buffer,width=8cm]}{\_\_\_\_\_\_\_\_\_\_$\pm$\_\_\_\_\_\_\_\_}
{\externalfigure[ammeter][type=buffer,width=8cm]}{\_\_\_\_\_\_\_\_\_\_$\pm$\_\_\_\_\_\_\_\_}
}
\stopcombination


\stopcombination in wrong spot


\stopbuffer


\starttext

\dorecurse{3} {\getbuffer[programa]}

\stoptext


disable object reuse

\startplacefigure
\startcombination[2*1]

{\externalfigure[ammeter][type=buffer,object=no,width=8cm]}{\_\_\_\_\_\_\_\_\_\_$\pm$\_\_\_\_\_\_\_\_}

{\externalfigure[ammeter][type=buffer,object=no,width=8cm]}{\_\_\_\_\_\_\_\_\_\_$\pm$\_\_\_\_\_\_\_\_}
\stopcombination
\stopplacefigure

\stopbuffer



-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: 038 477 53 69 | www.pragma-ade.com | www.pragma-pod.nl
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___

Re: [NTG-context] orphan headline

2016-05-27 Thread Andrea Valle
Thanks a lot  Wolfgang


--
Andrea Valle
--
CIRMA - StudiUm
Università degli Studi di Torino
--> http://www.cirma.unito.it/andrea/
--> http://www.fonurgia.unito.it/andrea/
--> http://www.flickr.com/photos/vanderaalle/sets/
--> http://vimeo.com/vanderaalle
--> andrea.va...@unito.it
--

"This is a very complicated case, Maude. You know, a lotta ins, a lotta outs, a 
lotta what-have-yous." 
(Jeffrey 'The Dude' Lebowski)

> Your lack of a working minimal example makes it hard to give a solution

Sorry, I know, but I didn’t know to reproduce the situation.

> but adding changing the way how the frame is added should improve things.
> 
> \startsetups[section:andrea]
> \ifconditional\headshownumber
> \scratchdimenone\dimexpr\headnumberwidth+\headnumberdistance\relax
> \scratchdimentwo\dimexpr\headnumberdistance\relax
> \else
> \scratchdimenone\zeropoint
> \scratchdimentwo\zeropoint
> \fi
> 
> \startframedtext[offset=0.25cm,loffset=\scratchdimenone,rulethickness=0.01cm,frame=off,bottomframe=on]
> \dontleavehmode\llap{\headnumbercontent\hskip\scratchdimentwo}
> \headtextcontent
> \stopframedtext
> \stopsetups
> 


look likes it solves all the problems! I really have no idea of what’s going on 
here. Luckily this mailing list is super friendly.
Manuals are cool, but I always miss the big picture that would allow me to 
generalise over a problem!


Thanks

Best




> \defineheadalternative[section:andrea][alternative=vertical,renderingsetup=section:andrea]
> 
> \setuphead
>   [section]
>   [alternative=section:andrea,
>numberwidth=1em,
> before={\blank[0.5cm]},
>  after={\blank[1cm]}]
> 
> \starttext



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

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___