Re: [O] multilingual presentation with org

2012-02-16 Thread Rustom Mody
On Fri, Feb 17, 2012 at 4:29 AM, Daniel Clemente  wrote:

>
>
> El Wed, 15 Feb 2012 13:33:49 +0530 Rustom Mody va escriure:
>
> > Now I am exploring how I could 'zip' the two together. My requirements
> are like this:
> >
> > Any thoughts/suggestions?
> >
>
>  I made a small markup language which lets you write it in this way:
>
>
> ---
> A song in English and Sanskrit:
>

Thanks Daniel -- that looks useful at some stage of the processing. I was
thinking of concocting something like this myself.
My (current main) use is a bit different however. Its not so much
hand-translation as machine-transliteration.

The below elisp code will apply whatever input-method you put into
rpm-input-method and put the result into a new buffer.  After that pasting
the two together into something palatable/presentable is the question.  For
now Ive used paste -d'|' and then run it through org's table system to
produce html


---elisp-
(defvar rpm-input-method "devanagari-itrans")
(defun rpm-apply-input-method ()
  (interactive)
  (let* ((inp (buffer-substring-no-properties (point-min) (point-max)))
 (filename (file-name-nondirectory (buffer-file-name)))
 (outname (concat (file-name-sans-extension filename)
   "-hi"
   (file-name-extension filename t)))
 (p))
(switch-to-buffer-other-frame outname)
(save-excursion
  (save-window-excursion
(setq p (point))
(erase-buffer)
(setq buffer-file-coding-system 'utf-8)
(set-input-method rpm-input-method t)
(execute-kbd-macro inp)))
(goto-char p)
(other-frame 1)))

(global-set-key [f4] 'rpm-apply-input-method)


Re: [O] multilingual presentation with org

2012-02-16 Thread Daniel Clemente


El Wed, 15 Feb 2012 13:33:49 +0530 Rustom Mody va escriure:
 
> Now I am exploring how I could 'zip' the two together. My requirements are 
> like this:
> 
> Any thoughts/suggestions?
> 

  I made a small markup language which lets you write it in this way:


---
A song in English and Sanskrit:

@en bhaja govindam bhaja govindam
@sa भज गोविंदं भज गोविंदं

@en govindam bhaja mUDhamate
@sa गोविंदं भज मूढमते

@en saMprApte sannihite kAle
@sa संप्राप्ते सन्निहिते काले

@en nahi nahi rakShati DukrinkaraNe
@sa नहि नहि रक्षति डुकृंकरणे

---


  You run it through a script and you obtain two files, one with all the @en 
and the other with all the @sa. The common text goes to both.
  The script is at http://www.danielclemente.com/dislines/index.en.html


  How to integrate this approach with org's outline… is a challenge. One header 
per language? One property per language? Inline headers?…



Daniel



Re: [O] multilingual presentation with org

2012-02-15 Thread Jambunathan K
Nick Dokos  writes:

> Jambunathan K  wrote:
>
>> 
>> Nick
>> 
>> What Brian is saying is this and I am interpreting.
>> 
>> There is a line by line correspondence between the two files. So,

See the attached screenshot.

>> 1. Put the English file under version control and check it in.

This is recital.txt.~HEAD~ in the upper window.

>> 2. Overwrite the English file with the Sanskrit file (remember to
>>preserve line by line correspondence) and check the sanskrit file in.

Just overwrite but don't check it in. This recital.txt is in the lower
window.

>> 3. Now do a C-x v u to launch ediff on the two versions of the file. Two
>>windows will pop up and IIRC, you can arrange for the windows to be
>>either arranged side by side or one on top of another.
>> 4. Press q on Ediff control panel so that diff overlays are removed
>>while leaving the windows intact.
>> 

The command should be C-x v = which I have arranged so that it launches
ediff for me with the two buffers arranged one below the other. (I have
some customizations and I can dig out my customization if you need. My
customizations pre-date Emacs-24.1) But Emacs-24.1 does have a
vc-ediff. So I believe C-x v = can rebound to vc-ediff if it isn't
already.

Also note the cursors in the two windows.

> I don't understand what the first four steps do for you.

My setup is so old (and is so part of the way I do commits for as long
as I remember) that I confused myself into thinking that they are part
of Emacs. I am not to blame here, only my memory.

>> 5. Now do M-x scroll-all-mode so that the two windows scroll
>>together. Cursor position in the two windows can be used to guiding
>>the eyeballs of the audience.
>> 
>
> All you need for this is two side-by-side windows with the two files and
> scroll-all-mode[fn:1]. Ediff (and source control) is irrelevant -
> correct?

Correct. Ediff is not needed. But it is convenient. No C-x C-fs twice
over or splitting windows (atleast in my case)

> If only hl-line-highlight played well with scroll-all-mode...

We can make a feature request.

>
>> An advanced option will be to siphon off each stanza in the recital in
>> to separate files of their own and put the sanskrit and english files in
>> separate directories (but with the same name) as below.
>> 
>> english/stanza1
>> english/stanza2
>> 
>> sanskrit/stanza1
>> sanskrit/stanza2
>> 
>> Then one can do M-x ediff-directories to have all the stanzas show up
>> and then launch ediff on each of the stanzas.
>> 
>
> I might try this to see how it works but it'd take more time than I can
> afford right now.
>
> Thanks,
> Nick
>
> Footnotes:
>
> [fn:1] I was looking for that and didn't find it - thanks for pointing
>it out. I thought at first that follow-mode was what was needed,
>but that wasn't it.

<>

Re: [O] multilingual presentation with org

2012-02-15 Thread Nick Dokos
Jambunathan K  wrote:

> 
> Nick
> 
> What Brian is saying is this and I am interpreting.
> 
> There is a line by line correspondence between the two files. So,
> 
> 1. Put the English file under version control and check it in.
> 
> 2. Overwrite the English file with the Sanskrit file (remember to
>preserve line by line correspondence) and check the sanskrit file in.
> 
> 3. Now do a C-x v u to launch ediff on the two versions of the file. Two
>windows will pop up and IIRC, you can arrange for the windows to be
>either arranged side by side or one on top of another.
> 
> 4. Press q on Ediff control panel so that diff overlays are removed
>while leaving the windows intact.
> 

I don't understand what the first four steps do for you.

> 5. Now do M-x scroll-all-mode so that the two windows scroll
>together. Cursor position in the two windows can be used to guiding
>the eyeballs of the audience.
> 

All you need for this is two side-by-side windows with the two files and
scroll-all-mode[fn:1]. Ediff (and source control) is irrelevant -
correct?

If only hl-line-highlight played well with scroll-all-mode...

> An advanced option will be to siphon off each stanza in the recital in
> to separate files of their own and put the sanskrit and english files in
> separate directories (but with the same name) as below.
> 
> english/stanza1
> english/stanza2
> 
> sanskrit/stanza1
> sanskrit/stanza2
> 
> Then one can do M-x ediff-directories to have all the stanzas show up
> and then launch ediff on each of the stanzas.
> 

I might try this to see how it works but it'd take more time than I can
afford right now.

Thanks,
Nick

Footnotes:

[fn:1] I was looking for that and didn't find it - thanks for pointing
   it out. I thought at first that follow-mode was what was needed,
   but that wasn't it.



Re: [O] multilingual presentation with org

2012-02-15 Thread Jambunathan K

Nick

What Brian is saying is this and I am interpreting.

There is a line by line correspondence between the two files. So,

1. Put the English file under version control and check it in.

2. Overwrite the English file with the Sanskrit file (remember to
   preserve line by line correspondence) and check the sanskrit file in.

3. Now do a C-x v u to launch ediff on the two versions of the file. Two
   windows will pop up and IIRC, you can arrange for the windows to be
   either arranged side by side or one on top of another.

4. Press q on Ediff control panel so that diff overlays are removed
   while leaving the windows intact.

5. Now do M-x scroll-all-mode so that the two windows scroll
   together. Cursor position in the two windows can be used to guiding
   the eyeballs of the audience.

An advanced option will be to siphon off each stanza in the recital in
to separate files of their own and put the sanskrit and english files in
separate directories (but with the same name) as below.

english/stanza1
english/stanza2

sanskrit/stanza1
sanskrit/stanza2

Then one can do M-x ediff-directories to have all the stanzas show up
and then launch ediff on each of the stanzas.

> brian powell  wrote:
>
>
>> --It works if you put line numbers at the beginning of each
>> line--then it highlights the diff per line in both buffers/in both
>> files--you do "Mx ediff-buffers" on--I know it works if you do--I
>> tested it before I posted.
>
> I did and it did not. I did it with cat -n at first and then tried nl
> just to see if it had some magic (as one might have guessed, no magic):
> there is one diff region for the whole buffer, not one per line.
>
> Nick
>
> PS. I attach the two files in case you, or somebody else, want to try it
> although I'm not sure the attachments are going to make it through the
> list unscathed. I'm making them octet-streams to try to preserve the contents
> unscathed. Here are SHA1s for them if you want to check (foo.txt.n is
> the transliterated file, foo-hi.txt.n is the devanagari)
>
> 85fd89d20ba4d1443089726fdb7a8bee7c7698ec  foo-hi.txt.n
> e35932a206d2c129b8da1f855694d23838ea1013  foo.txt.n
>
>
>  1OM bhUrbhuvaH suvaH
>  2tatsaviturvarenyam
>  3bhargo devasya dhImahi
>  4dhiyo yonaH prachodayAt
>
>

-- 



Re: [O] multilingual presentation with org

2012-02-15 Thread Nick Dokos
brian powell  wrote:


> --It works if you put line numbers at the beginning of each
> line--then it highlights the diff per line in both buffers/in both
> files--you do "Mx ediff-buffers" on--I know it works if you do--I
> tested it before I posted.

I did and it did not. I did it with cat -n at first and then tried nl
just to see if it had some magic (as one might have guessed, no magic):
there is one diff region for the whole buffer, not one per line.

Nick

PS. I attach the two files in case you, or somebody else, want to try it
although I'm not sure the attachments are going to make it through the
list unscathed. I'm making them octet-streams to try to preserve the contents
unscathed. Here are SHA1s for them if you want to check (foo.txt.n is
the transliterated file, foo-hi.txt.n is the devanagari)

85fd89d20ba4d1443089726fdb7a8bee7c7698ec  foo-hi.txt.n
e35932a206d2c129b8da1f855694d23838ea1013  foo.txt.n




foo.txt.n
Description: transliterated sanskrit - latin chars


foo-hi.txt.n
Description: sanskrit - devanagari - utf-8


Re: [O] multilingual presentation with org

2012-02-15 Thread brian powell
* Nick mentioned "no "n" to follow the bouncing ball..."--in jest I
believe; but, seriously, you can do that too with EMACS and XAUTOMATION do:

apt-get install xautomation

(this will install xte I believe)

** well, if you wanted a "bouncing ball" to follow the music, in a say, 1
line per 3 seconds for a presentation/sing-along:

xterm -e watch -p -n3 "xte \"key n\"  "

*** Again, you put the cursor on the EDIFF help window --"n" will go line
per line

*** Which will work too; I do something like this everyday (use xte calling
out of EMACS/OrgMode several times a day at least).


On Wed, Feb 15, 2012 at 3:01 PM, brian powell wrote:

> * "That'd be cool if it worked, but at least in my case, it doesn't" --It
> works if you put line numbers at the beginning of each line--then it
> highlights the diff per line in both buffers/in both files--you do "Mx
> ediff-buffers" on--I know it works if you do--I tested it before I posted.
> I usually use "nl" (UNIX) to do this (quoting myself):
> ...
> nl sanskrit-song.txt > sanskrit-song_line-numbers-at-front.txt
> ...
>
> * Also, Thanks Nick for the pointing to notes on how to translate the
> english/roman script etc. and the updating of views related to this thread:
>
>
> "updated a thread on gnu.emacs.help with those
> suggestions: http://thread.gmane.org/gmane.emacs.help/83724
>
> On Wed, Feb 15, 2012 at 2:49 PM, Nick Dokos  wrote:
>
>> brian powell  wrote:
>>
>>
>> > Make 2 files with line numbers at the begin of each line:
>> > nl sanskrit-song.txt > sanskrit-song_line-numbers-at-front.txt
>> > nl english-song.txt > english-song_line-numbers-at-front.txt
>> > emacs -q -l
>> sanskit-blah-mule-multilingual-emacs-programs-needed-to-show-sanskrit.el
>> >
>>  sanskrit-song_line-numbers-at-front.txt 
>> english-song_line-numbers-at-front.txt
>> > Mx ediff-buffers
>> > Emacs will pop-up an ediff window--put your mouse cursor on it and tap
>> "?"--it will show you the
>> > ediff keys--"n" for "next different line" will be most helpful
>> > (ediff will ask for the 1st and 2nd buffer you want to compare--type
>> > in sanskrit-song_line-numbers-at-front.txt
>> and english-song_line-numbers-at-front.txt
>> >
>> > --then tapping "n" (with your cursor on the popped up ediff window)
>> goes line-by-songline in both
>> > buffers--highlighting the text for a sanskrit sing-along!
>> >
>>
>> "That'd be cool if it worked, but at least in my case, it doesn't:
>> diff decides there is one big diff that covers the whole file,
>> and ediff does not find a "better" refinement: no "n"
>> to follow the bouncing ball...
>>
>> Nick
>>
>>
>>
>


Re: [O] multilingual presentation with org

2012-02-15 Thread brian powell
* "That'd be cool if it worked, but at least in my case, it doesn't" --It
works if you put line numbers at the beginning of each line--then it
highlights the diff per line in both buffers/in both files--you do "Mx
ediff-buffers" on--I know it works if you do--I tested it before I posted.
I usually use "nl" (UNIX) to do this (quoting myself):
...
nl sanskrit-song.txt > sanskrit-song_line-numbers-at-front.txt
...

* Also, Thanks Nick for the pointing to notes on how to translate the
english/roman script etc. and the updating of views related to this thread:

"updated a thread on gnu.emacs.help with those
suggestions: http://thread.gmane.org/gmane.emacs.help/83724

On Wed, Feb 15, 2012 at 2:49 PM, Nick Dokos  wrote:

> brian powell  wrote:
>
>
> > Make 2 files with line numbers at the begin of each line:
> > nl sanskrit-song.txt > sanskrit-song_line-numbers-at-front.txt
> > nl english-song.txt > english-song_line-numbers-at-front.txt
> > emacs -q -l
> sanskit-blah-mule-multilingual-emacs-programs-needed-to-show-sanskrit.el
> >
>  sanskrit-song_line-numbers-at-front.txt 
> english-song_line-numbers-at-front.txt
> > Mx ediff-buffers
> > Emacs will pop-up an ediff window--put your mouse cursor on it and tap
> "?"--it will show you the
> > ediff keys--"n" for "next different line" will be most helpful
> > (ediff will ask for the 1st and 2nd buffer you want to compare--type
> > in sanskrit-song_line-numbers-at-front.txt
> and english-song_line-numbers-at-front.txt
> >
> > --then tapping "n" (with your cursor on the popped up ediff window) goes
> line-by-songline in both
> > buffers--highlighting the text for a sanskrit sing-along!
> >
>
> "That'd be cool if it worked, but at least in my case, it doesn't:
> diff decides there is one big diff that covers the whole file,
> and ediff does not find a "better" refinement: no "n"
> to follow the bouncing ball...
>
> Nick
>
>
>


Re: [O] multilingual presentation with org

2012-02-15 Thread Nick Dokos
brian powell  wrote:


> Make 2 files with line numbers at the begin of each line: 
> nl sanskrit-song.txt > sanskrit-song_line-numbers-at-front.txt
> nl english-song.txt > english-song_line-numbers-at-front.txt
> emacs -q -l 
> sanskit-blah-mule-multilingual-emacs-programs-needed-to-show-sanskrit.el
>  sanskrit-song_line-numbers-at-front.txt english-song_line-numbers-at-front.txt
> Mx ediff-buffers
> Emacs will pop-up an ediff window--put your mouse cursor on it and tap 
> "?"--it will show you the
> ediff keys--"n" for "next different line" will be most helpful
> (ediff will ask for the 1st and 2nd buffer you want to compare--type
> in sanskrit-song_line-numbers-at-front.txt 
> and english-song_line-numbers-at-front.txt
> 
> --then tapping "n" (with your cursor on the popped up ediff window) goes 
> line-by-songline in both
> buffers--highlighting the text for a sanskrit sing-along!
> 

That'd be cool if it worked, but at least in my case, it doesn't:
diff decides there is one big diff that covers the whole file,
and ediff does not find a "better" refinement: no "n"
to follow the bouncing ball...

Nick





Re: [O] multilingual presentation with org

2012-02-15 Thread brian powell
* Quoting the original query:

"I will be teaching singing to a mixed group using a projector.  Those who
can read sanskrit would be put off by the roman (English) and those who
cant of course need the roman.
The attached screenshot shows two emacs buffers side-by-side with the two
versions.

I am now exploring the possibilities of how to make a 'presentation'
putting the two together.
I am not too comfortable using emacs for the final show because emacs
occasionally crashes -- due to non-standard fonts, input methods or what I
dont know -- and I dont want this to happen in front of 50 people!

Any thoughts/suggestions?"

** Ideas: I strongly suggest EMACS and learn how to use EDIFF in EMACS--its
the best envirionment for translations and what you want to do--don't toss
out EMACS because it crashed once: suggest you test it before the
demo/presentation sing-along.
*** How to stop it from crashing: Use only what is necessary to show your
SANSKRIT and ENGLISH buffer: Do something like:
Make 2 files with line numbers at the begin of each line:
nl sanskrit-song.txt > sanskrit-song_line-numbers-at-front.txt
nl english-song.txt > english-song_line-numbers-at-front.txt
emacs -q -l
sanskit-blah-mule-multilingual-emacs-programs-needed-to-show-sanskrit.el
 sanskrit-song_line-numbers-at-front.txt english-song_line-numbers-at-front.txt
Mx ediff-buffers
Emacs will pop-up an ediff window--put your mouse cursor on it and tap
"?"--it will show you the ediff keys--"n" for "next different line" will be
most helpful
(ediff will ask for the 1st and 2nd buffer you want to compare--type
in sanskrit-song_line-numbers-at-front.txt
and english-song_line-numbers-at-front.txt

--then tapping "n" (with your cursor on the popped up ediff window) goes
line-by-songline in both buffers--highlighting the text for a sanskrit
sing-along!

** EDIFF has a slight learning curve; but, a huge pay off.


Re: [O] multilingual presentation with org

2012-02-15 Thread Rustom Mody
Nick wrote:

> Rustom has updated a thread on gnu.emacs.help with those suggestions:
> http://thread.gmane.org/gmane.emacs.help/83724
>

For some reason my latest update is not showing on gmane but showing on
googlegroups

http://groups.google.com/group/gnu.emacs.help/browse_thread/thread/bfa6b05ce565d96d?tvc=2


Re: [O] multilingual presentation with org

2012-02-15 Thread Nick Dokos
brian powell  wrote:

> ... 
> * Now, I know Nick and Jambunathan set up the method to put the translation 
> side-by-side; but, how
> did they do that? Can't find it in this thread (if I may call it that) "[O] 
> multilingual
> presentation with org"--is there a link to how you set up the 
> English<=>Sanskrit side-by-side?

We didn't: what Jambunathan and I did was to help Rustom deal with input
methods in batch mode: start with a file of transliterated text and
produce the actual text. That was done mostly in private email, but 
Rustom has updated a thread on gnu.emacs.help with those
suggestions: http://thread.gmane.org/gmane.emacs.help/83724

Nick



Re: [O] multilingual presentation with org

2012-02-15 Thread brian powell
* http://lists.gnu.org/archive/html/emacs-orgmode/2010-10/msg01534.html

=>

** epresent.el by Eric http://github.com/eschulte/epresent  "(instructions
in the README)"

** s5 <=> org-s5http://github.com/sigma/org-s5

*** Quoting verbatim:
> I think I'll probably stick with Beamer export for my serious
> presentations, but I like the idea and simplicity of being to run simple
> presentations directly from within Emacs.

"S5 and other HTML slide show frameworks have (at least) one great
advantage over Beamer, one can embed (there are at least two ways) SVG
image, which is quite hard with LaTeX/Beamer duo"
...

* One very simple way to make presentations in EMACS (that I did in a grad
school presentation--worked well) :

Put a unique breakpoint in your presentation document like a string "="
one per page and/or sections you want to talk about during class/sing along.
Then simply do Control-s (search for string) = at the beginning of the
presentation
Then to "turn the page"/go to the next/previous "slide" is simply a matter
of repeating Cs and/or Cr (search-string-backwards) once per slide (song
stanza in your case).

** KISS method == Keep It Simple/Stupid

* Now, I know Nick and Jambunathan set up the method to put the translation
side-by-side; but, how did they do that? Can't find it in this thread (if I
may call it that) "[O] multilingual presentation with org"--is there a link
to how you set up the English<=>Sanskrit side-by-side?




> >
> > Any thoughts/suggestions?
> >
>
> A two-column beamer presentation perhaps?
>
> Nick
>
>


Re: [O] multilingual presentation with org

2012-02-15 Thread suvayu ali
On Wed, Feb 15, 2012 at 14:08, Nick Dokos  wrote:
>> I am now exploring the possibilities of how to make a 'presentation' putting 
>> the two together.
>> I am not too comfortable using emacs for the final show because emacs 
>> occasionally crashes -- due to
>> non-standard fonts, input methods or what I dont know -- and I dont want 
>> this to happen in front of
>> 50 people!
>>
>
> A two-column beamer presentation perhaps?

If I may add, xelatex should let you export presentations with both
Roman and Devanagari text. You might find the following thread useful.



GL

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] multilingual presentation with org

2012-02-15 Thread Nick Dokos
Rustom Mody  wrote:

> Thanks to Nick and Jambunathan I have got a minimal setup to be able to type 
> in English (roman
> script) and easily transliterate to Sanskrit (Devanagari).
> 
> Now I am exploring how I could 'zip' the two together. My requirements are 
> like this:
> 
> I will be teaching singing to a mixed group using a projector.  Those who can 
> read sanskrit would be
> put off by the roman (English) and those who cant of course need the roman.
> The attached screenshot shows two emacs buffers side-by-side with the two 
> versions.
> 
> I am now exploring the possibilities of how to make a 'presentation' putting 
> the two together.
> I am not too comfortable using emacs for the final show because emacs 
> occasionally crashes -- due to
> non-standard fonts, input methods or what I dont know -- and I dont want this 
> to happen in front of
> 50 people!
> 
> Any thoughts/suggestions?
> 

A two-column beamer presentation perhaps?

Nick