diff --git a/cmake/PugsDoc.cmake b/cmake/PugsDoc.cmake
index b067a5cc828ec0c245e8d51c0bda46a96dcce702..2be770b3a3163c6ea490413b0f73a1f4f828c82f 100644
--- a/cmake/PugsDoc.cmake
+++ b/cmake/PugsDoc.cmake
@@ -97,7 +97,19 @@ if (EMACS AND GNUPLOT_FOUND AND GMSH)
       COMMENT "Building user documentation in doc/userdoc.pdf"
       VERBATIM)
 
-    add_custom_target(userdoc-pdf DEPENDS pugsdoc-dir "${PUGS_BINARY_DIR}/doc/userdoc.pdf" )
+    configure_file("${PUGS_SOURCE_DIR}/doc/build-userdoc-pdf.sh.in"
+      "${PUGS_BINARY_DIR}/doc/build-userdoc-pdf.sh"
+      FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
+      @ONLY)
+
+    set_source_files_properties(
+      ${PUGS_BINARY_DIR}/build-pdf.sh2
+      PROPERTIES
+      GENERATED TRUE
+      HEADER_FILE_ONLY TRUE
+    )
+
+    add_custom_target(userdoc-pdf DEPENDS pugsdoc-dir "${PUGS_BINARY_DIR}/doc/userdoc.pdf" "${PUGS_BINARY_DIR}/doc/build-userdoc-pdf.sh")
 
     add_dependencies(userdoc userdoc-pdf)
 
diff --git a/doc/build-userdoc-pdf.sh.in b/doc/build-userdoc-pdf.sh.in
new file mode 100644
index 0000000000000000000000000000000000000000..9445e7e75cbb62486a4aa3647fa41a171adb7087
--- /dev/null
+++ b/doc/build-userdoc-pdf.sh.in
@@ -0,0 +1,5 @@
+#! /usr/bin/env bash
+
+@PDFLATEX_COMPILER@ -shell-escape -interaction nonstopmode userdoc
+@PDFLATEX_COMPILER@ -shell-escape -interaction nonstopmode userdoc
+@PDFLATEX_COMPILER@ -shell-escape -interaction nonstopmode userdoc
diff --git a/doc/lisp/build-doc-config.el b/doc/lisp/build-doc-config.el
index 1da3a5c9fecf3540dfd701380a340722379642cf..6f06400a6dc1176370550342ea7bfb04ac976c11 100644
--- a/doc/lisp/build-doc-config.el
+++ b/doc/lisp/build-doc-config.el
@@ -64,9 +64,7 @@
 (setq org-latex-listings 'minted
       org-latex-packages-alist '(("" "minted"))
       org-latex-pdf-process
-      '("cd ${PUGS_BINARY_DIR}/doc; pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
-        "cd ${PUGS_BINARY_DIR}/doc; pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"
-        "cd ${PUGS_BINARY_DIR}/doc; pdflatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
+      '("cd ${PUGS_BINARY_DIR}/doc; ./build-userdoc-pdf.sh"))
 
 (setq python-indent-guess-indent-offset-verbose nil)
 
diff --git a/doc/lisp/share/ob-pugs-error.el b/doc/lisp/share/ob-pugs-error.el
index 1e4680cbcc71729be805622081b37dfad6176d9c..e2228f9f4cc3ca0a0fcb65d32d8c2f8780419229 100644
--- a/doc/lisp/share/ob-pugs-error.el
+++ b/doc/lisp/share/ob-pugs-error.el
@@ -131,7 +131,7 @@
     (with-temp-file in-file
       (insert body))
     (org-babel-eval
-		(format "${PUGS} --no-preamble --no-color %s 2>&1 | sed 's@/.*\.pgs:@test.pgs:@'"
+		(format "${PUGS} --no-exec-stat --no-preamble --no-color --threads=1 %s 2>&1 | sed 's@/.*\.pgs:@test.pgs:@'"
 			(org-babel-process-file-name in-file))
 		"")))
 
diff --git a/doc/lisp/share/ob-pugs.el b/doc/lisp/share/ob-pugs.el
index 6c3d72956d519bea339b63cb883c57f9bf1cd000..fb346b80b68f95a10b214192a99c8a1e1d8f4a48 100644
--- a/doc/lisp/share/ob-pugs.el
+++ b/doc/lisp/share/ob-pugs.el
@@ -130,7 +130,7 @@
     (with-temp-file in-file
       (insert body))
     (org-babel-eval
-		(format "${PUGS} --no-preamble --no-color %s"
+		(format "${PUGS} --no-exec-stat --no-preamble --no-color --threads=1 %s"
 			(org-babel-process-file-name in-file))
 		"")))
 
diff --git a/doc/userdoc.org b/doc/userdoc.org
index 490db865223c800e05ee0ee31b52bd86486f8872..b80850ee590d3416622539b6aa4e9b3b9665d092 100644
--- a/doc/userdoc.org
+++ b/doc/userdoc.org
@@ -391,8 +391,8 @@ answer a specific need. It must not be done /because it is possible to
 do it/!
 
 #+begin_verse
-When designing a language, the difficulty is not to offer new functionalities,\\
-it is generally to decide not to offer them.\\
+When designing a language, the difficulty is not to offer new functionalities,
+it is generally to decide not to offer them.
 --- Bjarne Stroustrup, C++ conference 2021.
 #+end_verse
 
@@ -1390,7 +1390,7 @@ they follow a few rules.
   When comparing a boolean value (type ~B~) with another scalar value
   type (~N~, ~Z~ or ~R~), the value ~true~ is interpreted as $1$ and the value
   ~false~ as $0$.
-\\
+  \\
   For vector and matrix basic types, the only allowed operators are ~==~
   and ~!=~.
   #+begin_src latex :results drawer :exports results
@@ -1406,7 +1406,7 @@ they follow a few rules.
       \right.
     \end{equation*}
   #+end_src
-\\
+
   This is also the case for ~string~ values: only allowed operators are
   ~==~ and ~!=~.
   #+begin_src latex :results drawer :exports results
@@ -3136,7 +3136,6 @@ available in parallel
 
 ***** Item types
 
-\\
 The following functions are used to designate a specific ~item_type~
 - ~cell: void -> item_type~
 - ~face: void -> item_type~