TeXstudio: open file at line number n
1
vote
1
answer
452
views
I am creating a script to produce some
.tex
files with a lot of lines (a kind of automatic sample).
The script finishes with texstudio /home/$USER/foo.tex
where foo.tex
is the file created before.
My question is: is it possible to open the file with texstudio
with the cursor at line N, that is, I would like to run the script to open the file and start typing right now, exactly at the right line.
Thanks for a while. Below is the script.
----------
file=/home/$USER/fastex-temp.tex
exec 3>&1 # save file descriptor to stdout
exec > "$file" # redirect output to file
printf '\\documentclass[11pt,a4paper]{amsart}\n'
printf '\\usepackage{amsfonts,amsthm,amsmath}\n'
printf '\\usepackage[latin1]{inputenc}\n'
printf '\\usepackage[T1]{fontenc}\n'
printf ' ' >&3 # output to normal stdout instead of file
printf '\\begin{document}\n'
printf ' ' >&3
printf '\\end{document}\n'
exec >&3 # restore stdout
exec 3>&- # close / discard temporary fd
texstudio "$file"
Asked by Sigur
(2461 rep)
Sep 4, 2012, 02:32 PM
Last activity: Sep 4, 2012, 10:18 PM
Last activity: Sep 4, 2012, 10:18 PM