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)

1
  • 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, 2021 at 12:28

1 Answer 1

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}"))))

2
  • 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, 2021 at 13:13
  • I voted to close as a dup, citing the post that generally gets cited for this duplication.
    – Drew
    Oct 20, 2021 at 21:37

Not the answer you're looking for? Browse other questions tagged or ask your own question.