Re: [NTG-context] mkiv versus mkii: whitespace issues

2015-03-16 Thread Gerben Wierda

On 15 Mar 2015, at 23:24, Wolfgang Schuster schuster.wolfg...@gmail.com wrote:

 
 Am 14.03.2015 um 15:54 schrieb Gerben Wierda gerben.wie...@rna.nl:
 
 I am running into two issues with my mkii-to-mkiv conversion project
 
 - The \chapter command in mkiv uses more whitespace between the header and 
 the first paragraph. How can I influence this?
 
 The different space before the \chapter is caused by the “fixed” keyword for 
 \blank
 which produce different result with MkII and MkIV and the MkIV behaviour need
 to be corrected.
 
 The space after \chapter comes from your \writetolist entry and you can 
 correct
 this with the \GotoPar command at the end of the entry as shown below.
 
  begin example
 \showgrid
 
 \setuphead[chapter][before={\blank[force,2*line]}]
 
 \starttext
 
 \chapter{Knuth}
 
 \writetolist[chapter]{}{}\GotoPar
 
 \input knuth
 
 \stoptext
  end example

Thanks. I tried this

% Every chapter starts with a quote on the LHS page:
\setuphead
  [chapter]
  [page=,
   before={\setups[chapter:before]},
   after={\setups[chapter:after]}]

\startsetups chapter:before
\page[left]
\noheaderandfooterlines
\startalignment[left,nothyphenated]
\startnarrower[4*left]
\em \getbuffer[chapter:quote]
\stopnarrower
\stopalignment
\resetsetups[quote:text]
\page[right]
\noheaderandfooterlines
\blank[force,2*big]
\stopsetups

\startsetups chapter:after
\blank[3*big]
\stopsetups

