Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zathura
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
110
Issues
110
List
Boards
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pwmt
zathura
Commits
c64b4f54
Commit
c64b4f54
authored
Jan 11, 2014
by
Sebastian Ramacher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Just support latexsuite for now
Signed-off-by:
Sebastian Ramacher
<
sebastian+dev@ramacher.at
>
parent
b6af22c5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
37 deletions
+6
-37
data/tex_zathurasynctex.vim
data/tex_zathurasynctex.vim
+6
-37
No files found.
data/tex_zathurasynctex.vim
View file @
c64b4f54
" See LICENSE file for license and copyright information
" See LICENSE file for license and copyright information
" This is a sample plugin that can be used for synctex forward synchronization.
" It currently uses latexsuite to obtain the file name of the document. If you
" are not using latexsuite, it should be enough to adopt output accordingly.
" avoid re-execution
" avoid re-execution
if
exists
(
"b:did_zathura_synctex_plugin"
)
if
exists
(
"b:did_zathura_synctex_plugin"
)
||
!
exists
(
"*Tex_GetMainFileName"
)
finish
finish
endif
endif
let
b:did_zathura_synctex_plugin
=
1
let
b:did_zathura_synctex_plugin
=
1
" set up global variables
if
!
exists
(
"g:zathura_synctex_latex_suite"
)
let
g:zathura_synctex_latex_suite
=
1
endif
function
!
Zathura_SyncTexForward
()
function
!
Zathura_SyncTexForward
()
let
source
=
expand
(
"%:p"
)
let
source
=
expand
(
"%:p"
)
let
input
=
shellescape
(
line
(
"."
).
":"
.
col
(
"."
).
":"
.
source
)
let
input
=
shellescape
(
line
(
"."
).
":"
.
col
(
"."
).
":"
.
source
)
let
output
=
"<none>"
let
output
=
Tex_GetMainFileName
(
":p:r"
).
".pdf"
if
exists
(
"*Tex_GetMainFileName"
)
&&
g:zathura_synctex_latex_suite
==
1
" use Tex_GetMainFileName from latex-suite if it is available
let
output
=
Tex_GetMainFileName
(
":p:r"
).
".pdf"
else
" try to find synctex files and use them to determine the output file
let
synctex_files
=
split
(
glob
(
"%:p:h/*.synctex.gz"
),
"\n"
)
if
len
(
synctex_files
)
==
0
echo
"No synctex file found"
return
endif
let
found
=
0
for
synctex
in
synctex_files
let
pdffile
=
substitute
(
synctex
,
"synctex.gz"
,
"pdf"
,
""
)
let
out
=
system
(
"synctex view -i "
.
input
.
" -o "
.
shellescape
(
pdffile
))
if
match
(
out
,
"No tag for "
.
source
)
>=
0
continue
endif
let
found
=
1
let
output
=
pdffile
break
endfor
if
found
==
0
echo
"No synctex file containing reference to source file found"
return
endif
endif
let
execstr
=
"zathura --synctex-forward="
.
input
.
" "
.
shellescape
(
output
)
let
execstr
=
"zathura --synctex-forward="
.
input
.
" "
.
shellescape
(
output
)
silent
call
system
(
execstr
)
silent
call
system
(
execstr
)
endfunction
endfunction
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment