Re: [NTG-context] Typesetting Korean
Hi ConTeXt-ers, I solved this in consultation with Dohyun Kim of the Korean Tex Users group. He send me a couple of files that I untarred to my local ConTeXt tree. % --- %< - untarred ko.tex-unfonts-base.tar.gz in /home/saji/MyConText/tex/texmf-local untarred context-kor.tar.gz /home/saji/MyConText/tex/texmf-local/tex/context mktexlsr texexec --make --alone % --- %< - And thereafter added the following lines to the top of my source code. \enableregime[utf] \usemodule[kor-00] Hope this may be of help to someone with similar needs (someday) :) saji * Dohyun Kim <[EMAIL PROTECTED]> [2007-11-27 14:08:11 +0900]: > Hi, > > I have just uploaded my small implementation of Korean typesetting > with ConTeXt to the site: > > http://people.ktug.or.kr/~nomos/mine/context-kor.tar.gz > > > You may also need a set of Korean fonts, among which > the most popular is > > http://ftp.ktug.or.kr/KTUG/ko.tex/ko.tex-unfonts-base.tar.gz > > > Then, write down a tex file, including followings in the preamble > > \enableregime[utf] > \usemodule[kor-00] > > > I wish this small piece of work would be a some help to you. > * Saji Njarackalazhikam Hameed <[EMAIL PROTECTED]> [2007-11-27 09:57:17 +0900]: > Hi Dalyoung, > > Sorry this question is not related to your original mail. We are > typesetting some of our reports in ConTeXt - the material is > mostly English, but at places there are summaries in "Hangul". > > Any suggestions on how to input hangul in ConTeXt. > > Best wishes, > > saji > > > * Dalyoung Jeong <[EMAIL PROTECTED]> [2007-11-26 13:48:47 +0900]: > > > Dear Idris, Aditya, and Wolfgang, > > > > Thank you for the replies. > > > > Removing \start-stop formula and using \vcenter worked well. > > However, adding $\displaystyle ...$ gave the strange output. The > > location of the captions are not under the matrix. It looks like that > > there are four columns, "matrix cap matrix cap". > > > > I have one more question. > > > > Is it possible to display three figures in a triangular shape as > > following? > > > > < figure 1 > > > > > < figure 2> > > > > I tried to use \srartcombination[3*2] ... using a dummy blank figure. > > But because of the figure 1, there is a wide blank spaces between two > > figures. > > > > Thank you so much. > > > > Best regards, > > > > Dalyoung > > ___ > > 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 : https://foundry.supelec.fr/projects/contextrev/ > > wiki : http://contextgarden.net > > ___ > > -- > Saji N. Hameed > > APEC Climate Center +82 51 668 7470 > National Pension Corporation Busan Building 12F > Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [EMAIL > PROTECTED] > KOREA > ___ > 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 : https://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___ -- Saji N. Hameed APEC Climate Center +82 51 668 7470 National Pension Corporation Busan Building 12F Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [EMAIL PROTECTED] KOREA ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Typesetting Korean
Hi Dalyoung, Sorry this question is not related to your original mail. We are typesetting some of our reports in ConTeXt - the material is mostly English, but at places there are summaries in "Hangul". Any suggestions on how to input hangul in ConTeXt. Best wishes, saji * Dalyoung Jeong <[EMAIL PROTECTED]> [2007-11-26 13:48:47 +0900]: > Dear Idris, Aditya, and Wolfgang, > > Thank you for the replies. > > Removing \start-stop formula and using \vcenter worked well. > However, adding $\displaystyle ...$ gave the strange output. The > location of the captions are not under the matrix. It looks like that > there are four columns, "matrix cap matrix cap". > > I have one more question. > > Is it possible to display three figures in a triangular shape as > following? > > < figure 1 > > > < figure 2> > > I tried to use \srartcombination[3*2] ... using a dummy blank figure. > But because of the figure 1, there is a wide blank spaces between two > figures. > > Thank you so much. > > Best regards, > > Dalyoung > ___ > 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 : https://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___ -- Saji N. Hameed APEC Climate Center +82 51 668 7470 National Pension Corporation Busan Building 12F Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [EMAIL PROTECTED] KOREA ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] typesetting a bibtex file
I was used to the natbib package in LaTeX and used the following setting to simulate the \citet and \citep commands: \setupcite[authoryears][compress=no,pubsep=; ,lastpubsep=; ,left=[,right={]},] \setupcite[authoryear][left=[,right={]},] \def\citet{\cite[authoryear]} \def\citep{\cite[authoryears]} saji * Andrea Valle <[EMAIL PROTECTED]> [2007-11-13 01:45:45 +0100]: > Many thanks, I'm starting the experimentations. > > Best > > -a- > > On 12 Nov 2007, at 19:47, Jean Magnan de Bornier wrote: > >> \usemodule[bib] >> \mainlanguage[fr] >> \usemodule[bibltx] >> \setuppublications[alternative=apa-fr,criterium=all] >> \setupbibtex [database=/home/jean/BIB/jmb.bib] >> \starttext >> \setupheadtext[fr][pubs={Principales publications}] >> \nocite[*] >> \completepublications >> \stoptext > > -- > Andrea Valle > -- > CIRMA - DAMS > Università degli Studi di Torino > --> http://www.cirma.unito.it/andrea/ > --> [EMAIL PROTECTED] > -- > > > I did this interview where I just mentioned that I read Foucault. Who > doesn't in university, right? I was in this strip club giving this guy a > lap dance and all he wanted to do was to discuss Foucault with me. Well, I > can stand naked and do my little dance, or I can discuss Foucault, but not > at the same time; too much information. > (Annabel Chong) > > > > > ___ > 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 : https://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___ -- Saji N. Hameed APEC Climate Center +82 51 668 7470 National Pension Corporation Busan Building 12F Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [EMAIL PROTECTED] KOREA ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Doc to ConTeXt [was Re: HTML to ConTeXt]
Hi Andrea, I face a similar issue while organizing large-scale documents prepared by members of my group (many folks are not conversant with TeX here and write documents with WORD). My solution was to take their input through a wiki and convert the HTML to context markup using filters written with ruby (also see http://wiki.contextgarden.net/HTML_and_ConTeXt). Converting HTML syntax to ConTeXt syntax is very do-able. If it is of any use, I attach the ruby filters I use for my purpose. BTW, I use a ruby library called "hpricot" to ease some of these conversions. saji ... def scrape_the_page(pagePath,oFile,hFile) items_to_remove = [ "#menus",#menus notice "div.markedup", "div.navigation", "head", #table of contents "hr" ] doc=Hpricot(open(pagePath)) # this may not be applicable to your case # this removes some unnecessary markup from the Wiki pages @article = (doc/"#container").each do |content| #remove unnecessary content and edit links items_to_remove.each { |x| (content/x).remove } end # Write HTML content to file hFile.write @article.inner_html # How to replace various syntactic elements using Hpricot # replace p/b element with \bf (@article/"p/*/b").each do |pb| pb.swap("{\\bf #{pb.inner_html}}") end # replace p/b element with \bf (@article/"p/b").each do |pb| pb.swap("{\\bf #{pb.inner_html}}") end # replace strong element with \bf (@article/"strong").each do |ps| ps.swap("{\\bf #{ps.inner_html}}") end # replace h1 element with section (@article/"h1").each do |h1| h1.swap("\\section{#{h1.inner_html}}") end # replace h2 element with subsection (@article/"h2").each do |h2| h2.swap("\\subsection{#{h2.inner_html}}") end # replace h3 element with subsection (@article/"h3").each do |h3| h3.swap("\\subsubsection{#{h3.inner_html}}") end # replace h4 element with subsection (@article/"h4").each do |h4| h4.swap("\\subsubsubsection{#{h4.inner_html}}") end # replace h5 element with subsection (@article/"h5").each do |h5| h5.swap("\\subsubsubsubsection{#{h5.inner_html}}") end # replace by equivalent command in context (@article/"pre").each do |pre| pre.swap("\\startcode \n #{pre.at("code").inner_html} \n \\stopcode") end # when we encounter a reference to a figure inside the html # we replace it with a ConTeXt reference (@article/"a").each do |a| a.swap("\\in[#{a.inner_html}]") end # remove 'alt' attribute inside element # replace by equivalent command in context (@article/"p/img").each do |img| img_attrs=img.attributes['alt'].split(",") # separate the file name from the extension # have to take of file names that have a "." embedded in them img_src=img.attributes['src'].reverse.sub(/\w+\./,"").reverse # puts img_src # see if position of figure is indicated img_pos="force" img_attrs.each do |arr| img_pos=arr.gsub("position=","") if arr.match("position=") end img_attrs.delete("position=#{img_pos}") unless img_pos=="force" # see if the array img_attrs contains an referral key word if img_attrs.first.match(/\w+[=]\w+/) img_id=" " else img_id=img_attrs.first img_attrs.delete_at(0) end if img_pos=="force" if img.attributes['title'] img.swap(" \\placefigure\n [#{img_pos}][#{img_id}] \n {#{img.attributes['title']}} \n {\\externalfigure[#{img_src}][#{img_attrs.join(",")}]} \n ") else img.swap(" \\placefigure\n [#{img_pos}] \n {none} \n {\\externalfigure[#{img_src}][#{img_attrs.join(",")}]} ") end else if img.attributes['title'] img.swap(" \\placefigure\n [#{img_pos}][#{img_id}] \n {#{img.attributes['title']}} \n {\\externalfigure[#{img_src}][#{img_attrs.join(",")}]} \n ") else img.swap(" \\placefigure\n [#{img_pos}] \n {none} \n {\\externalfigure[#{img_src}][#{img_attrs.join(",")}]} \n ") end end end # end of converting inside (@article/"p/img") # why not search for table and if we find caption, keep it ; if not add an empty # Styling options: Here I catch the div element called Col2 and # format the tex document in 2 columns # Tables : placing them # replace by equivalent command in context (@article/"table").each do |tab| if tab.at("caption") tab.swap(" \\placetable[split]{#{tab.at("caption").inner_html}}\n {\\bTABLE \n #{tab.inner_html} \\eTABLE} ") else tab.swap(" \\placetable[split]{}\n {\\bTABLE \n #{tab.inner_html} \\eTABLE} \n ") end end # Tables: remove the caption (@article/"caption").each do |cap| cap.swap("\n") end # Now we transfer the syntactically altered html to a string Object # and manipulate that object further [EMAIL PROTECTED] # remove empty space in the beginning newdoc.gsub!(/^\s+/,"") # remove all elements we don't need. newdoc.gsub!(/^/,"\n") newdoc.gsub!(/<\/p>/,"\n") newd
Re: [NTG-context] Learning ConTeXt
Hi Istvan, For somebody used to LaTeX, it may be useful to check up http://www.berenddeboer.net/tex/ there is an article about doing similar things in LaTeX and ConTeXt. The options relevant to all ConTeXt commands are provided towards the end of cont-en?.pdf Perhaps mp-cb-en.pdf should be read first. I started out doing regular stuff such as formatting tables, sections, columns and the like. For more detailed control, it may be better to dwelve into some of the more specialized manuals archived at context.pragma.de The following website also may be of interest to you: http://levana.de/context/ And then there is the wiki: http://wiki.contextgarden.net I think the best way to learn is by trying to make the document you want in ConTeXt and asking questions to the mailing list when you cannot figure out how to do it. hope it helps, saji ... * Istvan Hollerbach <[EMAIL PROTECTED]> [2007-08-20 12:24:04 +0200]: > Hi Everybody, > > I want to learn ConTeXt, but 'cont-enp.pdf' and 'mp-cb-en.pdf' do not > explain many things in detail, for example the parameters of command > \setuplayout on the page 24 of cont-enp.pdf. Or am I careless? How shall > I start to learn? And how shall I go on learning? > > Best regards, > Istvan Hollerbach > > ___ > 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 : https://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___ -- Saji N. Hameed APEC Climate Center +82 51 668 7470 National Pension Corporation Busan Building 12F Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [EMAIL PROTECTED] KOREA ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] disabling reuse of figures
Dear All, It is a rather strange problem, I am compiling a presentation file using ConText. I use the \startcombination enviroment to make a panel containing 4 plots. In the source file, I prescibe a different figure file (*.png) for each page. ConText is however reusing the first set of figures so that the panel in each page looks the same as in the first page. Is there a way to disable the "reusing of figures"? A minimal example is reproduced below. thanks for any suggestions. saji \input setups \starttext \startcombination[2*2] {\externalfigure[/apcc01/OPER/AFS/FIG/3-MON/MME_OUT/FORECAST/GAUS/2007/6/Monthly/JUN/Global/prec.png]} {\externalfigure[/apcc01/OPER/AFS/FIG/3-MON/MME_OUT/FORECAST/GAUS/2007/6/Monthly/JUN/Global/t850.png]} {\externalfigure[/apcc01/OPER/AFS/FIG/3-MON/MME_OUT/FORECAST/GAUS/2007/6/Monthly/JUN/Global/z500.png]} {\externalfigure[]} \stopcombination \page \startcombination[2*2] {\externalfigure[/apcc01/OPER/AFS/FIG/3-MON/MME_OUT/FORECAST/SCM/2007/6/Monthly/JUN/Global/prec.png]} {\externalfigure[/apcc01/OPER/AFS/FIG/3-MON/MME_OUT/FORECAST/SCM/2007/6/Monthly/JUN/Global/t850.png]} {\externalfigure[/apcc01/OPER/AFS/FIG/3-MON/MME_OUT/FORECAST/SCM/2007/6/Monthly/JUN/Global/z500.png]} {\externalfigure[]} \stopcombination \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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] presentation module
Thomas, Thanks for the presentation module. It is great. Just to let you know that the following files are missing in the zip file provided at > downloaded at the garden: http://modules.contextgarden.net/taspresent 1. demo.tex 2. hor.jpg, vert.jpg saji ... * Thomas A. Schmitz <[EMAIL PROTECTED]> [2007-07-22 14:46:07 +0200]: > Hi all, > > after some feedback and some more fiddling around, I have now > uploaded a first (beta) version of the presentation module. It can be > downloaded at the garden: http://modules.contextgarden.net/taspresent > > It has been improved (at least I hope); in particular, it provides > more configurability and a couple of new styles. Have a look and let > me know if you like it. (And those to whom I have sent the first > version: feedback would still be welcome!) > > Best > > 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 : https://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___ -- Saji N. Hameed APEC Climate Center +82 51 668 7470 National Pension Corporation Busan Building 12F Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [EMAIL PROTECTED] KOREA ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Columns and colour background [urgent]
Oliver, adding the option=background may help \setupcolumns[option=background] saji .. * Oliver Buerschaper <[EMAIL PROTECTED]> [2007-07-24 14:16:34 +0200]: > Dear folks, > > I'm reposting this because I haven't got any answers so far and also > because this is somewhat urgent for me. I need this for a scientific > poster which is due rather soon ... Please share your valuable advice > with me :-) > > Oliver > > > > Consider this: > > --- > > \setupcolors > [state=start] > > \setupcolumns > [background=color, >backgroundcolor=red] > > > \starttext > > \startcolumns[n=2] > \dorecurse{4}{\input tufte} > \stopcolumns > > \framed[background=color,backgroundcolor=red]{Test} > > \stoptext > > --- > > Shouldn't the background of my columns be painted red? According to > the manual \setupcolumns inherits from \setupframed which does 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 : https://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___ -- Saji N. Hameed APEC Climate Center +82 51 668 7470 National Pension Corporation Busan Building 12F Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [EMAIL PROTECTED] KOREA ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Html to Context using Wiki + hpricot
Dear All, I have added an article to the ConTeXt wiki on using Wiki as a collaborative medium for making ConTeXt documents. It is a preliminary version. I will continue to polish it in my spare time. Meanwhile comments/suggestions are welcome. http://wiki.contextgarden.net/HTML_and_ConTeXt saji .. * luigi scarso <[EMAIL PROTECTED]> [2007-07-11 10:27:12 +0200]: > On 7/11/07, Saji Njarackalazhikam Hameed <[EMAIL PROTECTED]> wrote: > > Hello All, > > > > I wanted to share my recent experience > Really interesting . > Please, put all these on > wiki.contextgarden.net > > > > -- > 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 : https://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 : https://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___ -- Saji N. Hameed APEC Climate Center +82 51 668 7470 National Pension Corporation Busan Building 12F Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [EMAIL PROTECTED] KOREA ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Html to Context using Wiki + hpricot
Thanks, Luigi...i will do so. Would it be appropriate to put it under the section "General ConTeXt Documents"? Let me know otherwise and in that case let me know where would be a good place to add this article. saji .. * luigi scarso <[EMAIL PROTECTED]> [2007-07-11 10:27:12 +0200]: > On 7/11/07, Saji Njarackalazhikam Hameed <[EMAIL PROTECTED]> wrote: > > Hello All, > > > > I wanted to share my recent experience > Really interesting . > Please, put all these on > wiki.contextgarden.net > > > > -- > 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 : https://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 : https://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___ -- Saji N. Hameed APEC Climate Center +82 51 668 7470 National Pension Corporation Busan Building 12F Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [EMAIL PROTECTED] KOREA ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Html to Context using Wiki + hpricot
Hello All, I wanted to share my recent experience in co-ordinated document development. In our office we have to make annual reports, each part of which is contributed by a member. Previously everybody wrote 'Word' documents which was compiled into a larger report. Recently we had the idea to use a Wiki to ease the pain out of this process and to make it enjoyable for everyone involved. After looking around various wiki software we decided to install a brand-new one called Informl (http://informl.folklogic.net) . One nice feature about this is that in the edit mode twin windows are used, one for input and the other a realtime preview window. Anyway this approach could work with any Wiki software. One motivation behind using a Wiki as front-end was to involve people who new nothing about Tex or Context. Secondly it allowed any person to participate in the process from anywhere. Next we used the ruby library hpricot to retrieve the web document and filter it into a context document. This step was interesting and I would like to sharing the code with anybody interested. I am a novice Ruby programmer, so the code may be far from perfect .. nevertheless. saji % scan_page.rb = Retrieves the html page of interest from the server, navigates to links within the main page and construct a context document #!/usr/bin/ruby require 'rubygems' require 'open-uri' require 'hpricot' require 'scrape_page' # scans the home page and lists # all the directories and subdirectories doc=Hpricot(open("http://190.1.1.24:3010/AnnRep07";)) mainfil="annrep.tex" `rm #{mainfil}` fil=File.new(mainfil,"a") fil.write "\\input context_styles \n" fil.write "\\starttext \n" fil.write "\\leftaligned{\\BigFontOne Contents} \n" fil.write "\\vfill \n" fil.write "{ \\switchtobodyfont[10pt] " fil.write "\\startcolumns[n=2,balance=no,rule=off,option=background,frame=off,background=color,backgroundcolor=blue:1] \n" fil.write "\\placecontent \n" fil.write "\\stopcolumns \n" fil.write "}" chapters= (doc/"p/a.existingWikiWord") # we need to navigate one more level into the web page # let us discover the links for that chapters.each {|ch| chap_link = ch.attributes['href'] # using inner_html we can create subdirectories chap_name = ch.inner_html.gsub(/\s*/,"") chap_name_org = ch.inner_html # We create chapter directories system("mkdir -p #{chap_name}") puts chap_name # if chapter name starts with underscore (_) skip it if chap_name.match(/^\_/) puts chap_name next end fil.write "\\input #{chap_name} \n" chapFil="#{chap_name}.tex" `rm #{chapFil}` cFil=File.new(chapFil,"a") cFil.write "\\chapter{ #{chap_name_org} } \n" # We navigate to sections now doc2=Hpricot(open(chap_link)) sections= (doc2/"p/a.existingWikiWord") sections.each {|sc| sec_link = sc.attributes['href'] sec_name = sc.inner_html.gsub(/\s*/,"") secFil="#{chap_name}/#{sec_name}.tex" `rm #{secFil}` sFil=File.new(secFil,"a") sechFil="#{chap_name}/#{sec_name}.html" `rm #{sechFil}` shFil=File.new(sechFil,"a") # scrape_the_page(sec_link,"#{chap_name}/#{sec_name}") scrape_the_page(sec_link,sFil,shFil) cFil.write "\\input #{chap_name}/#{sec_name} \n" } } fil.write "\\stoptext \n" % The program calls scrape_page.rb, a function that does most of the filtering Function: scrape_page.rb def scrape_the_page(pagePath,oFile,hFile) items_to_remove = [ "#menus",#menus notice "div.markedup", "div.navigation", "head", #table of contents "hr" ] doc=Hpricot(open(pagePath)) @article = (doc/"#container").each do |content| #remove unnecessary content and edit links items_to_remove.each { |x| (content/x).remove } end # Write HTML content to file hFile.write @article.inner_html # How to replace various syntactic elements using Hpricot # replace p/b element with /f (@article/"p/*/b").each do |pb| pb.swap("{\\bf #{pb.inner_html}}") end # replace p/b element with /bf (@article/"p/b").each do |pb| pb.swap("{\\bf #{pb.inner_html}}") end # replace strong element with /bf (@article/"strong").each do |ps| ps.swap("{\\bf #{ps.inner_html}}") end # replace h1 element with section (@article/"h1").each do |h1| h1.swap("\\section{#{h1.inner_html}}") end # replace h2 element with subsection (@article/"h2").each do |h2| h2.swap("\\subsection{#{h2.inner_html}}") end # replace h3 element with subsection (@article/"h3").each do |h3| h3.swap("\\subsubsection{#{h3.inner_html}}") end # replace h4 element with subsection (@article/"h4").each do |h4| h4.swap("\\subsubsubsection{#{h4.inner_html}}") end # replace h5 element with subsection (@article/"h5").each do |h5| h5.swap("\\subsubsubsubsection{#{h5.inner_html}}") end # replace by equivalent command in context (@article/"pre").each do |pre| pre.swap("\\startcode \n #{pre.at("code").
Re: [NTG-context] Reset a setup directive
Hi Wolfgang, Thanks very much for the detailed response. I have been organizing a co-ordinated document development project (more in the next mail) with my colleagues. We use a wiki to input contents, which I then scrape with hapricot and filter into a context document. Having a setup like what you suggested eases up the process. Thanks again, saji ... * Wolfgang Schuster <[EMAIL PROTECTED]> [2007-07-11 08:36:39 +0200]: > 2007/7/10, Saji Njarackalazhikam Hameed <[EMAIL PROTECTED]>: > > Hi Folks, > > > > Is there a way to reset a \setupSomeThing[ ] directive? > > > > Consider for instance a complex setup for TABLES. Imagine > > I have used this setup for some parts of the document, but > > later on I want to have a radically different setup for TABLES, say. > > > > Is there a convenient way to do this as we can do with \reset[counter]. > > > > saji > > Hi Saji, > > there is currently no command to reset the global TABLE setups > but you set them local for every table: > > \start > \setupTABLE[...] > \bTABLE > ... > \eTABLE > \stop > > or you can define setups with often used setup parameters in the preamble > and use call them in your document for the corresponding table. > > \startsetups table:noframe > \setupTABLE[frame=off] > \stopsetups > > \startsetups table:colorlines > \setupTABLE[row][odd][background=screen] > \stopsetups > > \startsetups table:normal > \setupTABLE[background=,frame=on] > \stopsetups > > \setupcolors[state=start] > > \starttext > > \startbuffer > \bTABLE > \dorecurse{10} > {\bTR >\bTD Text \eTD\bTD Text \eTD >\eTR} > \eTABLE > \stopbuffer > > \start > \setups{table:noframe} > \getbuffer > \stop > > \start > \setups{table:colorlines} > \getbuffer > \stop > > \getbuffer > > \stoptext > > @Hans: Is it possible to integrate a setups key into \bTABLE to write > something like \bTABLE[setups=table:noframe] to avoid the \start/\stop > and \setups{..} commands as I did in my example above. > > 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 : https://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___ -- Saji N. Hameed APEC Climate Center +82 51 668 7470 National Pension Corporation Busan Building 12F Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [EMAIL PROTECTED] KOREA ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Reset a setup directive
Hi Folks, Is there a way to reset a \setupSomeThing[ ] directive? Consider for instance a complex setup for TABLES. Imagine I have used this setup for some parts of the document, but later on I want to have a radically different setup for TABLES, say. Is there a convenient way to do this as we can do with \reset[counter]. saji -- Saji N. Hameed APEC Climate Center +82 51 668 7470 National Pension Corporation Busan Building 12F Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [EMAIL PROTECTED] KOREA ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Natural TABLE does not split with \placetable
Thanks very much. saji * Wolfgang Schuster <[EMAIL PROTECTED]> [2007-07-04 07:47:48 +0200]: > 2007/7/4, Saji Njarackalazhikam Hameed <[EMAIL PROTECTED]>: > > > > Hi, > > > > I am using Natural Tables to typeset a rather long table. If I > > embed the table within a \placetable[][]{}{\bTABLE \eTABLE}, I > > cannot get the table to spread over multiple pages. > > > > The table extends over multiple pages, if I do not embed it > > within \placetable. > > > > Can somebody help? I am using the latest version of context > > ( i believe ) : > > > > texexec --version > > TeXExec | version 6.2.0 - 1997-2006 - PRAGMA ADE/POD > > > > saji > > > > -- > > Saji N. Hameed > > \starttext > > \placetable > [split] > {Splitted table} > {\bTABLE >\dorecurse{100}{\bTR\bTD text\eTD\eTR} >\eTABLE} > > \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 : https://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___ -- Saji N. Hameed APEC Climate Center +82 51 668 7470 National Pension Corporation Busan Building 12F Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [EMAIL PROTECTED] KOREA ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Natural TABLE does not split with \placetable
> Can you give an example ? i am cutting and pasting this from Wolfgang. He suggested using the split option and it works. \starttext \placetable [split] {Splitted table} {\bTABLE \dorecurse{100}{\bTR\bTD text\eTD\eTR} \eTABLE} \stoptext * luigi scarso <[EMAIL PROTECTED]> [2007-07-04 09:08:53 +0200]: > Can you give an example ? > > -- > 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 : https://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 : https://foundry.supelec.fr/projects/contextrev/ > wiki : http://contextgarden.net > ___ -- Saji N. Hameed APEC Climate Center +82 51 668 7470 National Pension Corporation Busan Building 12F Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [EMAIL PROTECTED] KOREA ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
[NTG-context] Natural TABLE does not split with \placetable
Hi, I am using Natural Tables to typeset a rather long table. If I embed the table within a \placetable[][]{}{\bTABLE \eTABLE}, I cannot get the table to spread over multiple pages. The table extends over multiple pages, if I do not embed it within \placetable. Can somebody help? I am using the latest version of context ( i believe ) : texexec --version TeXExec | version 6.2.0 - 1997-2006 - PRAGMA ADE/POD saji -- Saji N. Hameed APEC Climate Center +82 51 668 7470 National Pension Corporation Busan Building 12F Yeonsan 2-dong, Yeonje-gu, BUSAN 611705 [EMAIL PROTECTED] KOREA ___ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___
Re: [NTG-context] Placing table of contents in a frame
Frank ... forgot to mention that you may need to typeset on a grid when using the following way. \setuplayout [grid=yes] saji > Frank, > > I am also trying to do a similar project. My way not be a good one, but > here is how I am trying to do it. > > Basically, I use columnsets (see manual columns.pdf from PRAGMA) to > typeset my newsletter. I am using a 3 column layout and want a column > containing the "Table of Contents" on the right side (3rd column). > > > \definecolumnset[example][n=3] > \setupcolumnsetlines[example][1][3][-50] % From Page 1, Column 3, > % remove 50 lines > % I will put the TOC on > % Column 3 > > \starttext > > \startcolumnset[example] > \placefigure[fxtb:3*1]{none}{\framed[frame=off, > height=5cm, > width=\textwidth, > background=color, > backgroundcolor=yellow]{\blue\txx\placecontent}} > \input Newsletter_Final > > \stopcolumnset > > \stoptext > > Saji > .. ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Placing table of contents in a frame
Frank, I am also trying to do a similar project. My way not be a good one, but here is how I am trying to do it. Basically, I use columnsets (see manual columns.pdf from PRAGMA) to typeset my newsletter. I am using a 3 column layout and want a column containing the "Table of Contents" on the right side (3rd column). \definecolumnset[example][n=3] \setupcolumnsetlines[example][1][3][-50] % From Page 1, Column 3, % remove 50 lines % I will put the TOC on % Column 3 \starttext \startcolumnset[example] \placefigure[fxtb:3*1]{none}{\framed[frame=off, height=5cm, width=\textwidth, background=color, backgroundcolor=yellow]{\blue\txx\placecontent}} \input Newsletter_Final \stopcolumnset \stoptext Saji .. > I'm trying to move a newsletter from a DTP program to ConTeXt. In this > layout we have a blue column on the left side of the page with a table > of contents. I played around with the framed command and layers, but > did not find a way to put the TOC in a frame at a specific location. > What would be a ConTeXt way of doing this? > Regards, > Frank ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] ntg-context Digest, Vol 25, Issue 12
Aditya, Thanks for the reply. The Wiki has information on installing (or updating) context from a distribution such as teteX. Anyway a minimal install turned out to be quite a simple process. Here is how I did it: #!*& #!/bin/bash cd /usr/local unzip justtex.zip unzip linuxtex.zip cd tex . setuptex mktexlsr texexec --make --alone cp -a /usr/local/tex/texmf-linux/web2c/* \ /usr/local/tex/texmf-local/web2c/ mktexlsr #!*& saji ... > On Tue, 4 Jul 2006, Saji Njarackalazhikam Hameed wrote: > > > Dear Context-ers, > > > > I would like to install the minimal context distribution, but have no > > idea of which zip files to download and how to configure the system. I > > have seen that there are many zip files in the "Pragma" website : > > justtex.zip, cont-bas.zip, cont-tmf.zip, linuxtex.zip. > > > > Any advice on setting up a minimal system to use Context will be > > appreciated. > > > > Does "Installing Context" on context wiki > http://wiki.contextgarden.net/Main_Page help? > > Hans, should there be a link to the wiki on pragma's website? > > Aditya > ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] Install minimal context distribution
Dear Context-ers, I would like to install the minimal context distribution, but have no idea of which zip files to download and how to configure the system. I have seen that there are many zip files in the "Pragma" website : justtex.zip, cont-bas.zip, cont-tmf.zip, linuxtex.zip. Any advice on setting up a minimal system to use Context will be appreciated. Thanks, saji -- Saji N. Hameed, Assistant Researcher, Tel:808 9569534 International Pacific Research Center, email:[EMAIL PROTECTED] 2525 Correa Rd, Honolulu, HI 96822 http://iprc.soest.hawaii.edu/~saji ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context