diff --git a/compose-publish.el b/compose-publish.el
index c07dc36b5cf2c88020dc2567caa82ba426bfae13..d37c21987f911c920e94790b59bf9afe04e2768d 100644
--- a/compose-publish.el
+++ b/compose-publish.el
@@ -156,13 +156,14 @@ To solve this problem, when your code only knows the relative path of another fi
 
 ;; Verbose errors for pdf generation
 ;; https://www.pank.eu/blog/blog-setup.html
+;; Note we use /dev/tty instead of /dev/stdout: https://stackoverflow.com/questions/16747449/runuser-permission-denied-on-dev-stdout
 (defun org-latex-publish-to-pdf-verbose-on-error (plist filename pub-dir)
   (condition-case nil
       (org-latex-publish-to-pdf
        plist filename pub-dir)
     (error
      (with-current-buffer "*Org PDF LaTeX Output*"
-       (append-to-file (point-min) (point-max) "/dev/stdout")))))
+       (append-to-file (point-min) (point-max) "/dev/tty")))))
 
 (defun org-beamer-publish-to-pdf-verbose-on-error (plist filename pub-dir)
   (condition-case nil
@@ -170,7 +171,7 @@ To solve this problem, when your code only knows the relative path of another fi
        plist filename pub-dir)
     (error
      (with-current-buffer "*Org PDF LaTeX Output*"
-       (append-to-file (point-min) (point-max) "/dev/stdout")))))
+       (append-to-file (point-min) (point-max) "/dev/tty")))))
 
 ;; Use timestamp to avoid publishing
 (setq org-publish-use-timestamps-flag t)