[NTG-context] Translating PDF-files

2011-01-19 Thread Cecil Westerhof
Properly not really a ConTeXt question, but maybe nows the answer.

Someone asked me how to convert a PDF to XML and back. The reasons is that
he has a PDF in English, but he likes to have it also in Russian. His idea
is to convert the PDF file to XML, translate the XML file with
GoogleTranslate and convert the translated XML file to PDF. He asked me how
to do this. Of-course it does not have to be a XML file, if GoogleTranslate
can work with a TEX file, there is no reason not to do it.

Does anyone know how to do this, or has pointers about how to do this?

-- 
Cecil Westerhof
___
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] Translating PDF-files

2011-01-19 Thread Martin Schröder
2011/1/19 Cecil Westerhof cldwester...@gmail.com:
 Someone asked me how to convert a PDF to XML and back. The reasons is that
 he has a PDF in English, but he likes to have it also in Russian. His idea

It will be _much_ easier to get the original english sources and
translate _them_ (and create a new PDF from the translate). Trust me.

Best
   Martin
___
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] Translating PDF-files

2011-01-19 Thread Cecil Westerhof
2011/1/19 Martin Schröder mar...@oneiros.de

 2011/1/19 Cecil Westerhof cldwester...@gmail.com:
  Someone asked me how to convert a PDF to XML and back. The reasons is
 that
  he has a PDF in English, but he likes to have it also in Russian. His
 idea

 It will be _much_ easier to get the original english sources and
 translate _them_ (and create a new PDF from the translate). Trust me.


Would be my guess also. Was my first comment to this person. ;-} But he
wants to do it this way. His idea is have standard PDF's on his website, but
let people choose in which language they want it, and then let it be
translated on the fly. He also has PDF's he can redistribute, but for which
he will not get the sources.

-- 
Cecil Westerhof
___
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] Translating PDF-files

2011-01-19 Thread R. Ermers

If your acquaintance actually needs an accurate translation into Russian, I 
wonder why he would choose Google Translate for that. Remember that Russian has 
7 cases, and a complex verbal system with many different forms, all of which 
need to be deduced by Google from the much poorer English prepositions and the 
verbal foms in the text. Even though the result will no doubt show cyrillic 
words, which looks interesting, the factual result will be rubbish, and most 
likely unintelligible to any Russian.

Regards,

Robert


Op 19 jan 2011, om 13:58 heeft Cecil Westerhof het volgende geschreven:

 Properly not really a ConTeXt question, but maybe nows the answer.
 
 Someone asked me how to convert a PDF to XML and back. The reasons is that he 
 has a PDF in English, but he likes to have it also in Russian. His idea is to 
 convert the PDF file to XML, translate the XML file with GoogleTranslate and 
 convert the translated XML file to PDF. He asked me how to do this. Of-course 
 it does not have to be a XML file, if GoogleTranslate can work with a TEX 
 file, there is no reason not to do it.
 
 Does anyone know how to do this, or has pointers about how to do this?
 
 -- 
 Cecil Westerhof
 ___
 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] How to run Typesetting in MetaPost example (MetaFun)?

2011-01-19 Thread Verhaag, G.C.H.M.

Verhaag, G.C.H.M. wrote:


Hi,

I wanted to try (using ConTeXt minimals MkIV) the example on page 228 
of the MetaFun manual, dealing with typesetting in MetaPost.


The code is given as:

\resetMPdrawing
\startMPdrawing
picture pic[] ;
numeric wid[], len[], pos[], n ;
wid[0] := len[0] := pos[0] := n := 0 ;
\stopMPdrawing

