0

What I you try to do:

I am trying to compile a latex file (opened buffer) with the following command in order to suppress its compilation logs:

pdflatex -shell-escape -interaction=batchmode current_buffer.tex


I keep seeing following message in the minibuffer when a tex file is compiled:

LaTeX: problems after [0] pages

I couldn't figure out why this error shows up even the tex file compiled successfully. Would it be possible to suppress this message?


Following solution is used as base to compile current buffer that is a LaTeX file with merge of the solution here: How can I prevent `pdflatex` logs to created?

(require 'package)
(setq user-init-file (or load-file-name (buffer-file-name)))
(setq user-emacs-directory (file-name-directory user-init-file))

(add-to-list 'package-archives
             '("melpa" . "https://melpa.org/packages/") t)
(package-initialize)
(setq frame-background-mode 'dark)

(require 'tex)
(add-to-list 'TeX-expand-list
             '("%(mode)"
               (lambda nil
                 (if TeX-interactive-mode ""
                   " -interaction=batchmode"))))

(setq TeX-command-extra-options " -shell-escape")

(defun my-run-latex ()
  "Save all buffers and run LaTeX on the current master."
  (interactive)
  (let* ((inhibit-message t)
         (TeX-command-force "LaTeX")
         (TeX-clean-confirm t)
         (TeX-save-query nil)
         (master (TeX-master-file))
         (process (and (stringp master) (TeX-process master))))
    (TeX-save-document master)
    (when (and (processp process)
               (eq (process-status process) 'run))
      (delete-process process))
    (TeX-command-master)))

(setq LaTeX-item-indent 0)
(setq TeX-auto-save t)
(setq TeX-parse-self t)
(add-hook 'LaTeX-mode-hook 'hl-todo-mode)
(add-hook 'TeX-update-style-hook 'hl-todo-mode)
(add-hook 'LaTeX-mode-hook 'writegood-mode)
(add-hook 'LaTeX-mode-hook (lambda ()
                             (TeX-global-PDF-mode t)))

Minimal tex file to open emacs with:

\documentclass[border=0.2cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes.symbols}
\begin{document}
\begin{tikzpicture}
    \node at (0,0) [forbidden sign,line width=2ex,draw=red,fill=white] {Smoking};
    \node [opacity=.5]   at (2,0) [forbidden sign,line width=2ex,draw=red,fill=white] {Smoking};
\end{tikzpicture}
\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:

  • compile log:
Running `LaTeX' on `emacs' with ``pdflatex -shell-escape  -interaction=batchmode emacs.tex''
This is pdfTeX, Version 3.141592653-2.6-1.40.24 (TeX Live 2022) (preloaded format=pdflatex)
 \write18 enabled.
entering extended mode
/Users/alper/venv/bin/pygmentize

TeX Output finished at Fri Jul  1 12:11:47

Question related to LaTeX: problems after [0] pages is asked here Emacs gives me "Latex: problems after [0] pages": I have applied the following configuration, which did not helped.

(add-to-list
 'TeX-expand-list
 (list "%(extraopts)"
      (lambda nil TeX-command-extra-options)))
alper
  • 1,238
  • 11
  • 30
  • I imagine this is because `auctex` is looking inside the (mostly empty) compile log to see how the run went and is now confused. – Fran Burstall Jul 01 '22 at 12:13
  • What is your source code - i.e post a minimal example. What do you try to do - maybe something is missing (i.e. pygmentize)? – Ian Jul 01 '22 at 12:52
  • @Ian I have added the minimal example , updated what I try to do write-up . Please note that pygmentize is already installed – alper Jul 03 '22 at 15:53
  • Your minimal tex-example is broken; there is `\begin{tikzpicture}` missing and even adding that doesn't fix it. I took this from pgf manual and it works: `\documentclass[border=0.2cm]{standalone} \usepackage{tikz} \usetikzlibrary{shapes.symbols} \begin{document} \begin{tikzpicture} \node at (0,0) [forbidden sign,line width=2ex,draw=red,fill=white] {Smoking}; \node [opacity=.5] at (2,0) [forbidden sign,line width=2ex,draw=red,fill=white] {Smoking}; \end{tikzpicture} \end{document}` – Arash Esbati Jul 04 '22 at 10:36
  • @ArashEsbati thanks I updated the tex section with the example code you shared – alper Jul 04 '22 at 14:27
  • A simple google search leads me to https://stackoverflow.com/a/46422528. There are more hits when you search for above message. I don't use latex or auctex. I can't help beyond what google says. –  Jul 05 '22 at 05:50

0 Answers0