\definelist[chaptertext]
\setuplist[chaptertext][margin=1.3em,pagecommand=\gobbleoneargument]
\define[1]\ChapterAbstract{\writetolist[chaptertext]{}{\start\itx#1\stop}\GotoPar}


(Adding the \GotoPar at the end) but it did not had any effect. At one place 
(no chapter but an unnumbered title, it doesn’t work as well. Here I now have:

\title[h:grief1]{Intermezzo:\\
A short story about grief}
\writetolist[chapter]{}{Intermezzo: A Short Story about Grief}\GotoPar
\ChapterAbstract{A small fragment of a movie script that beautifully
illustrates the gap between the rational and the real.}

I changed it to 
\title[h:grief1]{Intermezzo:\\
A short story about grief}
\writetolist[chapter]{}{Intermezzo: A Short Story about Grief}\GotoPar
\ChapterAbstract{A small fragment of a movie script that beautifully
illustrates the gap between the rational and the real.}\GotoPar

And that works. So I changed it in another chapter to

\chapter[h:loosely]{Prologue:\\Loosely Coupled Spaghetti}
\ChapterAbstract{Starting with an example of how things can go wrong in a
current Business-IT landscape, we notice that these kinds of problems have
existed almost for as long as IT has existed, and that no proposed `silver
bullet' has ever solved them. The goal of the book is introduced.}\GotoPar

\placeinitial S{\kap{\bf uppose we}} have a system for the approval of loans. 
The
business logic has been put into a Business Rule Engine (BRE)
system\footnote{If you are not technical and terms like `application server',

But there it doesn’t. Apparently, I am still missing something. 

G


 
 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
 ___

___
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] Exporting highlights

2015-03-16 Thread Idris Samawi Hamid ادريس سماوي حامد

Ok, I've made some progress:

On Sun, 15 Mar 2015 17:01:16 -0600, Idris Samawi Hamid ادريس سماوي حامد  
isha...@colostate.edu wrote:



export-highlight.tex==
\setupbackend
   [export=yes,css=highlight.css]


\setupexport[cssfile=highlight.css]
\setupbackend[export=yes]


\definehighlight[emphasis] [style=italic]
\definehighlight[important][style=bold]
\definehighlight[regular][style=\tf]

\starttext

\startchapter[title=Highlights]
\startparagraph
This is \emphasis{emphasis}. This is \important{important}. This is
\regular{regular}.

This is \emphasis{some emphasized text, with \regular{regular} in  
between}.


This is \important{some important text, with \regular{regular} in  
between}.

\stopparagraph
\stopchapter
\stoptext
===

In highlight.css (copied from export-sample.css and modified) I added
these lines:

==
highlight [detail=emphasis]{
font-weight : italic ;
}

highlight [detail=important]{
font-weight : bold ;
}

highlight [detail=regular]{
font-weight : regular ;
}
==


Syntax correction (thanks Aditya!):

.highlight.emphasis {
  font-style: italic;
}

etc.


Challenge 1:
Neither export-highlight-tag.xhtml nor export-highlight-div.xhtml renders
the highlights. What do we need to do?


For italic, see above. For bold, we need

font-weight: bold;


Challenge 2:
export-highlight-div.xhtml breaks the line before a highlight as well as
after a highlight. What is missing here?


display: inline;

So here is exactly what we need:

.highlight.important {
   font-weight: bold;
  font-style: normal;
   display: inline;
}

.highlight.emphasis {
  font-weight: normal;
  font-style: italic;
  display: inline;
}

.highlight.regular {
  font-weight: normal;
  font-style: normal;
  display: inline;
}

Now export-highlight-div.xhtml renders in the browser exactly as in  
export-highlight.pdf.


This is progress: a first step!

Best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523
___
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
___

[NTG-context] Multiline header

2015-03-16 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

how to create multiline header?

This code ignores all attempts to force a new line:


\setupheadertexts[{abc\par def\\ ghi\crlf jkl}]

\starttext
  aaa
\stoptext


Thank you in advance.

Best regards,

Lukas


--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

___
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] Styling captions inside \startcombination ... \stopcombination

2015-03-16 Thread Mojca Miklavec
On Sat, Mar 14, 2015 at 1:10 PM, Hans Hagen pra...@wxs.nl wrote:
 On 3/14/2015 10:50 AM, Mojca Miklavec wrote:

 Hello,

 I'm using the following code to make the figure captions smaller:
  \setupcaptions[style={\switchtobodyfont[8pt]}]

 Now I'm looking for the magic keywoard to also decrease the size of
 captions inside combinations, as in the following case for example
 (otherwise the subcaptions are too big in comparison):

 \setupcaptions[style={\switchtobodyfont[8pt]}]
 \setupexternalfigures[location={default}]
 \starttext
\placefigure{Cows in \ConTeXt}
  {\startcombination[2*1]
{\mirror{\externalfigure[cow][width=4cm]}}{First cow}
{\externalfigure[cow][width=4cm]}{Second cow}
\stopcombination}
 \stoptext


 the obvious:

 \setupcombinations[style={\switchtobodyfont[8pt]}]

I'm sorry and thank you. Blush. I feel ashamed that I actually looked
into the source code and found the following inside pack-com.mkiv:

\setupcombination
  [\c!width=\v!fit,
   \c!height=\v!fit,
   \c!distance=\emwidth,
   \c!location=\v!bottom, % can be something {top,left}
   \c!before=\blank,
   \c!after=,
   \c!inbetween={\blank[\v!medium]},
  %\c!style=,
  %\c!color=,
   \c!nx=2, % new
   \c!ny=1, % new
   \c!align=\v!middle]

However I failed to notice the commented-out command style=. Luckily
I can blame the syntax highlighting that makes the comments more
hidden than the rest of the code ;)

Mojca
___
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] Multiline header

2015-03-16 Thread luigi scarso
On Mon, Mar 16, 2015 at 1:54 PM, Procházka Lukáš Ing. - Pontex s. r. o. 
l...@pontex.cz wrote:

 Hello,

 how to create multiline header?

 This code ignores all attempts to force a new line:

 
 \setupheadertexts[{abc\par def\\ ghi\crlf jkl}]

 \starttext
   aaa
 \stoptext
 


this works, but probably there are better options

\setupheadertexts[\ruledvbox{abc\par def\par ghi\par jkl}]

\starttext
  aaa
\stoptext


-- 
luigi
___
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] currentreferencerealpage wrong (how to detect even/odd pages?)

2015-03-16 Thread Hans Hagen

On 3/15/2015 8:13 PM, Harald Koenig wrote:

On Mar 15, Wolfgang Schuster wrote:




Am 15.03.2015 um 16:40 schrieb Harald Koenig 
koe...@tat.physik.uni-tuebingen.de:

Hi,

right now I use \currentreferencerealpage to detect if I'm on an even or odd 
page
(because my picture placement rules depend on it) like this:

