[NTG-context] [[wnsOTaa] Dr. Donald E. Knuth to be honored with third Dr. Peter Karow Award during ATypI Amsterdam

2013-09-22 Thread luigi scarso
https://blogs.adobe.com/typblography/2013/09/dr-peter-karow-award.html

PS:
[wnsOTaa] (well,  not so Off Topic after all )
-- 
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] Alignment table with comma, and long long space after

2013-09-22 Thread Xan
It does not work with that:

%%% Per a què les taules se me puguin alinear amb les comes
\chardef\characteralignmentmode=2
\chardef\characteralignmentmode\plustwo

%%% 
http://randomdeterminism.wordpress.com/2012/11/18/separation-of-content-and-presentation-for-tables-part-1/
\startsetups table:style
  \setupTABLE[row][first][background=color, backgroundcolor=tablecolor, 
color=black, align={middle,lohi},style=ss]
  \setupTABLE[column][1][align={right,lohi}]
  
\setupTABLE[column][2][align={left,lohi},alignmentcharacter={,},aligncharacter=yes]
%  \setupTABLE[column][2][width=.20\textwidth]
  \setupTABLE[loffset=1mm,roffset=1mm]
  \setupTABLE[frame=off]
  \setupTABLE[topframe=on,bottomframe=on]
  \setupTABLE[column][first][leftframe=on]
  \setupTABLE[column][last][rightframe=on]
\stopsetups


What can I do?

Xan.
On Sat, 21 Sep 2013 18:55:51 +0200
Wolfgang Schuster schuster.wolfg...@gmail.com ha escrit:

 
 Am 21.09.2013 um 16:22 schrieb Xan dxpubl...@telefonica.net:
 
  Hi,
  
  I have this
  
  \startsetups table:style
   \setupTABLE[row][first][background=color, backgroundcolor=tablecolor, 
  color=black, align={middle,lohi},style=ss]
   \setupTABLE[column][1][align={right,lohi}]
   
  \setupTABLE[column][2][align={left,lohi},alignmentcharacter={,},aligncharacter=yes]
  %  \setupTABLE[column][2][width=.20\textwidth]
   \setupTABLE[loffset=1mm,roffset=1mm]
   \setupTABLE[frame=off]
   \setupTABLE[topframe=on,bottomframe=on]
   \setupTABLE[column][first][leftframe=on]
   \setupTABLE[column][last][rightframe=on]
  \stopsetups
  
  \placefigure[here]{Diverses mesures}{
  \bTABLE[setups={table:header, table:frame, table:style}]
  \bTABLEhead
  \bTR \bTD Esdeveniment \eTD \bTD Mesura (m) \eTD \eTR
  \eTABLEhead
  \bTABLEbody
  \bTR \bTD Distància mitjana Terra-Lluna \eTD \bTD 150.000.000.000 \eTD \eTR
  \bTR \bTD Diàmetre mitjà terrestre \eTD \bTD 12 800.000 \eTD \eTR
  \bTR \bTD Distància Palma-Alcúdia \eTD \bTD 75.000 \eTD \eTR
  \bTR \bTD Diàmetre mitjà de Júpiter \eTD \bTD 140.000.000 \eTD \eTR
  \bTR \bTD L'altura d'una persona \eTD \bTD 1,75 \eTD \eTR
  \bTR \bTD La distància mitjana entre el Sol i Alfa-Centauri \eTD \bTD 
  40.790.494.000.000.000 \eTD \eTR
  \eTABLEbody
  \eTABLE}
  
  
  but ConTeXt produces a lot of space after 1,75.
  
  How can I do for second column fits the content?
 
 Add the following line to your setups for the table.
 
 \chardef\characteralignmentmode\plustwo
 
 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] Alignment table with comma, and long long space after

2013-09-22 Thread Wolfgang Schuster

Am 22.09.2013 um 19:13 schrieb Xan dxpubl...@telefonica.net:

 It does not work with that:
 
 %%% Per a què les taules se me puguin alinear amb les comes
 \chardef\characteralignmentmode=2
 \chardef\characteralignmentmode\plustwo
 
 %%% 
 http://randomdeterminism.wordpress.com/2012/11/18/separation-of-content-and-presentation-for-tables-part-1/
 \startsetups table:style
  \setupTABLE[row][first][background=color, backgroundcolor=tablecolor, 
 color=black, align={middle,lohi},style=ss]
  \setupTABLE[column][1][align={right,lohi}]
  
 \setupTABLE[column][2][align={left,lohi},alignmentcharacter={,},aligncharacter=yes]
 %  \setupTABLE[column][2][width=.20\textwidth]
  \setupTABLE[loffset=1mm,roffset=1mm]
  \setupTABLE[frame=off]
  \setupTABLE[topframe=on,bottomframe=on]
  \setupTABLE[column][first][leftframe=on]
  \setupTABLE[column][last][rightframe=on]
 \stopsetups
 
 
 What can I do?

