Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 87afccdc authored by FELŠÖCI Marek's avatar FELŠÖCI Marek
Browse files

Add separate Elisp subscripts for advanced usage

parent 50dfb893
Branches
No related tags found
No related merge requests found
babel.el 0 → 100644
(defun org-babel-execute-file (plist filename pub-dir)
;; A custom publishing function for executing all Babel source code blocks in
;; the Org file `filename'. Note that the function does not actually publish
;; anything to `pub-dir'.
(progn
(find-file filename)
(org-babel-execute-buffer)
(set-buffer-modified-p nil)
(kill-buffer)))
(defun execute-block-in-file (block file)
;; Executes the named source code `block' in `file' without altering the
;; latter.
(progn
(find-file file)
(org-babel-goto-named-src-block block)
(org-babel-execute-src-block)
(set-buffer-modified-p nil)
(kill-buffer)))
(defun disable-babel (&optional project-plist)
;; Disable Babel code evaluation.
(setq org-export-babel-evaluate nil))
(defun enable-babel (&optional project-plist)
;; Enable Babel code evaluation.
(setq org-export-babel-evaluate t))
(with-eval-after-load 'ox-latex
(add-to-list 'org-latex-classes
'("compas2021"
"\\documentclass{compas2021}
\\usepackage{hyperref}
[NO-DEFAULT-PACKAGES]
[EXTRA]"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
(with-eval-after-load 'ox-latex
(add-to-list 'org-latex-classes
'("IEEEtran"
"\\documentclass{IEEEtran}
\\usepackage{hyperref}
[NO-DEFAULT-PACKAGES]
[EXTRA]"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
(with-eval-after-load 'ox-latex
(add-to-list 'org-latex-classes
'("llncs"
"\\documentclass{llncs}
\\usepackage{hyperref, wrapfig}
[NO-DEFAULT-PACKAGES]
[EXTRA]"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
(with-eval-after-load 'ox-latex
(add-to-list 'org-latex-classes
'("siamart220329"
"\\documentclass{siamart220329}
\\usepackage[utf8]{inputenc}
\\usepackage[T1]{fontenc}
[NO-DEFAULT-PACKAGES]
[EXTRA]"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
(with-eval-after-load 'ox-latex
(add-to-list 'org-latex-classes
'("acmart"
"\\documentclass{acmart}
[NO-DEFAULT-PACKAGES]
[EXTRA]"
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
;; Override the default LaTeX publishing command.
(setq org-latex-pdf-process
(list "latexmk --shell-escape -f -pdf -%latex -interaction=nonstopmode
-output-directory=%o %f"))
;; Custom publishing function for LaTeX files. This is useful when we need to
;; publish a manually written LaTeX file to PDF (e. g. a poster).
(defun latex-publish-to-pdf (plist filename pub-dir)
(let
;; Keep the initial directory.
((cwd default-directory))
;; Navigate to the directory of the LaTeX file to publish.
(cd (file-name-directory filename))
;; Call the interal publishing function.
(org-latex-compile filename)
;; Publish the PDF file to the destination set in the project's alist.
(org-publish-attachment
plist
(concat (file-name-sans-extension filename) ".pdf")
pub-dir)
;; Return to the initial directory.
(cd cwd)))
;; Verbose errors for PDF publishing through LaTeX
(defun org-latex-publish-to-pdf-verbose-on-error (plist filename pub-dir)
(condition-case err
(org-latex-publish-to-pdf
plist filename pub-dir)
;; Handle Org errors at first.
(user-error
(message "%s" (error-message-string err)))
;; If the Org source is fine, handle LaTeX errors.
(error
(with-current-buffer "*Org PDF LaTeX Output*"
(message (buffer-string))))))
(defun org-beamer-publish-to-pdf-verbose-on-error (plist filename pub-dir)
(condition-case err
(org-beamer-publish-to-pdf
plist filename pub-dir)
;; Handle Org errors at first.
(user-error
(message "%s" (error-message-string err)))
;; If the Org source is fine, handle LaTeX errors.
(error
(with-current-buffer "*Org PDF LaTeX Output*"
(message (buffer-string))))))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment