emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Export to pdf when path name has ~
@ 2016-05-24 16:59 Stig Brautaset
  2016-05-26 19:52 ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Stig Brautaset @ 2016-05-24 16:59 UTC (permalink / raw)
  To: emacs-orgmode


Hello!

I'm on OS X and use their iCloud Drive to sync Org documents. I save my
documents to =~/Org=, which is a symlink to =~/Library/Mobile
Documents/com~apple~CloudDocs/Org=. This generally work fine, but launching
pdflatex fails. The *Messages* buffer has this to say:

#+BEGIN_EXAMPLE
Saving file /Users/stig/Org/TODO.tex...
Wrote /Users/stig/Org/TODO.tex
Processing LaTeX file ./TODO.tex...
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
! I can't find file `"/Users/stig/Library/Mobile Documents/com"'.
<to be read again> 
                   \protect 
<*> "/Users/stig/Library/Mobile Documents/com~
                                              apple~CloudDocs/Org/TODO.tex"
(Press Enter to retry, or Control-D to exit)
Please type another input file name
! Emergency stop.
<to be read again> 
                   \protect 
<*> "/Users/stig/Library/Mobile Documents/com~
                                              apple~CloudDocs/Org/TODO.tex"

[...]

!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on .//texput.log.
org-latex-compile: PDF file ./TODO.pdf wasn't produced
#+END_EXAMPLE

However, looking at the directory the =.tex= file is created:

#+begin_example
17:03:45 ~> ls -l ~/Library/Mobile\ Documents/com~apple~CloudDocs/Org/TODO*
-rw-r--r--  1 stig  staff   8080 24 May 16:07 /Users/stig/Library/Mobile Documents/com~apple~CloudDocs/Org/TODO.org
-rw-r--r--  1 stig  staff  10870 24 May 17:02 /Users/stig/Library/Mobile Documents/com~apple~CloudDocs/Org/TODO.tex
#+end_example

And, indeed, running pdflatex on that file works perfectly fine from the shell:

#+BEGIN_EXAMPLE
17:37:57 /tmp> /Library/TeX/texbin/pdflatex ~/Org/TODO.tex
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
(/Users/stig/Org/TODO.tex
LaTeX2e <2015/01/01>

[...]

Output written on TODO.pdf (10 pages, 206446 bytes).
Transcript written on TODO.log.
#+END_EXAMPLE


... except if you use the full path (rather than the symlink), in which case
pdflatex chockes on the filename:

#+begin_example
17:27:25 /tmp> pdflatex "/Users/stig/Library/Mobile Documents/com~apple~CloudDocs/Org/TODO.tex"
This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)
 restricted \write18 enabled.
entering extended mode
! I can't find file `"/Users/stig/Library/Mobile Documents/com"'.
<to be read again> 
                   \protect 
<*> "/Users/stig/Library/Mobile Documents/com~
                                              apple~CloudDocs/Org/TODO.tex"
(Press Enter to retry, or Control-D to exit)
Please type another input file name: ^D
! Emergency stop.
<to be read again> 
                   \protect 
<*> "/Users/stig/Library/Mobile Documents/com~
                                              apple~CloudDocs/Org/TODO.tex"
!  ==> Fatal error occurred, no output PDF file produced!
Transcript written on texput.log.
#+END_EXAMPLE

Any suggestions for making =C-c C-e l p= work? I suppose I could migrate to
use DropBox rather than iCloud Drive, but I would really like to avoid that,
so any suggestions for work-arounds that lets me continue to use iCloud Drive
would be nice :-)

Stig

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Export to pdf when path name has ~
  2016-05-24 16:59 Export to pdf when path name has ~ Stig Brautaset
@ 2016-05-26 19:52 ` Nicolas Goaziou
  2016-05-26 22:30   ` Stig Brautaset
  2016-05-27  7:04   ` Rasmus
  0 siblings, 2 replies; 9+ messages in thread
From: Nicolas Goaziou @ 2016-05-26 19:52 UTC (permalink / raw)
  To: Stig Brautaset; +Cc: emacs-orgmode, Rasmus

Hello,

Stig Brautaset <stig@brautaset.org> writes:

> And, indeed, running pdflatex on that file works perfectly fine from the shell:
>
> #+BEGIN_EXAMPLE
> 17:37:57 /tmp> /Library/TeX/texbin/pdflatex ~/Org/TODO.tex
> This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)
>  restricted \write18 enabled.
> entering extended mode
> (/Users/stig/Org/TODO.tex
> LaTeX2e <2015/01/01>
>
> [...]
>
> Output written on TODO.pdf (10 pages, 206446 bytes).
> Transcript written on TODO.log.
> #+END_EXAMPLE
>
>
> ... except if you use the full path (rather than the symlink), in which case
> pdflatex chockes on the filename:
>
> #+begin_example
> 17:27:25 /tmp> pdflatex "/Users/stig/Library/Mobile Documents/com~apple~CloudDocs/Org/TODO.tex"
> This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)
>  restricted \write18 enabled.
> entering extended mode
> ! I can't find file `"/Users/stig/Library/Mobile Documents/com"'.
> <to be read again> 
>                    \protect 
> <*> "/Users/stig/Library/Mobile Documents/com~
>                                               apple~CloudDocs/Org/TODO.tex"

