Each time I compile Kile scrolls back to the beginning of the document. I would like to avoid this, it makes it very hard to write text as I need to browse back to the section I am editing each time. Any suggestions ?
1 Answers
When an error is encountered during the compilation, Kile opens the location of the first error. With some kinds of errors, Kile cannot determine where the error is located, and so it jumps to the beginning of the document. For example, this happens frequently with missing closing brackets.
The best thing is to investigate the error output (click on "Output" in the bottom menu and scroll until you find the error). When the output is long and/or you cannot find the error in it, run the compilation on command line (e.g. pdflatex my-document.tex or latex my-document.tex); the compilation will stop with a helpful message explaining where latex came to the conclusion that something is wrong, and if you investigate that spot in your input, you'll usually be able to correct it. (Press x on the command line to stop attempting further compilation after the first message.)
If you do not care to correct the compilation error (e.g., you have a coauthor who is much better than you at finding the problematic spot), then you can switch off the "Jump to first error" option. It's a tickbox in Kile's Settings > Configure Kile > Build > PDFLaTeX (the last part may be different; if you're compiling to DVI, it would be just LaTeX).
- 343
-
In addition to jumping to the top if it can't find the error, if there are no errors, Kile will jump to the top of the document with this setting checked. Unchecking it fixed this very annoying behavior, thank you! – zaen Nov 26 '19 at 17:32
-
Could it be that the command run by kile to compile the document always ends with an error exit code? If it is a script, it might help to put
exit 0on the last line of the script - but then kile will not know when the compilation fails, it will not highlight failed jobs with red color in the "Log and Messages" pane, and THAT can be very confusing, especially since after a couple of months, you forget that your script always exits gracefully, no matter how serious trouble it encountered during compilation... – Ansa211 Nov 26 '19 at 17:46 -
The behavior is pretty erratic, actually. I just defined a command to be able to type monospaced code as per this question and now the generated PDF jumps back to the top again with QuickBuild. Deleting the
\newcommandline and the\codecommands restores the functionality of staying on the current page when recompiling. – zaen Nov 26 '19 at 18:00 -
Oh, are you talking about the pdf scrolling back to the beginning? My answer is meant to adress issues with kile EDITOR view jumping to the beginning of the (main) .tex SOURCE file... For the pdf view, I prefer to have the document opened in okular with automatic reloading set on. This means there is no automatic jump to the last edited position (unlike if I were using ForwardPDF at the end of each compilation), but at least the view stays on the same page (in terms of its number). – Ansa211 Nov 27 '19 at 11:22
-
1Yes, that's what I ended up having to do, just turned live preview back on. I just set the reload timer to be long enough that I don't get errors when I pause in the middle of typing an equation and have been pleasantly surprised at how well the live preview handles scrolling the PDF to correspond to where you are in the editor. – zaen Nov 28 '19 at 13:53
.texfile and copy all your text/pictures, which need editing, to the new file. The new file's output is only 1-2 pages long -- and it is very easy to scroll and find text in just 1-2 pages. When you see that the output is good enough, just copy the source code back from the new file to the original file and then just don't care about it anymore :) – Nov 16 '18 at 07:47