Re: [O] [org-e-latex] Coding System

2012-11-22 Thread Nicolas Goaziou
Hello,

Achim Gratz strom...@nexgo.de writes:

 I looked at the code/documentation and it seems the intention is to do
 the reverse lookup, that is look at the buffer encoding and decide what
 to give inputenc as argument (when it is specified as AUTO in the
 header template).  I maintain that the other way around (looking at the
 header template and deciding the coding system) is probably easier to
 understand and it is also what's already been used by Emacs: see
 latexenc-find-file-coding-system and latex-inputenc-coding-alist.

Emacs also provides `latexenc-coding-system-to-inputenc', so it doesn't
look like one way is more legitimate than the other.

Note that we can have both ways: with AUTO, let coding-system decide and
without AUTO, let inputenc decide. Also, it isn't necessary to change
the global coding system to change the coding system used to write the
file: see `org-export-coding-system'.

Anyway, if you think it's useful to provide a patch, I suggest to
dynamically bind `org-export-coding-system' in
`org-e-latex-export-to-latex' before `org-export-to-file' is called.
You'll have to open outfile in order to apply
`latexenc-find-file-coding-system'.

Do you want to provide such patch?


Regards,

-- 
Nicolas Goaziou



Re: [O] [org-e-latex] Coding System

2012-11-22 Thread Achim Gratz
Nicolas Goaziou writes:
 Anyway, if you think it's useful to provide a patch, I suggest to
 dynamically bind `org-export-coding-system' in
 `org-e-latex-export-to-latex' before `org-export-to-file' is called.
 You'll have to open outfile in order to apply
 `latexenc-find-file-coding-system'.

Thanks for the pointers.

 Do you want to provide such patch?

I'll keep it on my watchlist.  Can't make any promises right now, sorry.


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

Factory and User Sound Singles for Waldorf Q+, Q and microQ:
http://Synth.Stromeko.net/Downloads.html#WaldorfSounds




Re: [O] [org-e-latex] Coding System

2012-11-22 Thread Thomas S. Dye
Aloha Achim,

Achim Gratz strom...@nexgo.de writes:

 Nicolas Goaziou writes:
 Anyway, if you think it's useful to provide a patch, I suggest to
 dynamically bind `org-export-coding-system' in
 `org-e-latex-export-to-latex' before `org-export-to-file' is called.
 You'll have to open outfile in order to apply
 `latexenc-find-file-coding-system'.

 Thanks for the pointers.

 Do you want to provide such patch?

 I'll keep it on my watchlist.  Can't make any promises right now, sorry.

I don't follow the details of this discussion, but I wonder how
important AUTO really is?  It seems to me that a sweet setup uses
utf-8 in the buffer but exports latin-1 to LaTeX through use of entities
and filters (with the new exporter).  This can yield a buffer display
that isn't complicated by all the LaTeX machinery, and export something
that is maximally compatible in the LaTeX world.  It is nice on the eyes
and avoids encoding incompatibilities on the back-end.

All the best,
Tom
-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] [org-e-latex] Coding System

2012-11-22 Thread Achim Gratz
Thomas S. Dye writes:
 I don't follow the details of this discussion, but I wonder how
 important AUTO really is?

I'm afraid I can't follow you…

AFAIK, specifying AUTO in the LaTeX header is supposed to be replaced
by whatever the coding system of the LaTeX buffer happens to be when it
gets saved.  (I've never used it, so it might work differently.)

 It seems to me that a sweet setup uses utf-8 in the buffer but exports
 latin-1 to LaTeX through use of entities and filters (with the new
 exporter).  This can yield a buffer display that isn't complicated by
 all the LaTeX machinery, and export something that is maximally
 compatible in the LaTeX world.  It is nice on the eyes and avoids
 encoding incompatibilities on the back-end.

That is not what I was talking about, however useful it might be.  I
have already defined the input encoding utf8 in my LaTeX header and
want to ensure that the buffer gets saved in that format.  As an
extension, if I specify any other encoding for LaTeX, the buffer should
be saved in a matching encoding, independently of the encoding that the
org buffer had.  If that's a downgrade, i.e. not all characters are
encodable in that new system, then what you describe above might become
necessary.


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

Wavetables for the Waldorf Blofeld:
http://Synth.Stromeko.net/Downloads.html#BlofeldUserWavetables




Re: [O] [org-e-latex] Coding System

2012-11-22 Thread Thomas S. Dye
Achim Gratz strom...@nexgo.de writes:

 Thomas S. Dye writes:
 I don't follow the details of this discussion, but I wonder how
 important AUTO really is?

 I'm afraid I can't follow you…

 AFAIK, specifying AUTO in the LaTeX header is supposed to be replaced
 by whatever the coding system of the LaTeX buffer happens to be when it
 gets saved.  (I've never used it, so it might work differently.)

Yes, I believe the encoding is picked up from the Org buffer, but I
might be wrong.


 It seems to me that a sweet setup uses utf-8 in the buffer but exports
 latin-1 to LaTeX through use of entities and filters (with the new
 exporter).  This can yield a buffer display that isn't complicated by
 all the LaTeX machinery, and export something that is maximally
 compatible in the LaTeX world.  It is nice on the eyes and avoids
 encoding incompatibilities on the back-end.

 That is not what I was talking about, however useful it might be.  I
 have already defined the input encoding utf8 in my LaTeX header and
 want to ensure that the buffer gets saved in that format.  As an
 extension, if I specify any other encoding for LaTeX, the buffer should
 be saved in a matching encoding, independently of the encoding that the
 org buffer had.  If that's a downgrade, i.e. not all characters are
 encodable in that new system, then what you describe above might become
 necessary.

Yes, that sounds useful.  Thanks for the clarification.

All the best,
Tom

-- 
Thomas S. Dye
http://www.tsdye.com



Re: [O] [org-e-latex] Coding System

2012-11-19 Thread Suvayu Ali
On Mon, Nov 19, 2012 at 07:28:30AM +, Achim Gratz wrote:
 When the new exporter produces a TeX file that contains unicode characters,
 Emacs tries to save this file with coding systems `undecided-unix´ and
 `iso-latin1-unix´, both of which don't work of course (and the latter would
 likely be wrong for some characters).  While it should be possible to change 
 the
 default coding systems to use, it would certainly be better if the exporter 
 took
 note of the
 
 \usepackage[utf8]{inputenc}
 
 and alter the coding system for saving the TeX file accordingly.
 

This is not an answer to the issue above; but if you are using utf-8,
should you not already be having something like this in your init file?

  (prefer-coding-system 'utf-8)

This should circumvent the problem.

Cheers,

-- 
Suvayu

Open source is the future. It sets us free.



Re: [O] [org-e-latex] Coding System

2012-11-19 Thread Achim Gratz
Suvayu Ali writes:
 On Mon, Nov 19, 2012 at 07:28:30AM +, Achim Gratz wrote:
 This is not an answer to the issue above; but if you are using utf-8,
 should you not already be having something like this in your init file?

   (prefer-coding-system 'utf-8)

 This should circumvent the problem.

That's what I was saying, however I may not prefer the UTF-8 encoding
generally for other reasons.  The exporter however should save the TeX
file with utf-8 coding regardless of any user preference because
otherwise TeX doesn't get the input encoding it's been told to expect.


Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

SD adaptations for KORG EX-800 and Poly-800MkII V0.9:
http://Synth.Stromeko.net/Downloads.html#KorgSDada




Re: [O] [org-e-latex] Coding System

2012-11-19 Thread Achim Gratz

I looked at the code/documentation and it seems the intention is to do
the reverse lookup, that is look at the buffer encoding and decide what
to give inputenc as argument (when it is specified as AUTO in the
header template).  I maintain that the other way around (looking at the
header template and deciding the coding system) is probably easier to
understand and it is also what's already been used by Emacs: see
latexenc-find-file-coding-system and latex-inputenc-coding-alist.



Regards,
Achim.
-- 
+[Q+ Matrix-12 WAVE#46+305 Neuron microQkb Andromeda XTk Blofeld]+

DIY Stuff:
http://Synth.Stromeko.net/DIY.html