1

I have a fully working project in TeXstudio (and overleaf). I want to use makefile to recompile, and I am unable to figure out the exact sequence of commands TeXstudio uses in a full compilation process.

pdflatex -synctex=1 -interaction=nonstopmode  "main".tex

This does not create the same output when the bibtex and other aux files are cleaned.

Furthermore, I have tried using strace, but so far it has been unsuccessful. The surprising thing is, I can't even see syscalls related to executing a command.

I found this method to list the system calls. And I opened texstudio,then started strace, run compilation and then stop strace.

strace -o >(awk '$1 ~ /^-----/ { toprint = !toprint; next } { if (toprint) print $NF }') \
  -c -p `pgrep texstudio` >/dev/null 2>/dev/null

And I could only recognize clone and clone3 syscalls related to running another command.

Here's the list of all syscalls made during the compile process

wait4
poll
readlink
clone
access
read
futex
writev
openat
ioctl
write
newfstatat
statx
clone3
mprotect
close
ppoll
mmap
fcntl
rt_sigprocmask
waitid
pipe2
rt_sigreturn
restart_syscall
getcwd
eventfd2
lseek
recvmsg
inotify_add_watch
inotify_rm_watch

Can someone help me figure out the whole compile cycle? This way or any other way (maybe by logs or just knowledge)?

  • 1
    Don't quote me on that but I believe TeXstudio inspects the log file and dynamically runs other programs or TeX again accordingly. At least that's my experience. Unless, of course, you just choose one of the programs manually instead of the magic "Compile" >> button. – Qrrbrbirlbel Dec 14 '22 at 13:53
  • @Qrrbrbirlbel Is it to save time? If yes, then what is atleast the bootstrap commands when none of the temp files exist?

    Because all the tools are CLI, but I can't find a way to use them in an actual terminal.

    – Shriraj Hegde Dec 14 '22 at 13:55
  • To save time? Sure, if it works correctly, it doesn't run something again unless it is needed. I don't know what you mean with "bootstrap command". Related: Q64, Q40738 and probably the tag [tag:makefile]. Doesn't Overleaf try to do the same? I guess, TeX → glossaries → bibliographies → TeX → TeX seems to be a good start. – Qrrbrbirlbel Dec 14 '22 at 14:02
  • I just meant like the command that is run assuming the compilation is being run for the very first time and there are no other files than the source files – Shriraj Hegde Dec 14 '22 at 14:07
  • 1
    @ShrirajHegde I wouldn't try to replicate texstudio's convoluted compile sequence. I would use latexmk to compile your file, this will automatically determine which tools need to be run. – samcarter_is_at_topanswers.xyz Dec 14 '22 at 14:09
  • @samcarter_is_at_topanswers.xyz I this that is the right answer. I ran latexmk -pdf and it generated a PDF that are identical (verified with diffpdf) – Shriraj Hegde Dec 14 '22 at 14:32

0 Answers0