You can show us a *complete* minimal example.

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] Alignment table with comma, and long long space after

2013-09-22 Thread Xan
Yes:



 You can show us a *complete* minimal example.
 
 Wolfgang
% Regime
\enableregime[utf]

% Choose a language, and associated hyphenation rules.
\mainlanguage[ca]

% AMSTHM equivalent
%% Exercici
%% Mirar http://wiki.contextgarden.net/Command/setupdescriptions
%%% posar alternative=left per identar tots els continguts | alternative=serried per tractar el contingut com un paràgraf ordinari
\defineenumeration
  [exercici]
  [alternative=serried,text={\startcolor[darkblue]Exercici\stopcolor},stopper={.\space},left={\bgroup},right={\egroup},width=fit,headstyle=\ss,distance=0.25em,width=fit]

%\defineenumeration
%  [exerciciimportant]
%  [text={Exercici},headstyle=bold,between=\blank,titledistance=0em,textdistance=1em,
%stopper={.\space},location=serried,left={\bgroup\bf},right={\egroup},width=fit,before={\bgroup\startframedtext[background=screen,frame=off,width=broad]},after={\stopframedtext\egroup}]

% Intent fer una comanda per a fer requadres a les coses importants
% http://www.ntg.nl/pipermail/ntg-context/2013/074823.html
\def\important{\dodoubleempty\doimportant}
\def\doimportant[#1][#2]{\bgroup
\ifsecondargument
   \startframedtext[background=color,backgroundcolor=#2,frame=off,width=broad]%
   #1
\else
   \startframedtext[background=screen,frame=off,width=broad]%
   #1
\fi
\stopframedtext
\egroup}

\defineframedtext
  [important]
  [background=screen,
   frame=off,
   width=broad]

% Per a veure què falla amb els símbols
\enabletrackers [fonts.missing]


% Choose a font
%\usetypescript[pagella][ec]
%\setupbodyfont[pagella,11pt]
\setupbodyfont [cmr,11pt] % cmr, 11pt

% Margins
%\setuplayout[topspace=2cm, backspace=2cm, header=1.5cm,margin=2cm,width=middle,footer=1cm]

% Colors
\definecolor[headingcolor][c=1,m=0.5431,y=0,k=0.5451]
\definecolor[tablecolor][b=1,t=.5,a=1]

% Page number
\setuppagenumbering [location={header,right}]

% Paper size
\setuppapersize [A4]

% Italic in emph (by default is slanted)
\setupbodyfontenvironment[default][em=italic]

% Headers and footers
\setupfooter[text][style={\ss\tfx},color=headingcolor,before={\hrule}]
\setupheader[text][style={\ss},color=headingcolor,after={\hrule}]

%% Display of headers
\setuphead[title][style={\tfd},align=middle,before={\begingroup},after={\bigskip\endgroup}]
\setupheads[section,subject][style={\tfc}]
\setupheads[subsubject,subsection][style={\tfb}]
\setuphead[title,chapter,subject,section,subsubject,subsection][color=headingcolor]

%% Per veure els enllaços
\setupinteraction[state=start]

%% Per a BibTeX
\setuppublications[alternative=ams]


%% Taules: estils

%%% Per a què les taules se me puguin alinear amb les comes
\chardef\characteralignmentmode=2
\chardef\characteralignmentmode\plustwo

%%% http://randomdeterminism.wordpress.com/2012/11/18/separation-of-content-and-presentation-for-tables-part-1/
\startsetups table:style
  \setupTABLE[row][first][background=color, backgroundcolor=tablecolor, color=black, align={middle,lohi},style=ss]
  \setupTABLE[column][1][align={right,lohi}]
  \setupTABLE[column][2][align={left,lohi},alignmentcharacter={,},aligncharacter=yes]
%  \setupTABLE[column][2][width=.20\textwidth]
  \setupTABLE[loffset=1mm,roffset=1mm]
  \setupTABLE[frame=off]
  \setupTABLE[topframe=on,bottomframe=on]
  \setupTABLE[column][first][leftframe=on]
  \setupTABLE[column][last][rightframe=on]
\stopsetups

%% Normal
\startsetups table2:style
  \setupTABLE[row][first][background=color, backgroundcolor=tablecolor, color=black, align={middle,lohi},style=ss]
  \setupTABLE[column][1][align={right,lohi}]
  \setupTABLE[column][2][align={left,lohi}]
%  \setupTABLE[column][2][width=.20\textwidth]
  \setupTABLE[loffset=1mm,roffset=1mm]
  \setupTABLE[frame=off]
  \setupTABLE[topframe=on,bottomframe=on]
  \setupTABLE[column][first][leftframe=on]
  \setupTABLE[column][last][rightframe=on]
\stopsetups


%% ConTeXt MIV

%% Capçaleres i peus

%%% Prenc els primers 5 caràcters del sha256 del fitxer (requereix ConTeXt MIV)
\setupfootertexts[\jobname\space(versió \ctxlua{context(os.resultof(sha256sum \jobname.tex | cut -c  -5))}, \currentdate)][]

\starttext


\placefigure[here]{Diverses mesures}{
\bTABLE[setups={table:header, table:frame, table:style}]
\bTABLEhead
\bTR \bTD Esdeveniment \eTD \bTD Mesura (m) \eTD \eTR
\eTABLEhead
\bTABLEbody
\bTR \bTD Distància mitjana Terra-Lluna \eTD \bTD 150.000.000.000 \eTD \eTR
\bTR \bTD Diàmetre mitjà terrestre \eTD \bTD 12 800.000 \eTD \eTR
\bTR \bTD Distància Palma-Alcúdia \eTD \bTD 75.000 \eTD \eTR
\bTR \bTD Diàmetre mitjà de Júpiter \eTD \bTD 140.000.000 \eTD \eTR
\bTR \bTD L'altura d'una persona \eTD \bTD 1,75 \eTD \eTR
\bTR \bTD La distància mitjana entre el Sol i Alfa-Centauri \eTD \bTD 40.790.494.000.000.000 \eTD \eTR
\eTABLEbody
\eTABLE}

\stoptext


prova.pdf
Description: Adobe PDF document
___
If your question is of interest to others as well, please add an entry to 

[NTG-context] Confounding colour conundrums

2013-09-22 Thread Thangalin
Hi,

In the attached example, I thought the word *Website* should be *orange*,
but it is *blue*.

If *color=blue* is removed (from \setupinteraction[state=start]), then the
word *Website* is *dark green*, which is also unexpected, because the only
place *dark green* occurs is in the setuplist for the chapter's page number
(i.e., pagecolor=darkgreen). It appears that the default colour for links
embedded with \useurl bucks trendy traditional *blue* hyperlinks, favouring
*dark green*. (*Black* would also make sense as a default.)

I am confounded because the code explicitly contains the line:

\setupurl[color=orange]

I thought that that would set the external hyperlink colour to *orange*.

In the same document, how do I set:

   - hyperlink colours to *orange*;
   - index page number colours to *red*;
   - table of contents text to *dark cyan*; and
   - table of contents page numbers to *dark green*.

Many thanks.

Kindest regards.


ex.tex
Description: TeX 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] Conditional float references

