Re: [zathura] synctex, open a new file on a specified line
On Wed, Apr 23, 2014 at 07:30:51PM +0200, Sebastian Ramacher wrote: >> after some playing and searching the internet I was able to use zathura >> synctex support, by opening a file: >> zathura -s -x 'gvim --servername SYNCTEX --remote +\%{line} \%{input}' >> Introduction_en.pdf >> and switching to the specified line: >> zathura --synctex-forward 100:1:/Introduction_en.tex >> Introduction_en.pdf >> >> If I try to combine these two commands I get an error saying that the >> opened instance for Introduction_en.pdf is not found. >> I wonder why this distinction is made? Is there a way to open zathura and >> sync if file is not opened, or simply sync if the opened instance exists? > > It's just that nobody had any use for anything like that yet so it's > just not there - doing anything after a document has been opened was > always a pain to time right. But if there's interest in something like > that, we can fix that. Something like this is very useful when I open up a PDF viewer from my editor (Vim of course). I'd like to have one mapping that opens a PDF (if it's not already open) and then syncs to the current location. However, this functionality can be trivially added with a little scripting. See here: http://wiki.math.cmu.edu/iki/wiki/tips/20140310-zathura-fsearch.html GI PS: Thanks a ton for implementing forward searches. I finally was able to abandon Xdvi, and now do everything with PDF files. -- 'Common' Proof Techniques: 6. Proof by Similarity -- "The other 253 cases are analogous" pgpdyiC1I86Yf.pgp Description: PGP signature ___ zathura mailing list zathura@lists.pwmt.org http://lists.pwmt.org/mailman/listinfo/zathura
Re: [zathura] synctex, open a new file on a specified line
That would be great! Thanks. Maxim On Wed, 23 Apr 2014 21:30:51 +0400, Sebastian Ramacher wrote: On 2014-04-23 10:05:40, Maxim Gonchar wrote: Hi, after some playing and searching the internet I was able to use zathura synctex support, by opening a file: zathura -s -x 'gvim --servername SYNCTEX --remote +\%{line} \%{input}' Introduction_en.pdf and switching to the specified line: zathura --synctex-forward 100:1:/Introduction_en.tex Introduction_en.pdf If I try to combine these two commands I get an error saying that the opened instance for Introduction_en.pdf is not found. I wonder why this distinction is made? Is there a way to open zathura and sync if file is not opened, or simply sync if the opened instance exists? It's just that nobody had any use for anything like that yet so it's just not there - doing anything after a document has been opened was always a pain to time right. But if there's interest in something like that, we can fix that. Cheers ___ zathura mailing list zathura@lists.pwmt.org http://lists.pwmt.org/mailman/listinfo/zathura
Re: [zathura] synctex, open a new file on a specified line
On 2014-04-23 10:05:40, Maxim Gonchar wrote: > Hi, > > after some playing and searching the internet I was able to use zathura > synctex support, by opening a file: > zathura -s -x 'gvim --servername SYNCTEX --remote +\%{line} \%{input}' > Introduction_en.pdf > and switching to the specified line: > zathura --synctex-forward 100:1:/Introduction_en.tex > Introduction_en.pdf > > If I try to combine these two commands I get an error saying that the > opened instance for Introduction_en.pdf is not found. > I wonder why this distinction is made? Is there a way to open zathura and > sync if file is not opened, or simply sync if the opened instance exists? It's just that nobody had any use for anything like that yet so it's just not there - doing anything after a document has been opened was always a pain to time right. But if there's interest in something like that, we can fix that. Cheers -- Sebastian Ramacher ___ zathura mailing list zathura@lists.pwmt.org http://lists.pwmt.org/mailman/listinfo/zathura
[zathura] synctex, open a new file on a specified line
Hi, after some playing and searching the internet I was able to use zathura synctex support, by opening a file: zathura -s -x 'gvim --servername SYNCTEX --remote +\%{line} \%{input}' Introduction_en.pdf and switching to the specified line: zathura --synctex-forward 100:1:/Introduction_en.tex Introduction_en.pdf If I try to combine these two commands I get an error saying that the opened instance for Introduction_en.pdf is not found. I wonder why this distinction is made? Is there a way to open zathura and sync if file is not opened, or simply sync if the opened instance exists? Here is the vim code to sync or run zathura, which is ugly, because instead of one function I need three: function! StartZathura( pdfname ) let cmd = "silent !zathura -s -x " let backcmd = "'gvim --servername ".v:servername." --remote +\\%{line} \\%{input}' " let execstr = cmd.backcmd.a:pdfname.'&' exec execstr endf function! SyncZathura( pdfname, status ) let cmd = "silent !zathura --synctex-forward " let path = line(".").":".col(".").":".expand("%:p")." " let execstr = cmd.path.a:pdfname if !a:status let execstr.=' &' endif exec execstr return v:shell_error endf function! StartOrSyncZathura( pdfname ) if !SyncZathura( a:pdfname, 1 ) return endif call StartZathura( a:pdfname ) sleep 300m call SyncZathura( a:pdfname, 0 ) endf regards, Maxim ___ zathura mailing list zathura@lists.pwmt.org http://lists.pwmt.org/mailman/listinfo/zathura