Re: [NTG-context] invert colors in \externalfigure

2016-01-20 Thread Pablo Rodriguez
On 01/20/2016 02:09 PM, Marco Patzer wrote:
>> How can I invert the colors in the external figure without having
>> to edit the image file?
> 
> Based on Peter Münster's grph-downsample.lua here some lines that
> should get you started. Note that you'll need graphicsmagick (or
> imagemagick for that matter. In the latter case change the call from
> `gm convert` to `convert`). This will do the conversion on the fly.

Many thanks for your reply, Marco.

I’m afraid it doesn’t work with PDF files. But it is fine for me, since
the solution provided by Wolfgang works fine.

Many thanks for your help,


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
___

[NTG-context] Bug: RTL \framed when aligned

2016-01-20 Thread Mohammad Hossein Bateni
Hello,

There seems to be a bug in RTL documents when \framed goes in \leftaligned,
\midaligned, or \rightaligned AND corner=round option is used.  (I don't
know what other options trigger the bug.)

Here is the MWE (verified in ConTeXt ver: 2016.01.18 22:21 MKIV beta fmt:
2016.1.19 int: english/english):

\setupalign[r2l]
\starttext

\midaligned
  \framed[corner=round,
   width=.5\hsize]
 {Hello!  This is some sample text.}

\stoptext

It works fine when either corner or midaligned is dropped.  With both in,
however, the frame appears to the right of the text (no overlap).

Thanks!
—MHB
___
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] invert colors in \externalfigure

2016-01-20 Thread Alan BRASLAU
On Wed, 20 Jan 2016 17:56:53 +0100
Pablo Rodriguez  wrote:

> On 01/20/2016 01:19 PM, Wolfgang Schuster wrote:
> >> Pablo Rodriguez 20. Januar 2016 um 13:10
> >> [...]
> >> How can I invert the colors in the external figure without having
> >> to edit the image file?
> >>
> >> Many thanks for your help,  
> > You have to use the Adobe Reader to view the PDF.  
> 
> I’m afraid that I’m on Linux and I don’t have Adobe Reader installed.

Not just on Linux... (Adobe reader is a notorious security hole).


With MetaFun, you can invert the colors using:

\startMPcode
  draw whatever... ;
  currentpicture := inverted currentpicture ;
\stopMPcode

Unfortunately, this does *not* work with externalfigure, i.e.
  \startMPcode
draw externalfigure("cow") ;
currentpicture := inverted currentpicture ;
  \stopMPcode
or
  \startMPcode
draw rawtextext("\externalfigure [cow]") ;
currentpicture := inverted currentpicture ;
  \stopMPcode
as inverted (a macro) operates on all the elements of the picture.

I find it easiest to use ImageMagick or gimp to invert the colors and
save this in a second image file.

Alan
___
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] RTL columns for itemize

2016-01-20 Thread Mohammad Hossein Bateni
Hi,

Is there a way to typeset \startitemize with columns options, such that
columns go from right to left?  In the underlying structure
\startstopcolumns, there is an option "direction" which can be set to
"left" to achieve this.  I couldn't figure out how to do this within
\startitemize though.


\setupalign[r2l]
\starttext

Hello!

\startitemize[columns,three,packed,n]
\item One
\item Two
\item Three
\item Four
\item Five
\item Six
\item Seven
\stopitemize

\stoptext

The result looks like the following:

!olleH
   enO .1 ruoF .4 neveS .7
   owT .2 eviF .5
eerhT .3   xiS .6


How about \startcombination?  Can I use RTL ordering with that, too?  This
is less important than the above since the labels are usually set manually
and one can just use the visual ordering rather than the logical one.
 (That is, except one tries to get automatic numbering for the figures
inside the combination but that's not common at all.)

Best,
—MHB
___
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] invert colors in \externalfigure

2016-01-20 Thread Pablo Rodriguez
On 01/20/2016 01:19 PM, Wolfgang Schuster wrote:
>> Pablo Rodriguez 20. Januar 2016 um 13:10
>> [...]
>> How can I invert the colors in the external figure without having to
>> edit the image file?
>>
>> Many thanks for your help,
> You have to use the Adobe Reader to view the PDF.

Many thanks for your solution, Wolfgang.

I’m afraid that I’m on Linux and I don’t have Adobe Reader installed.

But it is fine for me, since I’m going to print the file with Adobe
Reader DC.

It seems that other viewers don’t implement the /TR entry from
/ExtGState dictionary (according to the PDF spec).

I’m going to report the issue for Ghostscript, mupdf and poppler, so
that they have the feature implemented.

Many thanks for your help,

Pablo


> \setupexternalfigure[location=default]
> 
> \starttext
> 
> \externalfigure[cow][width=\textwidth]
> 
> \startnegative
> \externalfigure[cow][width=\textwidth]
> \stopnegative
> 
> \startnegative
> \externalfigure[cow][background=color,backgroundcolor=white,width=\textwidth]
> \stopnegative
> 
> \stoptext
> 
> Wolfgang

-- 
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
___

[NTG-context] citations