\newcount\bildpage
\bildpage=1
% ...
\def\bild#1...{%
 {\global\bildpage=\realpageno}%
 \ifodd\bildpage \def\eo{o}\else \def\eo{e}\fi
 % ...
 \if o\eo odd...\else even...\fi
\message{ bildpage=\the\bildpage \space eo=\eo \space 
currentreferencerealpage=\currentreferencerealpage \space  }%
}

but now I notice that for some pages/pictures the value of 
\currentreferencerealpage
is not correct (only for the first picture on a new page?):-(


To test whether you’re on a left or right page you can use the \signalrightpage 
and \doifrightpageelse commands


this doesn't seem to work well -- at least not within \placefigure

I've tried this replacement in my \bild macro which should be equivalent (or 
better?)

%   \ifodd\bildpage \def\eo{o}\else \def\eo{e}\fi
%   \ifodd\bildpage \def\lr{r}\else \def\lr{l}\fi
 \dontleavehmode\signalrightpage
 \doifrightpageelse{\def\eo{o}}{\def\eo{e}}%
 \doifrightpageelse{\def\lr{r}}{\def\lr{r}}%

(with and without \dontleavehmode\signalrightpage)
and now I get more wrong picture placements for the first picture on some 
pages...


you need to make sure that the signal travels with the stuff you're 
checking


btw, if you use side floats, the inner/outer variants do this auto 
left/right stuff


-
  Hans Hagen | PRAGMA ADE
  Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | voip: 087 875 68 74 | 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] Multiline header

2015-03-16 Thread Procházka Lukáš Ing . - Pontex s . r . o .

Hello,

On Mon, 16 Mar 2015 14:00:54 +0100, luigi scarso luigi.sca...@gmail.com wrote:


On Mon, Mar 16, 2015 at 1:54 PM, Procházka Lukáš Ing. - Pontex s. r. o. 
l...@pontex.cz wrote:


Hello,

how to create multiline header?

This code ignores all attempts to force a new line:


\setupheadertexts[{abc\par def\\ ghi\crlf jkl}]

\starttext
  aaa
\stoptext




this works, but probably there are better options

\setupheadertexts[\ruledvbox{abc\par def\par ghi\par jkl}]


\setupheadertexts[\vbox{abc\par def\par ghi\par jkl}]

works, too, but a nicer solution would be appreciated...

Lukas



\starttext
  aaa
\stoptext





--
Ing. Lukáš Procházka | mailto:l...@pontex.cz
Pontex s. r. o.  | mailto:pon...@pontex.cz | http://www.pontex.cz
Bezová 1658
147 14 Praha 4

Tel: +420 241 096 751
Fax: +420 244 461 038

___
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] Multiline header

2015-03-16 Thread Wolfgang Schuster

 Am 16.03.2015 um 13:54 schrieb Procházka Lukáš Ing. - Pontex s. r. o. 
 l...@pontex.cz:
 
 Hello,
 
 how to create multiline header?
 
 This code ignores all attempts to force a new line:
 
 
 \setupheadertexts[{abc\par def\\ ghi\crlf jkl}]

\startsetups[headertext]
\startframed[frame=off,align=flushleft,width=fit]
abc\\
def\\
ghi\\
jkl
\stopframed
\stopsetups

\setupheadertexts[\directsetup{headertext}]

\starttext
 aaa
\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] currentreferencerealpage wrong (how to detect even/odd pages?)

2015-03-16 Thread Harald Koenig
On Mar 15, Wolfgang Schuster wrote:

 
  Am 15.03.2015 um 16:40 schrieb Harald Koenig 
  koe...@tat.physik.uni-tuebingen.de:
  
  Hi,
  
  right now I use \currentreferencerealpage to detect if I'm on an even or 
  odd page
  (because my picture placement rules depend on it) like this:
  
  \newcount\bildpage
  \bildpage=1
  % ...
  \def\bild#1...{%
  {\global\bildpage=\realpageno}%
  \ifodd\bildpage \def\eo{o}\else \def\eo{e}\fi
  % ...
  \if o\eo odd...\else even...\fi
 \message{ bildpage=\the\bildpage \space eo=\eo \space 
  currentreferencerealpage=\currentreferencerealpage \space  }%
  }
  
  but now I notice that for some pages/pictures the value of 
  \currentreferencerealpage
  is not correct (only for the first picture on a new page?):-(
 
 To test whether you’re on a left or right page you can use the 
 \signalrightpage and \doifrightpageelse commands

this doesn't seem to work well -- at least not within \placefigure

I've tried this replacement in my \bild macro which should be equivalent (or 
better?)