Indeed. It seems pdflatex doesn't like the ~ sign excepted at the
beginning of the filename. It doesn't seem to be Org related though.

In any case, I'm wondering if we really need to send the full canonical
path (as returned by `file-truename') of the tex file to the pdflatex
process.

For example, we could set `default-directory' to the directory of the
tex file and provide only relative filename with %f. If needed, %F may
be used for the full path. I don't think it would introduce
incompatibilities.

WDYT?

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Export to pdf when path name has ~
  2016-05-26 19:52 ` Nicolas Goaziou
@ 2016-05-26 22:30   ` Stig Brautaset
  2016-05-27  7:04   ` Rasmus
  1 sibling, 0 replies; 9+ messages in thread
From: Stig Brautaset @ 2016-05-26 22:30 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Stig Brautaset <stig@brautaset.org> writes:

[...]

>> pdflatex chockes on the filename:
>>
>> #+begin_example
>> 17:27:25 /tmp> pdflatex "/Users/stig/Library/Mobile Documents/com~apple~CloudDocs/Org/TODO.tex"
>> This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)
>>  restricted \write18 enabled.
>> entering extended mode
>> ! I can't find file `"/Users/stig/Library/Mobile Documents/com"'.
>> <to be read again> 
>>                    \protect 
>> <*> "/Users/stig/Library/Mobile Documents/com~
>>                                               apple~CloudDocs/Org/TODO.tex"
>
> Indeed. It seems pdflatex doesn't like the ~ sign excepted at the
> beginning of the filename. It doesn't seem to be Org related though.

No, it does not seem to be Org related. I thought that at first, but
found it failed in a regular terminal too.

> In any case, I'm wondering if we really need to send the full canonical
> path (as returned by `file-truename') of the tex file to the pdflatex
> process.
>
> For example, we could set `default-directory' to the directory of the
> tex file and provide only relative filename with %f. If needed, %F may
> be used for the full path. I don't think it would introduce
> incompatibilities.
>
> WDYT?

That sounds like it would solve my issue, and is what I was hoping to hear :-)

Stig

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Export to pdf when path name has ~
  2016-05-26 19:52 ` Nicolas Goaziou
  2016-05-26 22:30   ` Stig Brautaset
@ 2016-05-27  7:04   ` Rasmus
  2016-05-29 22:15     ` Nicolas Goaziou
  1 sibling, 1 reply; 9+ messages in thread
From: Rasmus @ 2016-05-27  7:04 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Stig Brautaset <stig@brautaset.org> writes:
>
>> And, indeed, running pdflatex on that file works perfectly fine from the shell:
>>
>> #+BEGIN_EXAMPLE
>> 17:37:57 /tmp> /Library/TeX/texbin/pdflatex ~/Org/TODO.tex
>> This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)
>>  restricted \write18 enabled.
>> entering extended mode
>> (/Users/stig/Org/TODO.tex
>> LaTeX2e <2015/01/01>
>>
>> [...]
>>
>> Output written on TODO.pdf (10 pages, 206446 bytes).
>> Transcript written on TODO.log.
>> #+END_EXAMPLE
>>
>>
>> ... except if you use the full path (rather than the symlink), in which case
>> pdflatex chockes on the filename:
>>
>> #+begin_example
>> 17:27:25 /tmp> pdflatex "/Users/stig/Library/Mobile Documents/com~apple~CloudDocs/Org/TODO.tex"
>> This is pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex)
>>  restricted \write18 enabled.
>> entering extended mode
>> ! I can't find file `"/Users/stig/Library/Mobile Documents/com"'.
>> <to be read again> 
>>                    \protect 
>> <*> "/Users/stig/Library/Mobile Documents/com~
>>                                               apple~CloudDocs/Org/TODO.tex"
>
> Indeed. It seems pdflatex doesn't like the ~ sign excepted at the
> beginning of the filename. It doesn't seem to be Org related though.
>
> In any case, I'm wondering if we really need to send the full canonical
> path (as returned by `file-truename') of the tex file to the pdflatex
> process.
>
> For example, we could set `default-directory' to the directory of the
> tex file and provide only relative filename with %f. If needed, %F may
> be used for the full path. I don't think it would introduce
> incompatibilities.
>
> WDYT?

It would make sense to run the process starting from the path of the
compiling org document (in Stig’s example from the Org folder).  AFAIK
this is what AUCTeX does (modulus the value of TeX-master) and I think the
build in TeX compiler as well.

I also agree that the best way would be to change the meaning of %f.

Rasmus



-- 
I hear there's rumors on the, uh, Internets. . .

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Export to pdf when path name has ~
  2016-05-27  7:04   ` Rasmus
@ 2016-05-29 22:15     ` Nicolas Goaziou
  2016-06-10 14:58       ` Stig Brautaset
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2016-05-29 22:15 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

Hello,

Rasmus <rasmus@gmx.us> writes:

> It would make sense to run the process starting from the path of the
> compiling org document (in Stig’s example from the Org folder).  AFAIK
> this is what AUCTeX does (modulus the value of TeX-master) and I think the
> build in TeX compiler as well.
>
> I also agree that the best way would be to change the meaning of %f.

Done in 3d0ade9. Thank you for the feedback.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Export to pdf when path name has ~
  2016-05-29 22:15     ` Nicolas Goaziou
@ 2016-06-10 14:58       ` Stig Brautaset
  2016-06-10 21:52         ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Stig Brautaset @ 2016-06-10 14:58 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>> I also agree that the best way would be to change the meaning of %f.
>
> Done in 3d0ade9. Thank you for the feedback.

Fabulous. I wanted to test it, but even though I think I have the latest
Org I can't get this to work. =M-x org-version= says:

Org-mode version 8.3.4 (8.3.4-79-gbd4948-elpaplus @ /Users/stig/.emacs.d/elpa/org-plus-contrib-20160606/)

Stig

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Export to pdf when path name has ~
  2016-06-10 14:58       ` Stig Brautaset
@ 2016-06-10 21:52         ` Nicolas Goaziou
  2016-06-11  0:10           ` Stig Brautaset
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2016-06-10 21:52 UTC (permalink / raw)
  To: Stig Brautaset; +Cc: emacs-orgmode

Hello,

Stig Brautaset <stig@brautaset.org> writes:

> Fabulous. I wanted to test it, but even though I think I have the latest
> Org I can't get this to work. =M-x org-version= says:
>
> Org-mode version 8.3.4 (8.3.4-79-gbd4948-elpaplus @
> /Users/stig/.emacs.d/elpa/org-plus-contrib-20160606/)

The change was introduced in master, whereas you're using stable branch.

Regards,

-- 
Nicolas Goaziou

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Export to pdf when path name has ~
  2016-06-10 21:52         ` Nicolas Goaziou
@ 2016-06-11  0:10           ` Stig Brautaset
  2016-08-31 12:51             ` Stig Brautaset
  0 siblings, 1 reply; 9+ messages in thread
From: Stig Brautaset @ 2016-06-11  0:10 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>> Fabulous. I wanted to test it, but even though I think I have the latest
>> Org I can't get this to work. =M-x org-version= says:
>>
>> Org-mode version 8.3.4 (8.3.4-79-gbd4948-elpaplus @
>> /Users/stig/.emacs.d/elpa/org-plus-contrib-20160606/)
>
> The change was introduced in master, whereas you're using stable branch.

Oh right! Thanks for that. Well, I have now installed the master branch
and confirmed that this fixes my issue. Thanks :-)

Stig

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Export to pdf when path name has ~
  2016-06-11  0:10           ` Stig Brautaset
@ 2016-08-31 12:51             ` Stig Brautaset
  0 siblings, 0 replies; 9+ messages in thread
From: Stig Brautaset @ 2016-08-31 12:51 UTC (permalink / raw)
  To: emacs-orgmode

Stig Brautaset <stig@brautaset.org> writes:

> Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:
>>> Fabulous. I wanted to test it, but even though I think I have the latest
>>> Org I can't get this to work. =M-x org-version= says:
>>>
>>> Org-mode version 8.3.4 (8.3.4-79-gbd4948-elpaplus @
>>> /Users/stig/.emacs.d/elpa/org-plus-contrib-20160606/)
>>
>> The change was introduced in master, whereas you're using stable branch.
>
> Oh right! Thanks for that. Well, I have now installed the master branch
> and confirmed that this fixes my issue. Thanks :-)


When could I hope for this change to reach elpa plus? I would really
like to be able to use Org installed by package.el (as I'm only set up
for development on one machine), but as of yet this change has not made
it in:

    Org-mode version 8.3.5 (8.3.5-1-g589e96-elpaplus @ /Users/stig/.emacs.d/elpa/org-plus-contrib-20160822/)

Stig

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2016-09-01  9:18 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-24 16:59 Export to pdf when path name has ~ Stig Brautaset
2016-05-26 19:52 ` Nicolas Goaziou
2016-05-26 22:30   ` Stig Brautaset
2016-05-27  7:04   ` Rasmus
2016-05-29 22:15     ` Nicolas Goaziou
2016-06-10 14:58       ` Stig Brautaset
2016-06-10 21:52         ` Nicolas Goaziou
2016-06-11  0:10           ` Stig Brautaset
2016-08-31 12:51             ` Stig Brautaset

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).