2013-09-22 Thread Marco Patzer
Hi,

a couple of times the question came up¹²³ how to create more
intelligent referencing. There are already mechanisms in the core,
namely \somewhere and \atpage but they both have drawbacks.
\somewhere happily prints its text if the figure is placed on the
same double page. In fact, no text at all should be printed if the
figure is visible. Furthermore it's a little verbose to use unless
hidden in a custom macro. \atpage on the other hand doesn't hesitate
to print “see figure 1.2 at page 42” while you're on page 42.

I'm aware that automatic generation of reference text is problematic
since the text depends on the placement of floats which in turn
depends on the text which might result in oscillation. I'm not sure
how likely this is to occur in practice.

I don't know if there's interest in integrating such functionality
into the core. I attached some code, a new macro \smartref, which
takes the same arguments as \in.

  \smartref{figure}[fig:somefigure]

- it prints the reference if it is on the same page
  (e.g. Figure 1.2)

- it prints the reference and a customizable text if the reference
  is on the next/previous page (e.g. Figure 1.2 on the previous page)

- it prints the reference and the page if the reference is further
  away than one page (e.g. Figure 1.2 on page 42)

- it adapts to single-sided and double-sided layouts


Marco

¹ http://thread.gmane.org/gmane.comp.tex.context/65295
² http://thread.gmane.org/gmane.comp.tex.context/59455
³ http://thread.gmane.org/gmane.comp.tex.context/76001
\unprotect

\unexpanded\def\strc_references_smart
  {\strc_references_start_goto
   \let\currentreferencecontent\currentreferencedefault
   \strc_references_pickup_smart_goto}

