emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* compile latex on remote server
@ 2015-09-07 13:08 Zhihao Ding
  2015-09-07 13:14 ` Loris Bennett
  0 siblings, 1 reply; 6+ messages in thread
From: Zhihao Ding @ 2015-09-07 13:08 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 576 bytes --]

Dear org experts,

I'm working on an org file on a remote server using tramp. Often I need to
export beamer slides from it. I realised that it has problems with the file
paths, which currently are local with respect to the server. I thus had to
first export a tex file, which worked fine over tramp, then compile it in a
shell on the server.

I'd like to speed this up to do the process in one go, as if I am working
on a local machine. Sometimes when the latex file has references I then had
to compile one extra time for bibtex, which soon became tedious.

Thanks !

Zhihao

[-- Attachment #2: Type: text/html, Size: 713 bytes --]

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

* Re: compile latex on remote server
  2015-09-07 13:08 compile latex on remote server Zhihao Ding
@ 2015-09-07 13:14 ` Loris Bennett
  2015-09-07 13:25   ` Zhihao Ding
  0 siblings, 1 reply; 6+ messages in thread
From: Loris Bennett @ 2015-09-07 13:14 UTC (permalink / raw)
  To: emacs-orgmode

Hi Zhihao,

Zhihao Ding <zhihao.ding@gmail.com> writes:

> Dear org experts, 
>
> I'm working on an org file on a remote server using tramp. Often I need to
> export beamer slides from it. I realised that it has problems with the file
> paths, which currently are local with respect to the server. I thus had to first
> export a tex file, which worked fine over tramp, then compile it in a shell on
> the server. 
>
> I'd like to speed this up to do the process in one go, as if I am working on a
> local machine. Sometimes when the latex file has references I then had to
> compile one extra time for bibtex, which soon became tedious. 
>
> Thanks !
>
> Zhihao

What errors are you getting?  I regularly export PDFs from remote org
files (albeit via sshfs) and have no problems.

Cheers,

Loris

-- 
This signature is currently under construction.

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

* Re: compile latex on remote server
  2015-09-07 13:14 ` Loris Bennett
@ 2015-09-07 13:25   ` Zhihao Ding
  2015-09-07 13:39     ` Loris Bennett
  0 siblings, 1 reply; 6+ messages in thread
From: Zhihao Ding @ 2015-09-07 13:25 UTC (permalink / raw)
  To: Loris Bennett; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1577 bytes --]

Thanks for your reply. In export if I do "l P" or "l O" I get the follow
messages


Transcript written on .//texput.log.
This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)
 restricted \write18 enabled.
entering extended mode
! I can't find file `/ssh:zhihao@server:/data/home/zhihao/sgt.tex'.
<*> .... server:/data/home/zhihao/sgt.tex

(Press Enter to retry, or Control-D to exit)
Please type another input file name
! Emergency stop.
<*> .... server:/data/home/zhihao/sgt.tex

!  ==> Fatal error occurred, no output PDF file produced!


On 7 September 2015 at 14:14, Loris Bennett <loris.bennett@fu-berlin.de>
wrote:

> Hi Zhihao,
>
> Zhihao Ding <zhihao.ding@gmail.com> writes:
>
> > Dear org experts,
> >
> > I'm working on an org file on a remote server using tramp. Often I need
> to
> > export beamer slides from it. I realised that it has problems with the
> file
> > paths, which currently are local with respect to the server. I thus had
> to first
> > export a tex file, which worked fine over tramp, then compile it in a
> shell on
> > the server.
> >
> > I'd like to speed this up to do the process in one go, as if I am
> working on a
> > local machine. Sometimes when the latex file has references I then had to
> > compile one extra time for bibtex, which soon became tedious.
> >
> > Thanks !
> >
> > Zhihao
>
> What errors are you getting?  I regularly export PDFs from remote org
> files (albeit via sshfs) and have no problems.
>
> Cheers,
>
> Loris
>
> --
> This signature is currently under construction.
>
>
>


-- 
Regards,
Zhihao Ding

