File: llpp-synctex

package info (click to toggle)
whizzytex 1.5.0-0.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,536 kB
  • sloc: lisp: 3,668; sh: 1,768; makefile: 227
file content (27 lines) | stat: -rwxr-xr-x 816 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
pdf_full=$1
pdf_dir=$(dirname $pdf_full)
pdf_slice=$(basename $pdf_full)
pdf_base=${pdf_slice#_whizzy_}
pdf_file=$pdf_dir/$pdf_base
pdf_tex=$(basename $pdf_base .wpdf).tex
page=$(($2 + 1)) # The page number star at zero in llpp
x=$3
y=$4
context=$5

# for vim
# synctex edit -o "$page:$x:$y:$pdf_file" \
#        -x "gvim --servername synctex --remote-wait-silent +%{line} '%{input}'"

# for testing/debugging
case "$5" in
    "") ;;
    *) synctex edit -o "$page:$x:$y:$pdf_file" -x "echo #line %{line}:%{column}+%{offset}:${context} '<<<<'$context>><<>>>>' '%{input}'"
esac 

# for emacs
# synctex edit -o "$page:$x:$y:$pdf_file" -x "emacsclient +%{line} '%{input}' -n"
synctex edit -o "$page:$x:$y:$pdf_file" -x "echo #line %{line}:%{column}+%{offset}:${context} '<<<<'$context>><<>>>>' '%{input}'"