Re: [NTG-context] TLS and externalfigure

2014-03-30 Thread Thangalin
Hi,

Adding --insecure works. I think the option should be present by
default, which could save people time trying to understand what part
of the system is preventing the images from being downloaded. (For
example, for me I first checked caching, directory permissions, web
server configuration, and the wiki before posting to the list.)
___
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] Feature request: use rsvg-convert

2014-03-30 Thread Thangalin
Hi,

Re: http://wiki.contextgarden.net/Using_Graphics#Image_Conversion

I recommend using rsvg-convert instead of inkscape. For example:

wget http://en.wikipedia.org/wiki/File:Inkscape_0.48.2_with_Red_Gallardo.svg
-O car.svg
time rsvg-convert --format pdf car.svg --output car-rsvg.pdf
time inkscape --file=car.svg --export-pdf=car-inkscape.pdf --without-gui

wget 
http://openclipart.org/download/people/TheStructorr/TheStructorr_Lamborghini_Gallardo.svg
-O car2.svg
time rsvg-convert --format pdf car2.svg --output car2-rsvg.pdf
time inkscape --file=car2.svg --export-pdf=car2-inkscape.pdf --without-gui

Here, inkscape is slightly faster yet produces slightly larger files.

inkscape 0.48.4 r9939 (Jan 22 2014)
rsvg-convert version 2.40.2

More importantly, inkscape renders incorrectly. The horizontal and
vertical rule marks are missing in the first image. The gradient
shadows are missing in the second image, and the grill is incorrect
(looks like a layer order issue).
___
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] mirrored leftmarginwidth in enumerations

2014-03-30 Thread Sanjoy Mahajan
Wolfgang Schuster  writes:

> \defineenumeration
>   [pause]
>   [title=no,
>text={\symbol[triangle]},
>width=fit,
>number=no,
>alternative=inleft]

Thank you.  That works beautifully.  Is my understanding right, that
width=fit is what makes the head (here the triangle symbol) fit into its
zone (here, the left margin)?  How does it know to put the space on the
left side of the triangle, rather than on the right side?

Once I understand enough to not say nonsense, I'll wikify an example.

-Sanjoy
___
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] TLS and externalfigure

2014-03-30 Thread Thangalin
http://wiki.contextgarden.net/Using_Graphics#HTTPS

Thank you, Hans.
___
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] mirrored leftmarginwidth in enumerations

2014-03-30 Thread Wolfgang Schuster

Am 30.03.2014 um 20:00 schrieb Sanjoy Mahajan :

> If anyone has a suggestion for putting enumeration texts toward the
> right edge of the left margin, I would be grateful.
> 
> In MkII enumerations, I would put a triangle (fig.2) in the left margin
> using
> 
> \defineenumeration
>  [pause]
>  [title=no,
>text={\externalfigure[fig.2][height=1em]},
>location=inleft,
>number=no,
>  ]
> 
> The triangle was automatically aligned toward the right side of the left
> margin (fill glue on the left), which was what I wanted, on even and odd
> pages.
> 
> In MkIV, the marginal text is automatically aligned to the left side.
> I restored the MkII effect using this hack (using a > instead of the
> triangle, to make the example more self contained):
> 
> \defineenumeration
>  [pause]
>  [title=no,
>   text={\hbox to \leftmarginwidth{\hfil $>$}},
>number=no,
>alternative=inleft,
>  ]
> 
> But I just realized that the hack doesn't work for double-sided layouts.
> 
> Using the leftmarginwidth is correct on the odd pages, but it is too big
> for the even pages.  Thus, on page 2 of the example below, the >
> overlaps the "question" text.
> 
> Is there a more idiomatic MkIV replacement for my hack?  Or is my hack
> okay, but ConTeXt should be updated to interpret leftmarginwidth to mean
> "the leftmarginwidth, as appropriate for an odd or an even page"?
> 
> Here is the example:
> 
> \setuplayout[marking=on,location=middle,
>  backspace=1.25in,
>  leftmargindistance=0.125in, leftmargin=0.625in,
>  width=4.75in,
>  rightmargindistance=0.25in, rightmargin=0.25in,
> ]
> 
> \setuppagenumbering[alternative={doublesided}]
> 
> \defineenumeration
>  [pause]
>  [title=no,
>   text={\hbox to \leftmarginwidth{\hfil $>$}},
>number=no,
>alternative=inleft,
>  ]
> 
> \def\question#1{\startpause\relax #1 \stoppause}
> 
> \showframe
> 
> \starttext
> \question{hello}
> \page
> \question{hello}
> \stoptext

