Re: [O] Dumbquotes in exported source listings

2011-05-01 Thread Avdi Grimm
On Sat, Apr 30, 2011 at 11:13 PM, Ben Finney  Those aren't even
“smart quotes” (the term usually applied to the quote
 characters from Microsoft's standards-violating character set). Those
 are what might be called “TeX quotes” (though the convention pre-dates
 even TeX), since TeX uses ‘`’ for an opening single quote and ‘``’ for
 an opening double quote.

I'll reiterate: this is in literal code-listing sections, not English
text sections. The listings in the plain org file ARE the correct
single-quote character. Something in the pipeline is cleverly
converting them to TeX-quotes, and I don't know what.

-- 
Avdi Grimm
http://avdi.org



Re: [O] Dumbquotes in exported source listings

2011-05-01 Thread Nick Dokos
Avdi Grimm gro...@inbox.avdi.org wrote:

 So I'm writing an eBook with lots of source code listings, using
 org-mode-LaTeX-PDF with the minted package providing source code
 highlighting. For the most part I'm really, really happy with the
 toolchain; thank you to those that pointed me in the direction of
 minted.
 
 One issue: my beta reviewers have noted that when copy-and-pasting
 source code listings that contain single-quoted strings, they are
 getting smart quotes--i.e. the first quote is a backquote, the
 second quote is a single quote. This breaks the pasted code.
 

In cases like this, an example would help: what you start with in the org
file, what it looks like in the tex file (and any other intermediate 
files[fn:1])
and what the resulting PDF file looks like. FWIW, I tried exporting to PDF
the following:

--8---cut here---start-8---

* foo

#+begin_src elisp :results value :exports both

(setq foo '(bar baz))

#+end_src

#+results:
| bar | baz |

--8---cut here---end---8---

and then, while viewing the PDF file with xpdf, tried pasting the
lisp-expression from the PDF back into the org file (and even evaluated
it). This worked without a hitch.

So please give us more information.

Nick

PS. IIRC, a long time there was a problem like this: trying to copy and paste
a lisp expression from the org manual resulted in an error because of a wrong
quote. I couldn't remember the details so I searched the mailing list. The 
thread
starts at

   http://thread.gmane.org/gmane.emacs.orgmode/6610

but a) the warning does not appear in the Org manual any longer and b) I
now cannot reproduce *that* problem at all (not with xpdf, not with
evince and not even with acroread). But it *was* a problem with an older
version of acroread (and, apparently evince as well), so maybe that's
where you should concentrate your investigations: what PDF viewer are you
using and what is the version?

Footnotes:

[fn:1] Don't know anything about minted so this part of the toolchain is
opaque to me: I don't know if it produces other intermediate files.



Re: [O] Dumbquotes in exported source listings

2011-05-01 Thread Nick Dokos
Ben Finney ben+em...@benfinney.id.au wrote:

 Avdi Grimm gro...@inbox.avdi.org writes:
 
  ...
 
 ...

 Nowadays with Unicode available ubiquitously we can simply use the
 correct typographical quotation marks directly in the plain text file,
 but TeX and some other legacy systems don't work very well with Unicode.
 

AFAIK, TeX works fine with UTF8, given the defaults that org-mode export uses.
What problems do you see?

Nick





Re: [O] Dumbquotes in exported source listings

2011-05-01 Thread Sébastien Vauban
Hi Nick,

Nick Dokos wrote:
 Ben Finney ben+em...@benfinney.id.au wrote:
 Avdi Grimm gro...@inbox.avdi.org writes:

 Nowadays with Unicode available ubiquitously we can simply use the
 correct typographical quotation marks directly in the plain text file,
 but TeX and some other legacy systems don't work very well with Unicode.

I really hate those smart quotes, better named dumb quotes, because:

- I don't find them attractive at all, but that's personal, and could depend
  on font families, etc.

- they're not correctly converted when playing with the coding system: from
  UTF-8 to Latin 1, for example. That's really nasty.

I was/am planning to have a function for converting them on the fly when
pasting... or when saving the Org buffer... or at any better moment. Though, I
didn't get the right code to do so yet...

 AFAIK, TeX works fine with UTF8, given the defaults that org-mode export uses.
 What problems do you see?

UTF-8 is correctly handled in LaTeX documents, but not in every environment:
Listings has problems, even if a Listings exist for UTF-8, and so for many
other environments.

So I would say that UTF-8 usage is still not yet fully supported in TeX.

Best regards,
  Seb

-- 
Sébastien Vauban




Re: [O] Dumbquotes in exported source listings

2011-05-01 Thread Ben Finney
Nick Dokos nicholas.do...@hp.com writes:

 Ben Finney ben+em...@benfinney.id.au wrote:

  TeX and some other legacy systems don't work very well with Unicode.

 AFAIK, TeX works fine with UTF8, given the defaults that org-mode
 export uses.

To be clear, I don't have any issue with Org and Unicode (I've never
exported an Org file to TeX). I was mainly addressing the terminology
for the style of quotes described by the OP.

-- 
 \   “Too many Indians spoil the golden egg.” —Sir Joh |
  `\   Bjelke-Petersen |
_o__)  |
Ben Finney




[O] Dumbquotes in exported source listings

2011-04-30 Thread Avdi Grimm
So I'm writing an eBook with lots of source code listings, using
org-mode-LaTeX-PDF with the minted package providing source code
highlighting. For the most part I'm really, really happy with the
toolchain; thank you to those that pointed me in the direction of
minted.

One issue: my beta reviewers have noted that when copy-and-pasting
source code listings that contain single-quoted strings, they are
getting smart quotes--i.e. the first quote is a backquote, the
second quote is a single quote. This breaks the pasted code.

I'm sure I could track the problem down myself eventually, but I
thought someone here might know which part of the toolchain to look at
first for this quote-munging behavior.

Thanks!

--
Avdi Grimm
http://avdi.org



Re: [O] Dumbquotes in exported source listings

2011-04-30 Thread Ben Finney
Avdi Grimm gro...@inbox.avdi.org writes:

 One issue: my beta reviewers have noted that when copy-and-pasting
 source code listings that contain single-quoted strings, they are
 getting smart quotes--i.e. the first quote is a backquote, the
 second quote is a single quote. This breaks the pasted code.

Those aren't even “smart quotes” (the term usually applied to the quote
characters from Microsoft's standards-violating character set). Those
are what might be called “TeX quotes” (though the convention pre-dates
even TeX), since TeX uses ‘`’ for an opening single quote and ‘``’ for
an opening double quote.

Nowadays with Unicode available ubiquitously we can simply use the
correct typographical quotation marks directly in the plain text file,
but TeX and some other legacy systems don't work very well with Unicode.

-- 
 \  “Often, the surest way to convey misinformation is to tell the |
  `\   strict truth.” —Mark Twain, _Following the Equator_ |
_o__)  |
Ben Finney