[-- Attachment #2: Type: text/html, Size: 2613 bytes --]

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

* Re: compile latex on remote server
  2015-09-07 13:25   ` Zhihao Ding
@ 2015-09-07 13:39     ` Loris Bennett
  2015-09-07 13:43       ` Zhihao Ding
  0 siblings, 1 reply; 6+ messages in thread
From: Loris Bennett @ 2015-09-07 13:39 UTC (permalink / raw)
  To: emacs-orgmode

Hi Zhihao,

Zhihao Ding <zhihao.ding@gmail.com> writes:

> Thanks for your reply. In export if I do "l P" or "l O" I get the follow
> messages
>
> Transcript written on .//texput.log.
> This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)
> restricted \write18 enabled.
> entering extended mode
> ! I can't find file `/ssh:zhihao@server:/data/home/zhihao/sgt.tex'.

Is this file created on the remote server?  If so, can you open it in
Emacs via tramp?

Cheers,

Loris


> <*> .... server:/data/home/zhihao/sgt.tex
> (Press Enter to retry, or Control-D to exit)
> Please type another input file name
> ! Emergency stop.
> <*> .... server:/data/home/zhihao/sgt.tex
> ! ==> Fatal error occurred, no output PDF file produced!
>
> On 7 September 2015 at 14:14, Loris Bennett <loris.bennett@fu-berlin.de> wrote:
>
>     Hi Zhihao,
>     
>     
>     
>     Zhihao Ding <zhihao.ding@gmail.com> writes:
>     
>     > Dear org experts,
>     >
>     > I'm working on an org file on a remote server using tramp. Often I need to
>     > export beamer slides from it. I realised that it has problems with the
>     file
>     > paths, which currently are local with respect to the server. I thus had to
>     first
>     > export a tex file, which worked fine over tramp, then compile it in a
>     shell on
>     > the server.
>     >
>     > I'd like to speed this up to do the process in one go, as if I am working
>     on a
>     > local machine. Sometimes when the latex file has references I then had to
>     > compile one extra time for bibtex, which soon became tedious.
>     >
>     > Thanks !
>     >
>     > Zhihao
>     
>     
>     What errors are you getting? I regularly export PDFs from remote org
>     files (albeit via sshfs) and have no problems.
>     
>     Cheers,
>     
>     Loris
>     
>     --
>     This signature is currently under construction.

-- 
Dr. Loris Bennett (Mr.)
ZEDAT, Freie Universität Berlin         Email loris.bennett@fu-berlin.de

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

* Re: compile latex on remote server
  2015-09-07 13:39     ` Loris Bennett
@ 2015-09-07 13:43       ` Zhihao Ding
  2015-09-07 16:11         ` Charles C. Berry
  0 siblings, 1 reply; 6+ messages in thread
From: Zhihao Ding @ 2015-09-07 13:43 UTC (permalink / raw)
  To: Loris Bennett; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2488 bytes --]

My emacs session is local and I am using tramp to open the org file on the
remote server. Then when I tried to export it to latex and compile I get
that error messages.

Cheers,
Zhihao


On 7 September 2015 at 14:39, Loris Bennett <loris.bennett@fu-berlin.de>
wrote:

> Hi Zhihao,
>
> Zhihao Ding <zhihao.ding@gmail.com> writes:
>
> > Thanks for your reply. In export if I do "l P" or "l O" I get the follow
> > messages
> >
> > Transcript written on .//texput.log.
> > This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)
> > restricted \write18 enabled.
> > entering extended mode
> > ! I can't find file `/ssh:zhihao@server:/data/home/zhihao/sgt.tex'.
>
> Is this file created on the remote server?  If so, can you open it in
> Emacs via tramp?
>
> Cheers,
>
> Loris
>
>
> > <*> .... server:/data/home/zhihao/sgt.tex
> > (Press Enter to retry, or Control-D to exit)
> > Please type another input file name
> > ! Emergency stop.
> > <*> .... server:/data/home/zhihao/sgt.tex
> > ! ==> Fatal error occurred, no output PDF file produced!
> >
> > On 7 September 2015 at 14:14, Loris Bennett <loris.bennett@fu-berlin.de>
> wrote:
> >
> >     Hi Zhihao,
> >
> >
> >
> >     Zhihao Ding <zhihao.ding@gmail.com> writes:
> >
> >     > Dear org experts,
> >     >
> >     > I'm working on an org file on a remote server using tramp. Often I
> need to
> >     > export beamer slides from it. I realised that it has problems with
> the
> >     file
> >     > paths, which currently are local with respect to the server. I
> thus had to
> >     first
> >     > export a tex file, which worked fine over tramp, then compile it
> in a
> >     shell on
> >     > the server.
> >     >
> >     > I'd like to speed this up to do the process in one go, as if I am
> working
> >     on a
> >     > local machine. Sometimes when the latex file has references I then
> had to
> >     > compile one extra time for bibtex, which soon became tedious.
> >     >
> >     > Thanks !
> >     >
> >     > Zhihao
> >
> >
> >     What errors are you getting? I regularly export PDFs from remote org
> >     files (albeit via sshfs) and have no problems.
> >
> >     Cheers,
> >
> >     Loris
> >
> >     --
> >     This signature is currently under construction.
>
> --
> Dr. Loris Bennett (Mr.)
> ZEDAT, Freie Universität Berlin         Email loris.bennett@fu-berlin.de
>
>
>


-- 
Regards,
Zhihao Ding

[-- Attachment #2: Type: text/html, Size: 3643 bytes --]

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

* Re: compile latex on remote server
  2015-09-07 13:43       ` Zhihao Ding
@ 2015-09-07 16:11         ` Charles C. Berry
  0 siblings, 0 replies; 6+ messages in thread
From: Charles C. Berry @ 2015-09-07 16:11 UTC (permalink / raw)
  To: Zhihao Ding; +Cc: Loris Bennett, emacs-orgmode

On Mon, 7 Sep 2015, Zhihao Ding wrote:

> My emacs session is local and I am using tramp to open the org file on the
> remote server. Then when I tried to export it to latex and compile I get
> that error messages.
>
> Cheers,
> Zhihao
>
>
> On 7 September 2015 at 14:39, Loris Bennett <loris.bennett@fu-berlin.de>
> wrote:
>
>> Hi Zhihao,
>>
>> Zhihao Ding <zhihao.ding@gmail.com> writes:
>>
>>> Thanks for your reply. In export if I do "l P" or "l O" I get the follow
>>> messages
>>>
>>> Transcript written on .//texput.log.
>>> This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)
>>> restricted \write18 enabled.
>>> entering extended mode
>>> ! I can't find file `/ssh:zhihao@server:/data/home/zhihao/sgt.tex'.
>>
>> Is this file created on the remote server?  If so, can you open it in
>> Emacs via tramp?
>>
>> Cheers,
>>
>> Loris

I confirm this behavior. Looks like the shell command to produce the pdf 
runs on the remote, but uses the tramp filename.

Maybe something like

diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index ddbbd33..dce83af 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -3456,7 +3456,8 @@ Return PDF file name or an error if it couldn't be 
produced."
  	     (replace-regexp-in-string
  	      "%b" (shell-quote-argument base-name)
  	      (replace-regexp-in-string
-	       "%f" (shell-quote-argument full-name)
+	       "%f" (shell-quote-argument
+		     (org-babel-local-file-name full-name))
  	       (replace-regexp-in-string
  		"%o" (shell-quote-argument out-dir) command t t) t t) t t)
  	     outbuf))


will fix it.

It runs on my setup - producing a pdf on the remote 
server, but I have not run `make test'.

HTH,

Chuck

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

end of thread, other threads:[~2015-09-07 16:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-07 13:08 compile latex on remote server Zhihao Ding
2015-09-07 13:14 ` Loris Bennett
2015-09-07 13:25   ` Zhihao Ding
2015-09-07 13:39     ` Loris Bennett
2015-09-07 13:43       ` Zhihao Ding
2015-09-07 16:11         ` Charles C. Berry

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).