\defineenumeration
  [pause]
  [title=no,
   text={\symbol[triangle]},
   width=fit,
   number=no,
   alternative=inleft]

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
___


[NTG-context] PDF document metadata: keyword and date

2014-03-30 Thread Pablo Rodriguez
Dear list,

I have the following sample:

\setupinteraction[state=start, author={I, Me},
keyword={interactive document, ConTeXt},
date=03-02-2004]
\starttext
Hi.\page Hi.
\stoptext

I have two questions:

How can I avoid the removal of commas in the keyword option?

How should I specify the date option? (Even with the format
D:199812231952-08'00, I don’t get it working.)

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] Defining commands in \start ... \stop

2014-03-30 Thread Xan
And so? This has not [mathematical] solution ;-)

Xan.

> The block commands use a buffer to store the content and buffers can’t be 
> used in commands.
>
>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
___

[NTG-context] mirrored leftmarginwidth in enumerations

2014-03-30 Thread Sanjoy Mahajan
If anyone has a suggestion for putting enumeration texts toward the
right edge of the left margin, I would be grateful.

In MkII enumerations, I would put a triangle (fig.2) in the left margin
using

\defineenumeration
  [pause]
  [title=no,
text={\externalfigure[fig.2][height=1em]},
location=inleft,
number=no,
  ]

The triangle was automatically aligned toward the right side of the left
margin (fill glue on the left), which was what I wanted, on even and odd
pages.

In MkIV, the marginal text is automatically aligned to the left side.
I restored the MkII effect using this hack (using a > instead of the
triangle, to make the example more self contained):

\defineenumeration
  [pause]
  [title=no,
   text={\hbox to \leftmarginwidth{\hfil $>$}},
number=no,
alternative=inleft,
  ]

But I just realized that the hack doesn't work for double-sided layouts.

Using the leftmarginwidth is correct on the odd pages, but it is too big
for the even pages.  Thus, on page 2 of the example below, the >
overlaps the "question" text.

Is there a more idiomatic MkIV replacement for my hack?  Or is my hack
okay, but ConTeXt should be updated to interpret leftmarginwidth to mean
"the leftmarginwidth, as appropriate for an odd or an even page"?

Here is the example:

\setuplayout[marking=on,location=middle,
  backspace=1.25in,
  leftmargindistance=0.125in, leftmargin=0.625in,
  width=4.75in,
  rightmargindistance=0.25in, rightmargin=0.25in,
 ]

\setuppagenumbering[alternative={doublesided}]

\defineenumeration
  [pause]
  [title=no,
   text={\hbox to \leftmarginwidth{\hfil $>$}},
number=no,
alternative=inleft,
  ]
  
\def\question#1{\startpause\relax #1 \stoppause}

\showframe

\starttext
\question{hello}
\page
\question{hello}
\stoptext
___
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] Defining commands in \start ... \stop

2014-03-30 Thread Wolfgang Schuster

Am 30.03.2014 um 19:28 schrieb Xan :

> This:
> 
> \defineblock[question]
> \defineblock[answer]
> 
> \defineenumeration[question][text={Question}]
> \defineenumeration[answer]  [text={Answer}]
> 
> \keepblocks[question]
> \hideblocks[answer]
> 
> 
> \def\mynewcommand{\dosingleempty\doMyNewCommand}
> \def\doMyNewCommand[#1]#2{%
> \iffirstargument
> \beginquestion
>   \startquestion #2%
>   \stopquestion
> \endquestion
>   \beginanswer \startanswer #1%
>   \stopanswer \endanswer
> \else
> \beginquestion
>   \startquestion #2%
>   \stopquestion
> \endquestion
>   \incrementcounter[answer]
> \fi
> }
> 
> 
> \starttext
> 
> \chapter{Question}
> 
> \beginquestion
>   \startquestion
>   Question 1.
>   \stopquestion
> \endquestion
> 
> \beginanswer
>   \startanswer
>   Answer 1.
>   \stopanswer
> \endanswer
> 
> \beginquestion
>   \startquestion
>   Question 2.
>   \stopquestion
> \endquestion
> 
> \beginanswer
>   \incrementcounter[answer]
> \endanswer
> 
> \beginquestion
>   \startquestion
>   Question 3.
>   \stopquestion
> \endquestion
> 
> \beginanswer
>   \startanswer
>   Answer 3.
>   \stopanswer
> \endanswer
> 
> \mynewcommand{Question 5}
> 
> \mynewcommand[Resposta 6]{Question 6}
> 
> \chapter{Answers}
> 
> \useblocks[answer]
> 
> \stoptext
> 
> does not work

