Re: [O] Problem exporting to PDF (and viewing)

2012-05-12 Thread Jude DaShiell
Why not search at http://tv.adobe.com/ for strings of interest to see 
for example if adobe knows anything about bash that may be useful?  
Other people have found things useful for increasing adobe documents 
accessibility using that url.

On Fri, 11 May 2012, Richard Stanton wrote:

 Using Org-mode version 7.8.09 (release_7.8.09-553-g5750f0) (and earlier 
 versions) I've encountered a problem on my Windows machine when I try to 
 export an Org file to LaTeX, then to Pdf, then viewing (using C-c C-e d).
 
 In my init.el I have the lines
 
   (eval-after-load org
 '(progn
(if (assoc \\.pdf\\' org-file-apps)
(setcdr (assoc \\.pdf\\' org-file-apps) 
 c:/progra~1/sumatrapdf/sumatrapdf.exe  %s) 
  (add-to-list 'org-file-apps '(\\.pdf\\' . 
 c:/progra~1/sumatrapdf/sumatrapdf.exe %s) t
 )
 
 This results in:
  
 org-file-apps is a variable defined in `org.el'.
 Its value is ((auto-mode . emacs)
  (\\.mm\\' . default)
  (\\.x?html?\\' . default)
  (\\.pdf\\' . c:/progra~1/sumatrapdf/sumatrapdf.exe %s))
 
 When I try to export an org file by typing C-c C-e d, sumatrapdf opens up OK, 
 but complains with an error like this:
 
 Error loading c:\dropbox\org\c\:\dropbox\org\personal.pdf
 
 Any idea why I get the repeated path? A similar constructions works fine on 
 my Mac, so I'm not quite sure what's going wrong here.
 
 
 


Jude jdashiel-at-shellworld-dot-net
http://www.shellworld.net/~jdashiel/nj.html




Re: [O] Babel, gnuplot, post processing

2012-05-12 Thread Eric Fraga
skip scp0...@gmail.com writes:

 How can I perform post processing on eps files produced by gnuplot
 source blocks? I want to take out the extra white space margins in the
 eps file by running eps2eps utility on the eps file produced by
 gnuplot.

The easiest solution (although maybe not the most elegant) is to do this
from within gnuplot.  I do something similar in that I process the eps
to create a pdf.

#+begin_src gnuplot :file xxx.pdf
  reset
  clear
  set output 'xxx.eps'
  set terminal postscript eps enhanced 18
  ...
  plot ...
  ! epstopdf xxx.eps
#+end_src

-- 
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.1.50.1
: using Org release_7.8.09-527-gc2aac5




Re: [O] Problem exporting to PDF (and viewing)

2012-05-12 Thread Jonathan Leech-Pepin
I suspect you should be able to get it to recognize C:/Program\
Files/sumatrapdf/sumatrapdf.exe.

Alternately if the exe is found on your PATH (you may need to add it
by hand), you should be able to manage with:

(executable-find sumatrapdf.exe)

which should be able to track back the path to the appropriate file.

On Sat, May 12, 2012 at 12:10 AM, Richard Stanton
stan...@haas.berkeley.edu wrote:
 Checking further, this works fine using the default Windows shell in Emacs, 
 but fails if I use bash as my shell. Unfortunately, I like to use bash, which 
 I achieve with the following lines in my init.el:

      (setq shell-file-name bash)
      (setenv SHELL shell-file-name)
      (setq explicit-shell-file-name shell-file-name)

 -Original Message-
 From: Richard Stanton
 Sent: Friday, May 11, 2012 4:52 PM
 To: emacs-orgmode@gnu.org
 Subject: Problem exporting to PDF (and viewing)

 Using Org-mode version 7.8.09 (release_7.8.09-553-g5750f0) (and earlier
 versions) I've encountered a problem on my Windows machine when I try to
 export an Org file to LaTeX, then to Pdf, then viewing (using C-c C-e d).

 In my init.el I have the lines

   (eval-after-load org
     '(progn
        (if (assoc \\.pdf\\' org-file-apps)
            (setcdr (assoc \\.pdf\\' org-file-apps)
 c:/progra~1/sumatrapdf/sumatrapdf.exe  %s)
          (add-to-list 'org-file-apps '(\\.pdf\\' .
 c:/progra~1/sumatrapdf/sumatrapdf.exe %s) t
 )

 This results in:

 org-file-apps is a variable defined in `org.el'.
 Its value is ((auto-mode . emacs)
  (\\.mm\\' . default)
  (\\.x?html?\\' . default)
  (\\.pdf\\' . c:/progra~1/sumatrapdf/sumatrapdf.exe %s))

 When I try to export an org file by typing C-c C-e d, sumatrapdf opens up OK,
 but complains with an error like this:

 Error loading c:\dropbox\org\c\:\dropbox\org\personal.pdf

 Any idea why I get the repeated path? A similar constructions works fine on
 my Mac, so I'm not quite sure what's going wrong here.





Re: [O] Problem exporting to PDF (and viewing)

2012-05-12 Thread Nick Dokos
Jonathan Leech-Pepin jonathan.leechpe...@gmail.com wrote:

 I suspect you should be able to get it to recognize C:/Program\
 Files/sumatrapdf/sumatrapdf.exe.
 
 Alternately if the exe is found on your PATH (you may need to add it
 by hand), you should be able to manage with:
 
 (executable-find sumatrapdf.exe)
 
 which should be able to track back the path to the appropriate file.
 
 On Sat, May 12, 2012 at 12:10 AM, Richard Stanton
 stan...@haas.berkeley.edu wrote:
  Checking further, this works fine using the default Windows shell in Emacs, 
  but fails if I use bash as my shell. Unfortunately, I like to use bash, 
  which I achieve with the following lines in my init.el:
 
       (setq shell-file-name bash)
       (setenv SHELL shell-file-name)
       (setq explicit-shell-file-name shell-file-name)
 
  -Original Message-
  From: Richard Stanton
  Sent: Friday, May 11, 2012 4:52 PM
  To: emacs-orgmode@gnu.org
  Subject: Problem exporting to PDF (and viewing)
 
  Using Org-mode version 7.8.09 (release_7.8.09-553-g5750f0) (and earlier
  versions) I've encountered a problem on my Windows machine when I try to
  export an Org file to LaTeX, then to Pdf, then viewing (using C-c C-e d).
 
  In my init.el I have the lines
 
    (eval-after-load org
      '(progn
         (if (assoc \\.pdf\\' org-file-apps)
             (setcdr (assoc \\.pdf\\' org-file-apps)
  c:/progra~1/sumatrapdf/sumatrapdf.exe  %s)
           (add-to-list 'org-file-apps '(\\.pdf\\' .
  c:/progra~1/sumatrapdf/sumatrapdf.exe %s) t
  )
 
  This results in:
 
  org-file-apps is a variable defined in `org.el'.
  Its value is ((auto-mode . emacs)
   (\\.mm\\' . default)
   (\\.x?html?\\' . default)
   (\\.pdf\\' . c:/progra~1/sumatrapdf/sumatrapdf.exe %s))
 
  When I try to export an org file by typing C-c C-e d, sumatrapdf opens up 
  OK,
  but complains with an error like this:
 
  Error loading c:\dropbox\org\c\:\dropbox\org\personal.pdf
 
  Any idea why I get the repeated path? A similar constructions works fine on
  my Mac, so I'm not quite sure what's going wrong here.

I don't do Windoze, but this looks to me like a typo in some init file,
perhaps a missing semicolon? I'd grep the usual suspects (on Linux, this
would be /etc/*, and all the config/init files and directories under
$HOME (.profile, .bashrc, .emacs, etc etc), but I have no idea what
these would be on Windoze - you might even have to search the *shudder*
registry) for c:\dropbox\org.

Nick




[O] Using Org for a dissertation

2012-05-12 Thread Richard Lawrence
Hi all,

I am a graduate student in philosophy, and I am about to begin writing
my dissertation.  I am wondering about whether I should write it in Org,
or stick to plain LaTeX.

This question has been asked before:
http://article.gmane.org/gmane.emacs.orgmode/22756

But that was two years ago; Org has changed a fair bit, and I'm
wondering if there are any updates to the advice given there.  Moreover,
I'm wondering if anyone has written a dissertation or other long
documents in Org in the meantime, and what their experiences have been.
(Henri-Paul, do you still read this list?)

I have used Org to write most of the shorter papers I have so far
written as a graduate student, and been very happy with the results.  I
prefer most of Org's editing features and conventions to bare LaTeX.  I
haven't previously had much of a need to mix TODO items and writing, but
imagine I will with a dissertation.  I *have* been relying on Org's
to-do list features for my reading: I enter new readings as TODO items
via capture, and include the bibliographic fields that make them
suitable to export via org-bibtex when it comes time to reference them.
None of the writing I've done so far has had strict formatting
requirements, however, and I have run into enough small formatting
issues in the past that I want to avoid having them grow into large
issues in the context of a dissertation.

Since I am not in the sciences, I doubt that I will have many figures or
complex tables, which I know can lead to headaches.  Here are a few of
the things I *am* worried about.  I'm sure most of them can be dealt
with; I am guessing that most of these issues reflect my ignorance or
outdated knowledge of Org features.  I'd be grateful for pointers or
workarounds for them:

1) Section labels and other in-document references.  It's nice that Org
generates these on export, but I need to be able to assign and use
labels that will not change if the document is reordered.  I know I can
simply add such labels via a \label command, but I am worried that using
them in addition to Org's autogenerated labels might cause numbering
problems in LaTeX.

2) Escaping/unrecognized commands.  I have occassionally run into
annoyances where Org escapes characters or commands that I intend to be
exported literally (~ and $ are perennial offenders).  Export also
tends to break when fill-paragraph breaks a LaTeX command across a line,
like:

some preceding text up to the end of the line \cite{SomeAuthorReference,
AnotherReference}.

3) Indentation around #+BEGIN_*/#+END_* environments. (I most often use
QUOTE.)  I usually have to explicitly control indentation in a way that
I wouldn't have to in LaTeX, because Org inserts blank lines around them
during export.

4) Inline footnotes.  I usually prefer to use inline footnotes, but I
think I have found in the past that Org's syntax for inline footnotes
([fn:: ...]) interacts badly with LaTeX commands, especially anything
requiring a ] in the footnote text.

5) Bibtex and bibliographies.  I love keeping my reading list as Org
TODO entries, but would like a more automated way to export (just) the
entries I need for a particular document to a .bib file.  I would also
like to have more control over the bibliography as a section of my
document.  The \bibliography command must live under some Org heading or
other, and as far I as know it can't live under its own without
generating an extraneous heading, so I have to be careful that it ends
up at the end of the last section.

Are there other issues that people have run into when using Org to write
a longer document with strict formatting requirements?  Again, any and
all advice is greatly appreciated!

Thanks,
Richard




Re: [O] Using Org for a dissertation

2012-05-12 Thread Eric Schulte
Hi Richard,

Richard Lawrence richard.lawre...@berkeley.edu writes:

 Hi all,

 I am a graduate student in philosophy, and I am about to begin writing
 my dissertation.  I am wondering about whether I should write it in Org,
 or stick to plain LaTeX.

 This question has been asked before:
 http://article.gmane.org/gmane.emacs.orgmode/22756

 But that was two years ago; Org has changed a fair bit, and I'm
 wondering if there are any updates to the advice given there.  Moreover,
 I'm wondering if anyone has written a dissertation or other long
 documents in Org in the meantime, and what their experiences have been.
 (Henri-Paul, do you still read this list?)


I am currently writing my dissertation (proposal) in Org-mode.  So far
it is working very well for me, I can export to both PDF for more formal
submissions to my adviser and to HTML for less formal posting to a web
page.  I keep *all* of my reading notes as Org-bibtex headlines in a
single large reading.org file.  I have a (somewhat complex) system
whereby I am able to reference these bibtex entries from the
dissertation and automatically generate the required .bib file as part
of my document export process.  One nice side effect of this setup has
been the ability to do a fun graphical export of my references [1].

My entire dissertation directory is in a public git repository [2], you
may find my Makefile [3] useful (although again I should warn you that
my particular setup may be needlessly complex).


 I have used Org to write most of the shorter papers I have so far
 written as a graduate student, and been very happy with the results.  I
 prefer most of Org's editing features and conventions to bare LaTeX.  I
 haven't previously had much of a need to mix TODO items and writing, but
 imagine I will with a dissertation.  I *have* been relying on Org's
 to-do list features for my reading: I enter new readings as TODO items
 via capture, and include the bibliographic fields that make them
 suitable to export via org-bibtex when it comes time to reference them.
 None of the writing I've done so far has had strict formatting
 requirements, however, and I have run into enough small formatting
 issues in the past that I want to avoid having them grow into large
 issues in the context of a dissertation.

 Since I am not in the sciences, I doubt that I will have many figures or
 complex tables, which I know can lead to headaches.  Here are a few of
 the things I *am* worried about.  I'm sure most of them can be dealt
 with; I am guessing that most of these issues reflect my ignorance or
 outdated knowledge of Org features.  I'd be grateful for pointers or
 workarounds for them:

 1) Section labels and other in-document references.  It's nice that Org
 generates these on export, but I need to be able to assign and use
 labels that will not change if the document is reordered.  I know I can
 simply add such labels via a \label command, but I am worried that using
 them in addition to Org's autogenerated labels might cause numbering
 problems in LaTeX.


I've not run into any such problems.  I tend to construct all of my
labels through Org-mode (which works well for export to both HTML and
LaTeX).


 2) Escaping/unrecognized commands.  I have occassionally run into
 annoyances where Org escapes characters or commands that I intend to be
 exported literally (~ and $ are perennial offenders).  Export also
 tends to break when fill-paragraph breaks a LaTeX command across a line,
 like:

 some preceding text up to the end of the line \cite{SomeAuthorReference,
 AnotherReference}.


I deal with the above by not placing spaces in such commands, so the
above becomes

\cite{SomeAuthorReference,AnotherReference}


 3) Indentation around #+BEGIN_*/#+END_* environments. (I most often
 use QUOTE.)  I usually have to explicitly control indentation in a way
 that I wouldn't have to in LaTeX, because Org inserts blank lines
 around them during export.

 4) Inline footnotes.  I usually prefer to use inline footnotes, but I
 think I have found in the past that Org's syntax for inline footnotes
 ([fn:: ...]) interacts badly with LaTeX commands, especially anything
 requiring a ] in the footnote text.


again, I haven't run into either of the above, but working in Philosophy
you likely have more stringent footnotes needs than I do in CS.


 5) Bibtex and bibliographies.  I love keeping my reading list as Org
 TODO entries, but would like a more automated way to export (just) the
 entries I need for a particular document to a .bib file.

My setup is to keep a tasks.org file with reading related tasks which
holds Org-mode links to all of my references.  As part of my document
export process I scan through that file, jumping to each link and
running `org-bibtex-export-to-kill-ring' at each reference.  I then dump
all of these bibtex entries into a .bib file.  By using a Makefile rule
the .bib file is only regenerated when I've changed my tasks.org file.

 I would also like to have 

[O] [BUG] LaTeX-isms in tables

2012-05-12 Thread Andreas Leha
Hi all,

there seems to be a bug in LaTeX tables:

I can not properly export a file with 2 [\mu{}] in a table to pdf.

| parameter | unit|
|---+-|
| some  | [\mu]   |

Regards,
Andreas




Re: [O] Using Org for a dissertation

2012-05-12 Thread Thomas S. Dye
Richard Lawrence richard.lawre...@berkeley.edu writes:

 Hi all,

 I am a graduate student in philosophy, and I am about to begin writing
 my dissertation.  I am wondering about whether I should write it in Org,
 or stick to plain LaTeX.

 This question has been asked before:
 http://article.gmane.org/gmane.emacs.orgmode/22756

 But that was two years ago; Org has changed a fair bit, and I'm
 wondering if there are any updates to the advice given there.  Moreover,
 I'm wondering if anyone has written a dissertation or other long
 documents in Org in the meantime, and what their experiences have been.
 (Henri-Paul, do you still read this list?)

 I have used Org to write most of the shorter papers I have so far
 written as a graduate student, and been very happy with the results.  I
 prefer most of Org's editing features and conventions to bare LaTeX.  I
 haven't previously had much of a need to mix TODO items and writing, but
 imagine I will with a dissertation.  I *have* been relying on Org's
 to-do list features for my reading: I enter new readings as TODO items
 via capture, and include the bibliographic fields that make them
 suitable to export via org-bibtex when it comes time to reference them.
 None of the writing I've done so far has had strict formatting
 requirements, however, and I have run into enough small formatting
 issues in the past that I want to avoid having them grow into large
 issues in the context of a dissertation.

 Since I am not in the sciences, I doubt that I will have many figures or
 complex tables, which I know can lead to headaches.  Here are a few of
 the things I *am* worried about.  I'm sure most of them can be dealt
 with; I am guessing that most of these issues reflect my ignorance or
 outdated knowledge of Org features.  I'd be grateful for pointers or
 workarounds for them:

 1) Section labels and other in-document references.  It's nice that Org
 generates these on export, but I need to be able to assign and use
 labels that will not change if the document is reordered.  I know I can
 simply add such labels via a \label command, but I am worried that using
 them in addition to Org's autogenerated labels might cause numbering
 problems in LaTeX.

 2) Escaping/unrecognized commands.  I have occassionally run into
 annoyances where Org escapes characters or commands that I intend to be
 exported literally (~ and $ are perennial offenders).  Export also
 tends to break when fill-paragraph breaks a LaTeX command across a line,
 like:

 some preceding text up to the end of the line \cite{SomeAuthorReference,
 AnotherReference}.

 3) Indentation around #+BEGIN_*/#+END_* environments. (I most often use
 QUOTE.)  I usually have to explicitly control indentation in a way that
 I wouldn't have to in LaTeX, because Org inserts blank lines around them
 during export.

 4) Inline footnotes.  I usually prefer to use inline footnotes, but I
 think I have found in the past that Org's syntax for inline footnotes
 ([fn:: ...]) interacts badly with LaTeX commands, especially anything
 requiring a ] in the footnote text.

 5) Bibtex and bibliographies.  I love keeping my reading list as Org
 TODO entries, but would like a more automated way to export (just) the
 entries I need for a particular document to a .bib file.  I would also
 like to have more control over the bibliography as a section of my
 document.  The \bibliography command must live under some Org heading or
 other, and as far I as know it can't live under its own without
 generating an extraneous heading, so I have to be careful that it ends
 up at the end of the last section.

 Are there other issues that people have run into when using Org to write
 a longer document with strict formatting requirements?  Again, any and
 all advice is greatly appreciated!

 Thanks,
 Richard



Aloha Richard,

The current Org-mode LaTeX exporter is nifty, but it was designed to
export notes and not dissertations.  It can be configured to do that,
but the extra translation step adds some complexity and potentially
introduces problems.  In my work this potential downside is more than
made up for by the reproducible research facilities of Org-mode.  When I
don't need these, I typically write in LaTeX.  The AucTeX environment is
a terrific help to the author of a LaTeX document and in many ways it is
ideal for a dissertation writer.

That said, the new LaTeX exporter in Org-mode is being designed to
overcome some of the limitations of the old exporter, so it will
probably be the case that the translation step from Org-mode to LaTeX
will get easier.  It would be good to have someone write a dissertation
using the new exporter because it might stretch the exporter in ways
that smaller, simpler documents do not.  But I doubt if this will be the
path of least resistance to the finished dissertation.  

I'm using ebib to manage BibTeX data now and I really like it.  It works
well with both LaTeX and Org-mode, so I don't have to switch gears

Re: [O] Using Org for a dissertation

2012-05-12 Thread Peter Münster
On Sat, May 12 2012, Richard Lawrence wrote:

 I am a graduate student in philosophy, and I am about to begin writing
 my dissertation.  I am wondering about whether I should write it in Org,
 or stick to plain LaTeX.

Or in ConTeXt...

Sorry, I can't answer your questions about Org-mode. I just know, that
ConTeXt is a much better tool for writing dissertations than LaTeX is.

-- 
   Peter




Re: [O] Feedback on org-collector Worg page

2012-05-12 Thread Mike McLean

On May 11, 2012, at 4:41 PM, Eric Schulte wrote:

 John Hendy jw.he...@gmail.com writes:
 
 I'm happy to do the updating that might come out of these comments.

Eric and John

I use org-collector in quite a few places in my daily setup. I can't say thank 
you enough for creating it (Eric) and helping the Worg documentation can only 
increase the interest in this cool add on. John, if there is anything I can do 
to help, please let me know. I typically run 1-2 days behind on the Org-Mode 
mailing list, but will see direct emails to me.

Mike





[O] Inline LaTeX fragments in emacs buffer

2012-05-12 Thread Dov Grobgeld
Is there any way of getting org-mode to display inline LaTeX fragments in
the emacs buffer? E.g. I would like to be able to type:

The size of the hypotenuse is $\sqrt{a^2+b^2}$

and then the buffer immediately shows:

The size of the hypotenuse is √a²+b²

where √a²+b² is a png image rendered via dvipng.

I assume a toggle would switch between either seeing the formula or seeing
the source of the formula, just like for the display of inline images.
Also, pressing a backspace when the cursor is at the end of the formula
should erase the trailing $ sign, and turn off image display of the
formula, just like for [[links][name]].

Has anything like this been implemented?

Thanks!
Dov


Re: [O] Inline LaTeX fragments in emacs buffer

2012-05-12 Thread Daimrod
Dov Grobgeld dov.grobg...@gmail.com writes:

 Is there any way of getting org-mode to display inline LaTeX fragments
 in the emacs buffer? E.g. I would like to be able to type:

 The size of the hypotenuse is $\sqrt{a^2+b^2}$ 

 and then the buffer immediately shows:

 The size of the hypotenuse is √a²+b²

 where √a²+b² is a png image rendered via dvipng. 

 I assume a toggle would switch between either seeing the formula or
 seeing the source of the formula, just like for the display of inline
 images. Also, pressing a backspace when the cursor is at the end of
 the formula should erase the trailing $ sign, and turn off image
 display of the formula, just like for [[links][name]].

 Has anything like this been implemented?

 Thanks!
 Dov

Yes, you can produce a preview image with C-c C-x C-l.

See
(info (org) Previewing LaTeX fragments)
and
(info (org) Embedded LaTeX)





Re: [O] Patch: option to not hide brackets in org links

2012-05-12 Thread Sean O'Halpin
On Thu, May 10, 2012 at 9:56 AM, Paul Sexton psexton...@gmail.com wrote:
 Sean O'Halpin sean.ohalpin at gmail.com writes:
 Is that publicly available anywhere?

 Here you go. To use, add orgl-enable to the relevant mode-hook, eg:
 (add-hook 'python-mode-hook 'orgl-enable)

[snip code]

Thanks!



Re: [O] Problem exporting to PDF (and viewing)

2012-05-12 Thread Richard Stanton
I think the problem is in the org-mode code that interprets %s. (and how this 
interacts with my bash shell). This is supposed to pass the executable the 
fully qualified file name, but somehow it ends up passing the directory twice, 
which (understandably) confuses the executable. 

While this seems to have something to do with the bash shell I'm using, this 
works fine for everything else, so I'm pretty sure there's no fundamental 
problem in my setup, and it would be nice to find a way around this problem.

Two thoughts:

1) Is there another string I could use, instead of %s, that results in the file 
name being passed without the path at all? This would probably cure the problem.

2) If not, where is the code that interprets %s? I can try stepping through it 
and see what I can find.

Thanks a lot.

Richard


 -Original Message-
 From: nicholas.do...@hp.com [mailto:nicholas.do...@hp.com]
 Sent: Saturday, May 12, 2012 7:40 AM
 To: Jonathan Leech-Pepin
 Cc: Richard Stanton; emacs-orgmode@gnu.org
 Subject: Re: [O] Problem exporting to PDF (and viewing)
 
 Jonathan Leech-Pepin jonathan.leechpe...@gmail.com wrote:
 
  I suspect you should be able to get it to recognize C:/Program\
  Files/sumatrapdf/sumatrapdf.exe.
 
  Alternately if the exe is found on your PATH (you may need to add it
  by hand), you should be able to manage with:
 
  (executable-find sumatrapdf.exe)
 
  which should be able to track back the path to the appropriate file.
 
  On Sat, May 12, 2012 at 12:10 AM, Richard Stanton
  stan...@haas.berkeley.edu wrote:
   Checking further, this works fine using the default Windows shell in
 Emacs, but fails if I use bash as my shell. Unfortunately, I like to use bash,
 which I achieve with the following lines in my init.el:
  
        (setq shell-file-name bash)
        (setenv SHELL shell-file-name)
        (setq explicit-shell-file-name shell-file-name)
  
   -Original Message-
   From: Richard Stanton
   Sent: Friday, May 11, 2012 4:52 PM
   To: emacs-orgmode@gnu.org
   Subject: Problem exporting to PDF (and viewing)
  
   Using Org-mode version 7.8.09 (release_7.8.09-553-g5750f0) (and
   earlier
   versions) I've encountered a problem on my Windows machine when I
   try to export an Org file to LaTeX, then to Pdf, then viewing (using C-c 
   C-
 e d).
  
   In my init.el I have the lines
  
     (eval-after-load org
       '(progn
          (if (assoc \\.pdf\\' org-file-apps)
              (setcdr (assoc \\.pdf\\' org-file-apps)
   c:/progra~1/sumatrapdf/sumatrapdf.exe  %s)
            (add-to-list 'org-file-apps '(\\.pdf\\' .
   c:/progra~1/sumatrapdf/sumatrapdf.exe %s) t
   )
  
   This results in:
  
   org-file-apps is a variable defined in `org.el'.
   Its value is ((auto-mode . emacs)
    (\\.mm\\' . default)
    (\\.x?html?\\' . default)
    (\\.pdf\\' . c:/progra~1/sumatrapdf/sumatrapdf.exe %s))
  
   When I try to export an org file by typing C-c C-e d, sumatrapdf
   opens up OK, but complains with an error like this:
  
   Error loading c:\dropbox\org\c\:\dropbox\org\personal.pdf
  
   Any idea why I get the repeated path? A similar constructions works
   fine on my Mac, so I'm not quite sure what's going wrong here.
 
 I don't do Windoze, but this looks to me like a typo in some init file, 
 perhaps a
 missing semicolon? I'd grep the usual suspects (on Linux, this would be
 /etc/*, and all the config/init files and directories under $HOME (.profile,
 .bashrc, .emacs, etc etc), but I have no idea what these would be on
 Windoze - you might even have to search the *shudder*
 registry) for c:\dropbox\org.
 
 Nick



Re: [O] Problem exporting to PDF (and viewing)

2012-05-12 Thread Nick Dokos
Richard Stanton stan...@haas.berkeley.edu wrote:

 I think the problem is in the org-mode code that interprets %s. (and
 how this interacts with my bash shell). This is supposed to pass the
 executable the fully qualified file name, but somehow it ends up
 passing the directory twice, which (understandably) confuses the
 executable.
 
 While this seems to have something to do with the bash shell I'm
 using, this works fine for everything else, so I'm pretty sure there's
 no fundamental problem in my setup, and it would be nice to find a way
 around this problem.
 
 Two thoughts:
 
 1) Is there another string I could use, instead of %s, that results in
 the file name being passed without the path at all? This would
 probably cure the problem.
 

Don't know, but I don't think so.

 2) If not, where is the code that interprets %s? I can try stepping
 through it and see what I can find.
 

It happens in org.el:org-open-file, specifically this piece of the
code (I think):

,
| (while (string-match %s cmd)
|   (setq cmd (replace-match
|  (save-match-data
|(shell-quote-argument
| (convert-standard-filename file)))
|  t t cmd)))
`

Nick