\def\whatever#1%
{\appendtoks#1\to\MPtoks
 \setbox\MPbox=\hbox{\bfd\the\MPtoks}%
 \startMPdrawing
  n := n + 1 ; len[n] := \the\wd\MPbox ;
 \stopMPdrawing
 \startMPdrawing[-]
  pic[n] := textext(\bfd\setstrut\strut#1) ;
  pic[n] := pic[n] shifted - llcorner pic[n] ;
 \stopMPdrawing}

\handletokens MetaPost is Fun!\with\whatever

But is won't run. The following message is generated:

\@@toks -\MPtoks

\dodoappendtoks -\dodoglobal \@@toks
 \@EAEAEA {\@EA \the \@EA \@@toks 
\the ...

\whatever #1-\appendtoks #1\to \MPtoks
   \setbox \MPbox =\hbox {\bfd 
\the \MP...

\dodohandletokenstwo *#1-\dododohandletokens {#1}
 \dohandletokens
argument M
   etaPost is Fun!
\handletokens ...ndletokens {#2}\dohandletokens #1
 \end
l.96 \handletokens MetaPost is Fun!\with\whatever

Anybody any idea?

Regards,
Gerard Verhaag
___ 

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
___ 




Hi,

I'm in need of help to get the example as described in the MetaFun 
manual running, because I want to use text around a path!


So, I started reading the chapter about 'Typesetting in METAPOST' and 
wanted to try the examples as given in that chapter, but without succes!


The problem seem to be the MPtoks macro. According to the text in this 
chapter this low level macro (and MPbox and appendtoks) are already 
defined, but are they really?


The version of context minimals I use at the moment is:

MTXrun | current version: 2011.01.18 19:34

Any suggestions are very much welcomed! Thanks in advance!

Regards,
Gerard
___
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] Translating PDF-files

2011-01-19 Thread Cecil Westerhof
2011/1/19 R. Ermers r.erm...@hccnet.nl


 If your acquaintance actually needs an accurate translation into Russian, I
 wonder why he would choose Google Translate for that. Remember that Russian
 has 7 cases, and a complex verbal system with many different forms, all of
 which need to be deduced by Google from the much poorer English prepositions
 and the verbal foms in the text. Even though the result will no doubt show
 cyrillic words, which looks interesting, the factual result will be rubbish,
 and most likely unintelligible to any Russian.


I do not know if he requires Russian, he was talking about Ukrainian. But
that maybe has the same problems.

Automatic translation is always a problem. I even do not like the results
from English to Dutch. But his reasoning is: 'better a badly translated
document, as no document'. I am not sure if I agree 100%, but if that is
what he wants, who am I to -keep- telling him he is wrong?

-- 
Cecil Westerhof
___
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] Translating PDF-files

2011-01-19 Thread luigi scarso
On Wed, Jan 19, 2011 at 1:58 PM, Cecil Westerhof cldwester...@gmail.com wrote:
 Properly not really a ConTeXt question, but maybe nows the answer.

 Someone asked me how to convert a PDF to XML and back. The reasons is that
 he has a PDF in English, but he likes to have it also in Russian. His idea
 is to convert the PDF file to XML, translate the XML file with
 GoogleTranslate and convert the translated XML file to PDF. He asked me how
 to do this. Of-course it does not have to be a XML file, if GoogleTranslate
 can work with a TEX file, there is no reason not to do it.
google for pdftotext


-- 
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] Translating PDF-files

2011-01-19 Thread Cecil Westerhof
2011/1/19 luigi scarso luigi.sca...@gmail.com

 On Wed, Jan 19, 2011 at 1:58 PM, Cecil Westerhof cldwester...@gmail.com
 wrote:
  Properly not really a ConTeXt question, but maybe nows the answer.
 
  Someone asked me how to convert a PDF to XML and back. The reasons is
 that
  he has a PDF in English, but he likes to have it also in Russian. His
 idea
  is to convert the PDF file to XML, translate the XML file with
  GoogleTranslate and convert the translated XML file to PDF. He asked me
 how
  to do this. Of-course it does not have to be a XML file, if
 GoogleTranslate
  can work with a TEX file, there is no reason not to do it.
 google for pdftotext


Already done. What looked the most promissing was pdftohtml. Just wondering
if there is a better way.

-- 
Cecil Westerhof
___
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] Translating PDF-files

2011-01-19 Thread luigi scarso
On Wed, Jan 19, 2011 at 3:14 PM, Cecil Westerhof cldwester...@gmail.com wrote:
 Already done. What looked the most promissing was pdftohtml. Just wondering
 if there is a better way.
What y do you want exactly ?
Preserve structure ? formulas ? layout ?
As far as these informations are not embedded (tagged) into the pdf
you have to  do (a lot of) manual work .

Also google for pdfdraw mupdf
-- 
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] Translating PDF-files

2011-01-19 Thread Arthur Reutenauer
 Even though the result will no doubt show cyrillic words, which looks 
 interesting, the factual result will be rubbish, and most likely 
 unintelligible to any Russian.

  That's an interesting statement; do you have any experience with that
at all, or are you simply speculating?  I have never heard any claim
that machine translation would be more difficult for some particular
languages.  It's generally a hard problem, and each language has its
specific issues, not only Russian (that has 6 cases, by the way, not 7,
and really only one fully conjugated tense).

Arthur
___
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] Translating PDF-files

2011-01-19 Thread Cecil Westerhof
2011/1/19 luigi scarso luigi.sca...@gmail.com

 On Wed, Jan 19, 2011 at 3:14 PM, Cecil Westerhof cldwester...@gmail.com
 wrote:
  Already done. What looked the most promissing was pdftohtml. Just
 wondering
  if there is a better way.
 What y do you want exactly ?
 Preserve structure ? formulas ? layout ?
 As far as these informations are not embedded (tagged) into the pdf
 you have to  do (a lot of) manual work .


My contact 'just' wants to translate the document. I already told him that
this is easier said than done. But he is adamant. (Notwithstanding that
several people already gave up on his quest.) I think structure and layout
should be maintained. But I think it will be mostly 'simple' documents with
text and some graphics. So I do not expect to have formula trouble.


Also google for pdfdraw mupdf


I will do that.

-- 
Cecil Westerhof
___
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] Translating PDF-files

2011-01-19 Thread luigi scarso
On Wed, Jan 19, 2011 at 3:35 PM, Cecil Westerhof cldwester...@gmail.com wrote:
 2011/1/19 luigi scarso luigi.sca...@gmail.com

 On Wed, Jan 19, 2011 at 3:14 PM, Cecil Westerhof cldwester...@gmail.com
 wrote:
  Already done. What looked the most promissing was pdftohtml. Just
  wondering
  if there is a better way.
 What y do you want exactly ?
 Preserve structure ? formulas ? layout ?
 As far as these informations are not embedded (tagged) into the pdf
 you have to  do (a lot of) manual work .

 My contact 'just' wants to translate the document. I already told him that
 this is easier said than done. But he is adamant. (Notwithstanding that
 several people already gave up on his quest.) I think structure and layout
 should be maintained. But I think it will be mostly 'simple' documents with
 text and some graphics. So I do not expect to have formula trouble.
hm, maybe you can have a  look at inkscape then (at least 0.48)

-- 
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] Translating PDF-files

2011-01-19 Thread Cecil Westerhof
2011/1/19 luigi scarso luigi.sca...@gmail.com

 hm, maybe you can have a  look at inkscape then (at least 0.48)


I will do that.

-- 
Cecil Westerhof
___
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] Translating PDF-files

2011-01-19 Thread R. Ermers
Off topic: Well, I speak Russian and some other languages. Yes you are right, 
the 5th case is the locative (after o), the 6th case is the instrumental. One 
does not count the cases everyday :-)

It is not a language in general that is difficult, but the pair a language is 
in: the pair English-Russian is, in some aspects, more difficult than the other 
way around because of the choice for the perfective aspect or imperfective 
aspect of the tenses. An English text does not offer any clues as to which 
aspect to choose, but anyone who wants to speaks Russian has to decide 
instantly. A program is unlikely do that.

