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)))
6
  • I imagine this is because auctex is looking inside the (mostly empty) compile log to see how the run went and is now confused. Jul 1, 2022 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 1, 2022 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 3, 2022 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} Jul 4, 2022 at 10:36
  • @ArashEsbati thanks I updated the tex section with the example code you shared
    – alper
    Jul 4, 2022 at 14:27

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.