2016-01-20 Thread Meer, Hans van der
In this version:
  ConTeXt  ver: 2015.12.22 10:50 MKIV beta  fmt: 2015.12.27  int: 
english/english
I was able to typeset my bibtex citations with \cite.
But in the version of ConTeXt-beta I downloaded recently \cite results in blank.
There might have been a mention about this recently, but that is all I can 
remember.

What should I change? I am using \module[oldbibtex] at the moment.

My usage is through the macros I add for convenience, it might be them causing 
the problem

Hans van der Meer


% Custom setup 

\def\bibentry#1{% start each reference on the next line
\breaktemp\def\breaktemp{\hfill\break}%
\noexpand\bibentrypar\cite[data][#1]\strut}

% Usage: \footnotecite[citation,citation,.. ][optional text]
%\footnotecite[citation,citation,..,][optional text on new line]
%\footnotecite[citation,,citation,..][optional text] white within
\def\footnotecite{\dodoubleargument\dofootnotecite}

% footnotes or endnotes
\def\mycitenote{\endnote}

% Standard form of citations.
\def\breaktemp{}
\def\Adofootnotecite[#1][#2]{%
\def\bibentrypar{\def\bibentrypar{\par}}%
\def\breaktemp{}%
\unskip\mycitenote{\processcommalist[#1]\bibentry
\doifnotempty{#2}{\space#2\strut\par}}}

% Disabling citations altogether.
\def\Cdofootnotecite[#1][#2]{\ignorespaces}%

% Citations switched on.
\def\enablecitations{%
\writestatus{HVDM-ONDERWIJS}{citations enabled}%
\let\dofootnotecite\Adofootnotecite}

% Citations switched off.
\def\disablecitations{%
\writestatus{HVDM-ONDERWIJS}{citations disabled}%
\let\dofootnotecite\Cdofootnotecite}

% By default citations are off.
\let\dofootnotecite\Cdofootnotecite


___
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] invert colors in \externalfigure

2016-01-20 Thread Wolfgang Schuster

Pablo Rodriguez 
20. Januar 2016 um 13:10
Dear list,

I have the following sample:

\setuppapersize[A6]
\setuplayout[width=middle]
\starttext
\startmakeup[standard][align=center]
\dontleavehmode\externalfigure[cow][width=\textwidth]
\stopmakeup
\stoptext

How can I invert the colors in the external figure without having to
edit the image file?

Many thanks for your help,

You have to use the Adobe Reader to view the PDF.

\setupexternalfigure[location=default]

\starttext

\externalfigure[cow][width=\textwidth]

\startnegative
\externalfigure[cow][width=\textwidth]
\stopnegative

\startnegative
\externalfigure[cow][background=color,backgroundcolor=white,width=\textwidth]
\stopnegative

\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] invert colors in \externalfigure

2016-01-20 Thread Marco Patzer
> How can I invert the colors in the external figure without having
> to edit the image file?

Based on Peter Münster's grph-downsample.lua here some lines that
should get you started. Note that you'll need graphicsmagick (or
imagemagick for that matter. In the latter case change the call from
`gm convert` to `convert`). This will do the conversion on the fly.

\startluacode
  local format = string.format
  local function invert(oldname, newname)
local s = format("gm convert -negate %s %s", oldname, newname)
os.execute(s)
  end
  local formats = {"png", "jpg", "gif"}
  for _, s in ipairs(formats) do
figures.converters[s] = figures.converters[s] or {}
figures.converters[s]["invert." .. s] = invert
  end
\stopluacode

\setupexternalfigures [conversion=invert.jpg]
\setupexternalfigures [location=default]

\starttext
  \externalfigure[hacker]
\stoptext

Marco
___
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] invert colors in \externalfigure

2016-01-20 Thread Pablo Rodriguez
Dear list,

I have the following sample:

\setuppapersize[A6]
\setuplayout[width=middle]
\starttext
\startmakeup[standard][align=center]
\dontleavehmode\externalfigure[cow][width=\textwidth]
\stopmakeup
\stoptext

How can I invert the colors in the external figure without having to
edit the image file?

Many thanks for your help,

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
___

Re: [NTG-context] Greek diacriticals (combining perispomenon displaced)

2016-01-20 Thread Alan Bowen
Thanks, Hans and Thomas.

The problem is at my end. I have done more testing and suspect that the the
culprit is the Greek keyboard that I am using. I have a few other keyboards
(which I like much less) and there is no problem with them. (Deleting
caches and so on had no impact.)

Alan

On Mon, Jan 18, 2016 at 4:55 PM, Thomas A. Schmitz <
thomas.schm...@uni-bonn.de> wrote:

> On 01/18/2016 10:33 PM, Hans Hagen wrote:
>
>> As I review my files, I see that this is a fairly recent problem, though
>>> I cannot say exactly when it first occurred.
>>>
>>
>> looks ok here ... assuming i have the right font
>>
>> you can try to wipe the font cache (otf and otl)
>>
>
>
> I can't test with HellenicaCU as I don't have the font, but I can confirm
> that output is good here with the IFAOGrec font, the combining circumflex
> is where it belongs. (most recent beta)
>
> Thomas
>
>
> ___
> 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
___