These problems might not exist for the pair Ukrainian-Russian, or perhaps (?) 
Polish-Russian, or - who knows - Basque-Russian.
The options for determine the appropriate aspect, if programmers succeed in 
building them at all, are, for example, not needed in the pair English-Dutch.

The reversed pair Russian-English poses different problems, such as when and 
where to put an article. The program has to derive from the context whether a 
given Russian noun in the text should be interpreted as determined or 
undetermined, and then whether it is appropriate to put the article, etcetera.

Robert


 Even though the result will no doubt show cyrillic words, which looks 
 interesting, the factual result will be rubbish, and most likely 
 unintelligible to any Russian.
 
  That's an interesting statement; do you have any experience with that
 at all, or are you simply speculating?  I have never heard any claim
 that machine translation would be more difficult for some particular
 languages.  It's generally a hard problem, and each language has its
 specific issues, not only Russian (that has 6 cases, by the way, not 7,
 and really only one fully conjugated tense).
 
   Arthur
 ___
 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] Translating PDF-files

2011-01-19 Thread Arthur Reutenauer
 It is not a language in general that is difficult, but the pair a language is 
 in: the pair English-Russian is, in some aspects, more difficult than the 
 other way around because of the choice for the perfective aspect or 
 imperfective aspect of the tenses. An English text does not offer any clues 
 as to which aspect to choose, but anyone who wants to speaks Russian has to 
 decide instantly. A program is unlikely do that.

  I'm sorry, but that's pure speculation.  It would be interesting to
see research about machine translation for some particular language
pairs, though.

Arthur
___
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] Translating PDF-files

2011-01-19 Thread R. Ermers
Still off topic:

Well, this is partly lexicological knowledge and research on translation. Each 
language pair and translation direction has its peculiar problems.

Whether or not you are able to say it is pure speculation depends on how 
familiar you are with computer linguistics, and its progress in determining 
semantic content from texts (step 1) and rephrasing it in a given target 
language (step 2).

I'm glad that you accept that it is about the pair and the direction of the 
translation.

Robert

 It is not a language in general that is difficult, but the pair a language 
 is in: the pair English-Russian is, in some aspects, more difficult than the 
 other way around because of the choice for the perfective aspect or 
 imperfective aspect of the tenses. An English text does not offer any clues 
 as to which aspect to choose, but anyone who wants to speaks Russian has to 
 decide instantly. A program is unlikely do that.
 
  I'm sorry, but that's pure speculation.  It would be interesting to
 see research about machine translation for some particular language
 pairs, though.
 
   Arthur
 ___
 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] Translating PDF-files

2011-01-19 Thread Alan BRASLAU
A fun exercise is to put a text through google translate into any language,
then pass the result back into the original language.

via Russian: Fun exercise is to put the text through Google Translate in any
language, and then pass the result back to the original language.

via Japonese: Exercise is fun, Google is placing text via translation into 
other languages To pass the result to the original language.

via French (for Arthur): A fun exercise is to put a text through Google 
translate in any language, then pass the result in the original language.

...

Alan

On Wednesday 19 January 2011 17:06:53 R. Ermers wrote:
 Still off topic:
 
 Well, this is partly lexicological knowledge and research on translation.
 Each language pair and translation direction has its peculiar problems.
 
 Whether or not you are able to say it is pure speculation depends on how
 familiar you are with computer linguistics, and its progress in
 determining semantic content from texts (step 1) and rephrasing it in a
 given target language (step 2).
 
 I'm glad that you accept that it is about the pair and the direction of the
 translation.
 
 Robert
 
  It is not a language in general that is difficult, but the pair a
  language is in: the pair English-Russian is, in some aspects, more
  difficult than the other way around because of the choice for the
  perfective aspect or imperfective aspect of the tenses. An English text
  does not offer any clues as to which aspect to choose, but anyone who
  wants to speaks Russian has to decide instantly. A program is unlikely
  do that.
  
   I'm sorry, but that's pure speculation.  It would be interesting to
  
  see research about machine translation for some particular language
  pairs, though.
  
  Arthur
  
  _
  __ 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
 ___
 

-- 
Alan Braslau
CEA DSM-IRAMIS-SPEC
CNRS URA 2464
Orme des Merisiers
91191 Gif-sur-Yvette cedex FRANCE
tel: +33 1 69 08 73 15
fax: +33 1 69 08 87 86
mailto:alan.bras...@cea.fr

 .''`.
: :'  :
`. `'`
  `-
___
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] Differences for \Vert in mkii and mkiv

2011-01-19 Thread Aditya Mahajan

On Tue, 18 Jan 2011, Otared Kavian wrote:


Dear Aditya, dear Hans,

I noticed a serious difference between what one gets for \left\Vert in mkii and 
in mkiv.
Probably this is due to the fact that in mkiv the glyph for \Vert is 
constructed in a different manner, but as far as I know from what I see in the 
mathematical printed materials, the correct one, or the expected one, is the 
output from mkii.


I don't know why the glyphs are different. In MkIV, the virtual font is 
mapping 0x2016 to 0xFF605, but I don't know how FF605 is created.



Is there a way to redefine locally \Vert (or \|) so that in mkiv one gets the 
same output as with mkii?


Not locally. You could change math-vfu.lua to change the mapping, but I 
don't completely understand how those work (with the virtual glyphs like 
FF605)


Aditya
___
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] How to run Typesetting in MetaPost example (MetaFun)?

2011-01-19 Thread Peter Rolf
Am 19.01.2011 14:35, schrieb Verhaag, G.C.H.M.:
 Verhaag, G.C.H.M. wrote:
 
 Hi,

 I wanted to try (using ConTeXt minimals MkIV) the example on page 228
 of the MetaFun manual, dealing with typesetting in MetaPost.

 The code is given as:

 \resetMPdrawing
 \startMPdrawing
 picture pic[] ;
 numeric wid[], len[], pos[], n ;
 wid[0] := len[0] := pos[0] := n := 0 ;
 \stopMPdrawing

 \def\whatever#1%
 {\appendtoks#1\to\MPtoks
  \setbox\MPbox=\hbox{\bfd\the\MPtoks}%
  \startMPdrawing
   n := n + 1 ; len[n] := \the\wd\MPbox ;
  \stopMPdrawing
  \startMPdrawing[-]
   pic[n] := textext(\bfd\setstrut\strut#1) ;
   pic[n] := pic[n] shifted - llcorner pic[n] ;
  \stopMPdrawing}

 \handletokens MetaPost is Fun!\with\whatever

 But is won't run. The following message is generated:

 \@@toks -\MPtoks

 \dodoappendtoks -\dodoglobal \@@toks
  \@EAEAEA {\@EA \the \@EA \@@toks
 \the ...
 \whatever #1-\appendtoks #1\to \MPtoks
\setbox \MPbox =\hbox {\bfd
 \the \MP...
 \dodohandletokenstwo *#1-\dododohandletokens {#1}
  \dohandletokens
 argument M
etaPost is Fun!
 \handletokens ...ndletokens {#2}\dohandletokens #1
  \end
 l.96 \handletokens MetaPost is Fun!\with\whatever

 Anybody any idea?

 Regards,
 Gerard Verhaag
 ___

 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
 ___


 Hi,
 
 I'm in need of help to get the example as described in the MetaFun
 manual running, because I want to use text around a path!
 
 So, I started reading the chapter about 'Typesetting in METAPOST' and
 wanted to try the examples as given in that chapter, but without succes!
 
 The problem seem to be the MPtoks macro. According to the text in this
 chapter this low level macro (and MPbox and appendtoks) are already
 defined, but are they really?
 
 The version of context minimals I use at the moment is:
 
 MTXrun | current version: 2011.01.18 19:34
 
 Any suggestions are very much welcomed! Thanks in advance!
 

Hi Gerard,

how about an alternative way to deal with this?

1. draw the text with Inkscape (put text on a path);
   I think there is even a tutorial for this.
2. select the graphic and save it as *.eps
3. use pstoedit to convert it into *.mp

   pstoedit -v -ssp -f mpost: foo.eps foo.mp

4. edit/scale the metapost graphic as you like


Best wishes,  Peter
___
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] How to run Typesetting in MetaPost example (MetaFun)?

2011-01-19 Thread Aditya Mahajan

On Tue, 18 Jan 2011, Verhaag, G.C.H.M. wrote:


Hi,

I wanted to try (using ConTeXt minimals MkIV) the example on page 228 of the 
MetaFun manual, dealing with typesetting in MetaPost.


I haven't look at the metapost manual ... but


The code is given as:

\resetMPdrawing
\startMPdrawing
picture pic[] ;
numeric wid[], len[], pos[], n ;
wid[0] := len[0] := pos[0] := n := 0 ;
\stopMPdrawing

\def\whatever#1%
{\appendtoks#1\to\MPtoks
\setbox\MPbox=\hbox{\bfd\the\MPtoks}%
\startMPdrawing
 n := n + 1 ; len[n] := \the\wd\MPbox ;
\stopMPdrawing
\startMPdrawing[-]
 pic[n] := textext(\bfd\setstrut\strut#1) ;
 pic[n] := pic[n] shifted - llcorner pic[n] ;
\stopMPdrawing}

\handletokens MetaPost is Fun!\with\whatever

But is won't run. The following message is generated:


The actual error message said

! Undefined control sequence.
\@@toks -\MPtoks

So add

\newtoks\MPtoks

After which you get

! Undefined control sequence.
\whatever ...endtoks #1\to \MPtoks \setbox \MPbox

so add

\newbox\MPbox

After that the file compiles but you get an empty image. There are two 
things missing in the code. First you don't tell actually draw the 
metapost drawing. for that, add


\MPdrawingdonetrue \getMPdrawing \resetMPdrawing


Still an empty page. Again the pic[n] is calculated but never drawn. So 
add


  draw p[n] shifted (n*1cm,0) ;

(or perhaps along a more sophisticated path),

and now you have a working example:

\newtoks\MPtoks
\newbox\MPbox

\resetMPdrawing
\startMPdrawing
  picture p[] ;
  numeric wid[], len[], pos[], n ;
  wid[0] := len[0] := pos[0] := n := 0 ;
\stopMPdrawing

\def\whatever#1%
{\appendtoks#1\to\MPtoks
 \setbox\MPbox=\hbox{\bfd\the\MPtoks}%
 \startMPdrawing
  n := n + 1 ; len[n] := \the\wd\MPbox ;
  p[n] := textext(\bfd\setstrut\strut#1) ;
  p[n] := p[n] shifted - llcorner p[n] ;
  draw p[n] shifted (n*1cm,0) ;
 \stopMPdrawing}

\starttext
\handletokens MetaPost is Fun!\with\whatever

\MPdrawingdonetrue \getMPdrawing \resetMPdrawing

\stoptext

You could also have just used the macros from meta-txt:

\useMPlibrary[txt]

\startMPdefinitions
  newpath RotPath ;
  RotPath = fullcircle scaled 3cm ;
\stopMPdefinitions

\starttext
\followtokens{Metapost is fun \quad}
\stoptext

@Hans: Perhaps we can have a more ConTeXtist interface to this macro:

\definetextonepath
   [whatever]
   [color=...,
style=...,
mp=..., % path specification
   ]

\whatever{Metapost is fun}

Aditya
___
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] \hangaround in xml mkiv

2011-01-19 Thread R. Ermers
Dear All,

I am processing a docbook xml file, which works great (thanks to Wolfgang's 
introduction to TEI). 

I have some images and I want the text before and after them to wrap around. 
This can be achieved through the command \starthangaround .. \stoparound.

Since the text that is to wrap around must be put between commands, I cannot 
attach the image to the figure/graphic tags that are within that text. The 
figure tag does not allow the para tag to be inserted, nor do other approprate 
media tags.

Instead I attached them to the attribute 'role' of the para tag:

para role=dolce1abcdef abcef/para

In the environment file I specified this:

\xmlsetsetup{#1}{//para[@role]}{xml:chapter:para:role}

The hangaround environment is put in the accompanying startxmlsetups:

\startxmlsetups xml:chapter:para:role
\starthangaround{\externalfigure[\xmlatt{#1}{role}]}
\xmlflush{#1}
\stophangaround
\stopxmlsetups

I also added an \xmlflush, assuming that the text itself is processed there.

In a rough sense this works. There is a white angle in the text for the image. 
However, the image itself slides away.

I am not sure what is going wrong. Has anybody got a clue?

Thanks!

Regards,

Robert

 


___
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] Translating PDF-files

2011-01-19 Thread Alan BRASLAU
More off topic:

A fun 'esercise be to put some text drough google translate into any language, 
den pass de result back into de o'iginal language. What it is, Mama!

(via jive, a good exercise in lex and yacc, very politically incorrect!)


On Wednesday 19 January 2011 17:18:35 Alan BRASLAU wrote:
 A fun exercise is to put a text through google translate into any language,
 then pass the result back into the original language.
 
 via Russian: Fun exercise is to put the text through Google Translate in
 any language, and then pass the result back to the original language.
 
 via Japonese: Exercise is fun, Google is placing text via translation into
 other languages To pass the result to the original language.
 
 via French (for Arthur): A fun exercise is to put a text through Google
 translate in any language, then pass the result in the original language.
 
 ...
 
 Alan
 
 On Wednesday 19 January 2011 17:06:53 R. Ermers wrote:
  Still off topic:
  
  Well, this is partly lexicological knowledge and research on translation.
  Each language pair and translation direction has its peculiar problems.
  
  Whether or not you are able to say it is pure speculation depends on
  how familiar you are with computer linguistics, and its progress in
  determining semantic content from texts (step 1) and rephrasing it in a
  given target language (step 2).
  
  I'm glad that you accept that it is about the pair and the direction of
  the translation.
  
  Robert
  
   It is not a language in general that is difficult, but the pair a
   language is in: the pair English-Russian is, in some aspects, more
   difficult than the other way around because of the choice for the
   perfective aspect or imperfective aspect of the tenses. An English
   text does not offer any clues as to which aspect to choose, but
   anyone who wants to speaks Russian has to decide instantly. A program
   is unlikely do that.
   
I'm sorry, but that's pure speculation.  It would be interesting to
   
   see research about machine translation for some particular language
   pairs, though.
   
 Arthur
   
   ___
   __ __ 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
  _
  __ 

-- 
Alan Braslau
CEA DSM-IRAMIS-SPEC
CNRS URA 2464
Orme des Merisiers
91191 Gif-sur-Yvette cedex FRANCE
tel: +33 1 69 08 73 15
fax: +33 1 69 08 87 86
mailto:alan.bras...@cea.fr

 .''`.
: :'  :
`. `'`
  `-
___
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] \getscaledglyph

2011-01-19 Thread Thomas Floeren
Hi,

I did a rather huge update step from my working context 2010.09.29 to the 
actual beta. I noted that \getscaledglyph doesn’t work anymore. 

I use it a lot for symbol insertions like this:

\definefontsynonym [ArialU] [name:ArialUnicodeMS]
\definesymbol [Diameter] [\getscaledglyph{1.5}{ArialU}{\char2300}]
\def\Diam{\symbol[Diameter]}

\starttext
hello \Diam\ goodbye
\stoptext


( \getglyph seems to work as usual: \definesymbol [Diameter] 
[\tfb\getglyph{ArialU}{\char2300}] )

Should I better change my definitions or is it just a bug?



Thank you
 Greetings
Thomas


MTXrun | current version: 2011.01.18 19:34
This is LuaTeX, Version beta-0.65.0-2010121316

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