0

This is the code I tried:

(after! ox-latex
  (add-to-list
   'org-latex-classes
   '("deeparticle"
     (concat
      "\\documentclass[11pt]{article}\n"
      "\\usepackage{enumitem}\n"
      "\\newenvironment{deepsection}[1]{\\begin{enumerate}[label={}] \\item \\textbf{#1} \\newline}{\\end{enumerate}}")
     ("\\section{%s}" . "\\section*{%s}")
     ("\\subsection{%s}" . "\\subsection*{%s}")
     ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
     ("\\paragraph{%s}" . "\\paragraph*{%s}")
     ("\\subparagraph{%s}" . "\\subparagraph*{%s}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}"))))

I get user-error: Unknown LaTeX class ‘deeparticle’ when trying to export.

Related SE question: Defining custom latex class for org-mode export (my code should be OK according to this)

Drew
  • 75,699
  • 9
  • 109
  • 225
  • Did you check the value of `org-latex-classes`? Does it include `deeparticle`? Does the entry look OK (similar in structure to the other entries)? – NickD Oct 20 '21 at 12:28

1 Answers1

0

Fixed, I didn't quite grasp how quoting in elisp works. Correct code:

(after! ox-latex
  (add-to-list
   'org-latex-classes
   `("deeparticle"
     ,(concat
      "\\documentclass[11pt]{article}\n"
      "\\usepackage{enumitem}\n"
      "\\newenvironment{deepsection}[1]{\\begin{enumerate}[label={}] \\item \\textbf{#1} \\newline}{\\end{enumerate}}")
     ("\\section{%s}" . "\\section*{%s}")
     ("\\subsection{%s}" . "\\subsection*{%s}")
     ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
     ("\\paragraph{%s}" . "\\paragraph*{%s}")
     ("\\subparagraph{%s}" . "\\subparagraph*{%s}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}")
     ("\\begin{deepsection}{%s}" "\\end{deepsection}" "\\begin{deepsection}{%s}" "\\end{deepsection}"))))

  • This is actually a FAQ: search for `backquote`. You'll find many different faces of the same underlying problem: how to do partial evaluation inside a quoted construct. – NickD Oct 20 '21 at 13:13
  • I voted to close as a dup, citing the post that generally gets cited for this duplication. – Drew Oct 20 '21 at 21:37