%   \ifodd\bildpage \def\eo{o}\else \def\eo{e}\fi
%   \ifodd\bildpage \def\lr{r}\else \def\lr{l}\fi
\dontleavehmode\signalrightpage
\doifrightpageelse{\def\eo{o}}{\def\eo{e}}%
\doifrightpageelse{\def\lr{r}}{\def\lr{r}}%

(with and without \dontleavehmode\signalrightpage)
and now I get more wrong picture placements for the first picture on some 
pages...


I vaguely remember that 

 {\global\bildpage=\currentreferencerealpage}%
 {\global\bildpage=\realpageno}%

was a hack from Hans to work arround issues to get the real page number 
within those floats ?!


Harald
-- 
I hope to die  ___   _
before I *have* to use Microsoft Word.,   0--,|/OOO\
Donald E. Knuth, 02-Oct-2001 in Tuebingen._/  /  /OOO\
\  \/OOO\
  \ O|//
   \/\/\/\/\/\/\/\/\/
Harald Koenig   //  / \\  \
koe...@tat.physik.uni-tuebingen.de ^   ^
___
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
___

[NTG-context] Different output with \blank[force, ...] in MkII and MkIV

2015-03-16 Thread Wolfgang Schuster
Hi,

the force keyword for the \blank commands create an unwanted space in MkIV when 
you use it at the begin of page compared with MkII.

Attached are the results from MkII and MkIV which have been produced with the 
following example. In MkIV the first page has an extra line while the space on 
the second page is smaller than a complete line.

 begin example
\setuppapersize[A7][A7]

\showgrid

\starttext

\blank[force,line]

text

\page

text

\blank[force,line]

text

\stoptext
 end example

Kind regards,
Wolfgang


blank-mkii.pdf
Description: Adobe PDF document


blank-mkiv.pdf
Description: Adobe PDF document
___
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
___

[NTG-context] tlig in the export

2015-03-16 Thread Idris Samawi Hamid ادريس سماوي حامد

Dear gang,

It appears that internal opentype feature tlig is not supported in the  
export. For current purposes this is not critical; but not sure if this is  
intentional or a bug, so reporting it here.


===
\setupbackend[export=yes]

\starttext

\startchapter[title=The tlig feature]
\startparagraph
In \TeX\ it is still common to use two keyboard dashes to obtain an  
en-dash. An en dash is used to indicate a number range, e.g., 1785--1906.


In \TeX\ it is still common to use three keyboard dashes to obtain an  
em-dash. An em-dash is used to indicate a prominent parenthesis---in  
modern usage the en-dash is becoming more popular for this task---as well  
as between the end of an epigraph and its author.


In \Context\ there is a dedicated control sequence for the en-dash. An  
en-dash is used to indicate a number range, e.g., 1785\endash{}1906.


In \Context\ there is a dedicated control sequence to obtain an em-dash.  
An em-dash is used to indicate a prominent parenthesis\emdash{}in modern  
usage the en-dash is becoming more popular for this task\emdash{}as well  
as between the end of an epigraph and its author.

\stopparagraph
\stopchapter
\stoptext
===

Thanks and best wishes
Idris
--
Idris Samawi Hamid
Professor of Philosophy
Colorado State University
Fort Collins, CO 80523

export-tlig.tex
Description: TeX document


export-tlig.pdf
Description: Adobe PDF document


export-tlig-div.xhtml
Description: application/xhtml
___
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] Indentation within footnotes

2015-03-16 Thread Pablo Rodriguez
 03/15/2015 10:37 PM, Idris Samawi Hamid ادريس سماوي حامد wrote:
 On Sun, 15 Mar 2015 15:07:57 -0600, Pablo Rodriguez wrote:
 
 I’m not sure whether this is clearer to me. It seems that your approach
 enables indenting by setting vertical space in paragraphs.
 I may be missing something, since I’d bet that the setups for notes
 approach is clearer.
 
 Didn't mean to confuse you, all you need is
 
 \setupnotation[footnote][indenting={yes,big}] % no next

Many thanks for the explanation, Idris.

I forgot to add big to indenting in \setupnotation.

This was the reason why it didn’t work. And why setups aren’t needed there.

Best


Pablo
-- 
http://www.ousia.tk
___
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
___