\def\strc_references_pickup_smart_goto
  {\dodoublegroupempty\strc_references_pickup_goto_smart_indeed}

\starttexdefinition strc_references_pickup_goto_smart_indeed 
#left#right#dummy[#label]
  \leftreferencetoks
  \iffirstargument
{#left}
  \else
\defaultleftreferencetoks
\let\leftofreferencecontent\empty
  \fi
  \rightreferencetoks
  \ifsecondargument
{#right}
  \else
\defaultrightreferencetoks
\let\rightofreferencecontent\empty
  \fi
  \doifreferencefoundelse{#label}
{\goto{\referencesequence}[#label]
 \strc_references_check_visibility
 \ifreferenceisvisible\else
   \space\strc_references_smart_string
 \fi}
 {\let\currentreferencecontent\dummyreference
  \goto{\referencesequence}[#label]}
  \strc_references_stop_goto
\stoptexdefinition

\newif\ifreferenceisvisible \referenceisvisiblefalse

\starttexdefinition strc_references_check_visibility
  \def\strc_references_smart_string{\labeltext\v!atpage\currentreferencepage}
  \referenceisvisiblefalse

  \ifnum\referencepagestate=\plusone %% 1 = reference on current page
\referenceisvisibletrue
  \else
\ifsinglesided
  \strc_references_do_relative_else\plusone
{\def\strc_references_smart_string{\labeltext\v!nextpage}}
{\strc_references_do_relative\minusone
 {\def\strc_references_smart_string{\labeltext\v!previouspage}}{}}
\else
  \ifodd\realpageno
\strc_references_do_relative_else\minusone
  {\def\strc_references_smart_string{\labeltext\v!previouspage}
   \referenceisvisibletrue}
  {\strc_references_do_relative_else\plusone
   {\def\strc_references_smart_string{\labeltext\v!nextpage}}{}}
  \else
\strc_references_do_relative_else\minusone
  {\def\strc_references_smart_string{\labeltext\v!previouspage}}
  {\strc_references_do_relative_else\plusone
   \referenceisvisibletrue{}}
  \fi
\fi
  \fi
\stoptexdefinition

\starttexdefinition strc_references_do_relative_else #relativepagenumber
  \ifnum\currentreferencerealpage=\numexpr\realpageno+#relativepagenumber\relax
\expandafter\firstoftwoarguments
  \else
\expandafter\secondoftwoarguments
  \fi
\stoptexdefinition

\let\smartref\strc_references_smart

\startinterface all
  \setinterfacevariable {previouspage} {previouspage}
  \setinterfacevariable {nextpage} {nextpage}
\stopinterface

\setuplabeltext
  [\s!en]
  [\v!atpage=on page\nobreakspace, %% “at page” sounds weird
   \v!previouspage=on the previous page,
   \v!nextpage=on the next page]

\protect

\useMPlibrary [dum]
\setuppagenumbering [alternative=doublesided]

\starttext

  See \smartref{figure}[fig:alpha] and \smartref{figure}[fig:gamma].
\page See \smartref{figure}[fig:alpha] and \smartref{figure}[fig:gamma].

\startplacefigure [reference=fig:alpha] \externalfigure \stopplacefigure
\startplacefigure [reference=fig:beta]  \externalfigure \stopplacefigure

\page See \smartref{figure}[fig:alpha] and \smartref{figure}[fig:gamma].

\startplacefigure [reference=fig:gamma] \externalfigure \stopplacefigure
\startplacefigure [reference=fig:delta] \externalfigure \stopplacefigure

\page See \smartref{figure}[fig:alpha] and \smartref{figure}[fig:gamma].
\page See \smartref{figure}[fig:alpha] and 

Re: [NTG-context] Confounding colour conundrums

2013-09-22 Thread Thangalin
From http://www.mail-archive.com/ntg-context@ntg.nl/msg44867.html it
appears that \setupinteraction affects the \setupurl command when no url is
given. This was not  obvious from the
documentationhttp://wiki.contextgarden.net/Command/setupurl
.

It seems that assigning different colours for internal (e.g.,
cross-references, table of contents, and indexes) vs. external links (e.g.,
web sites) is not possible without creating new macros that use the \colormacro?

Kind regards.
___
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] Confounding colour conundrums

2013-09-22 Thread Thangalin
Hi,

The trick does seem to be that a new macro is required.

% External link colours
\definecolor[steelblue][h=4682B4]
\define[2]\href{%
  \begingroup
\setupinteraction[
  style=normal,
  color=steelblue,
]%
\goto{#1}[url(#2)]%
  \endgroup%
}

See attached.

Kindest regards.


ex.tex
Description: TeX 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
___