The block commands use a buffer to store the content and buffers can’t be used 
in commands.

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] Defining commands in \start ... \stop

2014-03-30 Thread Xan
This:

\defineblock[question]
\defineblock[answer]

\defineenumeration[question][text={Question}]
\defineenumeration[answer]  [text={Answer}]

\keepblocks[question]
\hideblocks[answer]


\def\mynewcommand{\dosingleempty\doMyNewCommand}
\def\doMyNewCommand[#1]#2{%
 \iffirstargument
 \beginquestion
   \startquestion #2%
   \stopquestion
 \endquestion
   \beginanswer \startanswer #1%
   \stopanswer \endanswer
 \else
 \beginquestion
   \startquestion #2%
   \stopquestion
 \endquestion
   \incrementcounter[answer]
 \fi
}


\starttext

\chapter{Question}

\beginquestion
\startquestion
Question 1.
\stopquestion
\endquestion

\beginanswer
\startanswer
Answer 1.
\stopanswer
\endanswer

\beginquestion
\startquestion
Question 2.
\stopquestion
\endquestion

\beginanswer
\incrementcounter[answer]
\endanswer

\beginquestion
\startquestion
Question 3.
\stopquestion
\endquestion

\beginanswer
\startanswer
Answer 3.
\stopanswer
\endanswer

\mynewcommand{Question 5}

\mynewcommand[Resposta 6]{Question 6}

\chapter{Answers}

\useblocks[answer]

\stoptext

does not work
___
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] Defining commands in \start ... \stop

2014-03-30 Thread Xan
Hi,

Concerned with the answers to the [that 
topic](http://www.ntg.nl/pipermail/ntg-context/2014/077099.html), I was 
thinking if I could define a command "Exercise" with a optional argument (the 
"Answer").

\defineblock[question]
\defineblock[answer]

\defineenumeration[question][text={Question}]
\defineenumeration[answer]  [text={Answer}]

\keepblocks[question]
\hideblocks[answer]

Something like
\startexercise My execise ...
\stopexercise

If no more is provide, at the question does \incrementcounter[answer]
If

\startexercise{\startsolution The solution is \stopsolution} My exercise
\stopexercise

then \beginanswer and \startanswer is called.

Is it possible?

I just want to know if it's better to have \startBla...\stopBla command or 
\Bla{} command type?
In the case of the first, how do you define that? I did not find it here 
(http://wiki.contextgarden.net/Commands_with_optional_arguments)

Thanks,
Xan

PS: Please CCme
___
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] TLS and externalfigure

2014-03-30 Thread Hans Hagen

On 3/30/2014 5:12 AM, Thangalin wrote:

Hi,

I have images hosted on a local web server using a self-signed
certificate. For example:

https://localhost/images/.../file.png

When using ConTeXt, the image cannot be retrieved; a verified signed
certificate works as expected.

Using wget, self-signed certificates can be forced:

wget --no-check-certificate https://localhost/images/.../file.png

Does ConTeXt have a way to ignore/bypass certificate validation? If so, how?

(Note: the certificate's common name is currently blank, which does
not match 'localhost' -- I can fix that if required...)


a test:

in data-sch.lua you can find:

local function runcurl(name,cachename) -- we use sockets instead or the 
curl library when possible
local command = "curl --silent --create-dirs --output " .. 
cachename .. " " .. name

os.spawn(command)
end

you can try to add an option there, remake the format and see if that 
works i can see if we can add such an option (by default or setup)


Hans


--

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