emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Tim Cross <theophilusx@gmail.com>
To: gmx <fredstev@gmx.fr>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: Org-mode and koma-script
Date: Wed, 29 Aug 2018 02:04:43 +1000	[thread overview]
Message-ID: <87d0u2iijo.fsf@gmail.com> (raw)
In-Reply-To: <fde4cacc-d880-cfb6-0c80-367a5e2036dc@gmx.fr>


Sorry, I was in a rush before work and sent you the wrong command!

What you need to do is run emacs --debug-init rather than emacs -q.

Your emacs init is either in the file .emacs in your home directory or
the file init.el in the .emacs.d directory (assuming your not using
something like spacemacs or some other 'canned' setup, which may break
out the config into other files).

The code you posted i.e.

>>> ;;;;;;;;;;;;; CONFIGURATION POUR UTILISER LATEX ;;;;;;;;;;;;;;
>>> ;; Source : https://orgmode.org/worg/org-tutorials/org-latex-export.html
>>>
>>> ;; Pour pouvoir utiliser LaTeX dans un doc. org-mode
>>> (require 'ox-latex)
>>> (unless (boundp 'org-latex-classes)
>>>    (setq org-latex-classes nil))
>>> +
>>> (add-to-list 'org-latex-classes
>>>    '("article"
>>>    "\\documentclass{article}"
>>>    ("\\section{%s}" . "\\section*{%s}")))
>>>
>>> ;; Pour configurer les subdivisions des articles
>>> (add-to-list 'org-latex-classes
>>>    '("article"
>>>    "\\documentclass{article}"
>>>    ("\\section{%s}" . "\\section*{%s}")
>>>    ("\\subsection{%s}" . "\\subsection*{%s}")
>>>    ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
>>>    ("\\paragraph{%s}" . "\\paragraph*{%s}")
>>>    ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
>>>
>>> ;; Pour configurer les subdivisions de la classe book (indiquer :
>>> #+LaTeX_CLASS: book)
>>> (with-eval-after-load "ox-latex"
>>> (add-to-list 'org-latex-classes
>>>    '("book"
>>>    "\\documentclass{book}"
>>>    ("\\part{%s}" . "\\part*{%s}")
>>>    ("\\chapter{%s}" . "\\chapter*{%s}")
>>>    ("\\section{%s}" . "\\section*{%s}")
>>>    ("\\subsection{%s}" . "\\subsection*{%s}")
>>>    ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
>>>
>>> ;; Pour utiliser la classe koma-script. Indiquer : #+LaTeX_CLASS:
>>> koma-article
>>> (with-eval-after-load "ox-latex"
>>>    (add-to-list 'org-latex-classes
>>>    '("koma-article" "\\documentclass{scrartcl}"
>>>    ("\\section{%s}" . "\\section*{%s}")
>>>    ("\\subsection{%s}" . "\\subsection*{%s}")
>>>    ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
>>>    ("\\paragraph{%s}" . "\\paragraph*{%s}")
>>>    ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))))
>>

doesn't look quite right. It should be in your init file i.e. .emacs or
.emacs.d/init.el and it needs to be correctly formed elisp statements,
The --debug-init will check this. Looking at it, you seem to have a
spurious '+' character, but there may be other problems as well.

There is a customize interface you can use to add the korma classes,
which may be easier than writing elisp if your not familiar with
that. Do M-x customize-group <ret> org and have a look around. 

What I use in my init is

  (setq org-latex-classes
        '(("beamer"
           "\\documentclass[presentation]{beamer}"
           ("\\section{%s}" . "\\section*{%s}")
           ("\\subsection{%s}" . "\\subsection*{%s}")
           ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
          ("hitec-article"
           "\\documentclass[12pt]{hitec}
  [DEFAULT-PACKAGES]
  [PACKAGES]
  [NO-EXTRA]
  \\settextfraction{0.95}\n"
           ("\\section{%s}" . "\\section*{%s}")
           ("\\subsection{%s}" . "\\subsection*{%s}")
           ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
           ("\\paragraph{%s}" . "\\paragraph*{%s}")
           ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
          ("article" "\\documentclass[11pt]{article}"
           ("\\section{%s}" . "\\section*{%s}")
           ("\\subsection{%s}" . "\\subsection*{%s}")
           ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
           ("\\paragraph{%s}" . "\\paragraph*{%s}")
           ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
          ("korma-article" "\\documentclass[11pt]{scrartcl}"
           ("\\section{%s}" . "\\section*{%s}")
           ("\\subsection{%s}" . "\\subsection*{%s}")
           ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
           ("\\paragraph{%s}" . "\\paragraph*{%s}")
           ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
          ("report"
           "\\documentclass[11pt]{report}"
           ("\\part{%s}" . "\\part*{%s}")
           ("\\chapter{%s}" . "\\chapter*{%s}")
           ("\\section{%s}" . "\\section*{%s}")
           ("\\subsection{%s}" . "\\subsection*{%s}")
           ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
          ("korma-report"
           "\\documentclass[11pt]{scrreport}"
           ("\\part{%s}" . "\\part*{%s}")
           ("\\chapter{%s}" . "\\chapter*{%s}")
           ("\\section{%s}" . "\\section*{%s}")
           ("\\subsection{%s}" . "\\subsection*{%s}")
           ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
          ("korma-book"
           "\\documentclass[11pt]{scrbook}"
           ("\\part{%s}" . "\\part*{%s}")
           ("\\chapter{%s}" . "\\chapter*{%s}")
           ("\\section{%s}" . "\\section*{%s}")
           ("\\subsection{%s}" . "\\subsection*{%s}")
           ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))
          ("book"
           "\\documentclass[11pt]{book}"
           ("\\part{%s}" . "\\part*{%s}")
           ("\\chapter{%s}" . "\\chapter*{%s}")
           ("\\section{%s}" . "\\section*{%s}")
           ("\\subsection{%s}" . "\\subsection*{%s}")
           ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))

gmx <fredstev@gmx.fr> writes:

> Thanks a lot for your answer, Tim. I entered the emacs -q command, which 
> started emacs. The only message from the Terminal (before launching 
> emacs) is this:
>
> (emacs:3687): GConf-WARNING **: Client failed to connect to the D-BUS 
> daemon:
> Did not receive a reply. Possible causes include: the remote application 
> did not send a reply, the message bus security policy blocked the reply, 
> the reply timeout expired, or the network connection was broken.
>
> But no real problem.
>
> I did't find the init file : where is it, please ?
>
> Frédéric
>
>
> Le 28/08/2018 à 00:00, Tim Cross a écrit:
>> If that is a copy of what is in your .emacs or init.el file, then I
>> think you have a number of errors. Try running emacs -q and see if emacs
>> reports errors in  your init file.
>>
>> Tim
>>
>> gmx <fredstev@gmx.fr> writes:
>>
>>> I forgot the
>>>
>>> Le 27/08/2018 à 21:51, gmx a écrit:
>>>> Hello,
>>>>
>>>> I'm trying to use the koma class. I found a configuration of the.emacs
>>>> file, in the manual and in a Stack Exchange post
>>>> (https://tex.stackexchange.com/questions/364914/using-koma-script-article-with-org-mode).
>>>>
>>>>
>>>> I open a new .org file, and I declare:
>>>> #+TITLE: MyTitle
>>>> #+DATE: date
>>>> #+LANGUAGE: fr
>>>> #+LaTeX_CLASS: koma-article
>>>>
>>>> When I want to export my work in .pdf, I get the following answer:
>>>> Unknown LaTeX class 'koma-article'.
>>>>
>>>> What to do?
>>>> Thank you for your advice
>>>>
>>>> Frédéric (real newbie with org-mode, but I do my best)
>>>>
>>> contents of the file. Ready ?
>>>
>>>
>>>
>>> ;; Added by Package.el. This must come before configurations of
>>> ;; installed packages. Don't delete this line. If you don't want it,
>>> ;; just comment it out by adding a semicolon to the start of the line.
>>> ;; You may delete these explanatory comments.
>>> (package-initialize)
>>>
>>> (custom-set-variables
>>>   ;; custom-set-variables was added by Custom.
>>>   ;; If you edit it by hand, you could mess it up, so be careful.
>>>   ;; Your init file should contain only one such instance.
>>>   ;; If there is more than one, they won't work right.
>>>   '(ansi-color-faces-vector
>>>    [default default default italic underline success warning error])
>>>   '(ansi-color-names-vector
>>>    ["#212526" "#ff4b4b" "#b4fa70" "#fce94f" "#729fcf" "#e090d7"
>>> "#8cc4ff" "#eeeeec"])
>>>   '(current-language-environment "UTF-8")
>>>   '(custom-enabled-themes (quote (deeper-blue)))
>>>   '(display-battery-mode t))
>>> (custom-set-faces
>>>   ;; custom-set-faces was added by Custom.
>>>   ;; If you edit it by hand, you could mess it up, so be careful.
>>>   ;; Your init file should contain only one such instance.
>>>   ;; If there is more than one, they won't work right.
>>>   )
>>> (put 'upcase-region 'disabled nil)
>>>
>>>
>>> ;;;;;;;;;;;;; CONFIGURATION POUR UTILISER LATEX ;;;;;;;;;;;;;;
>>> ;; Source : https://orgmode.org/worg/org-tutorials/org-latex-export.html
>>>
>>> ;; Pour pouvoir utiliser LaTeX dans un doc. org-mode
>>> (require 'ox-latex)
>>> (unless (boundp 'org-latex-classes)
>>>    (setq org-latex-classes nil))
>>> +
>>> (add-to-list 'org-latex-classes
>>>    '("article"
>>>    "\\documentclass{article}"
>>>    ("\\section{%s}" . "\\section*{%s}")))
>>>
>>> ;; Pour configurer les subdivisions des articles
>>> (add-to-list 'org-latex-classes
>>>    '("article"
>>>    "\\documentclass{article}"
>>>    ("\\section{%s}" . "\\section*{%s}")
>>>    ("\\subsection{%s}" . "\\subsection*{%s}")
>>>    ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
>>>    ("\\paragraph{%s}" . "\\paragraph*{%s}")
>>>    ("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
>>>
>>> ;; Pour configurer les subdivisions de la classe book (indiquer :
>>> #+LaTeX_CLASS: book)
>>> (with-eval-after-load "ox-latex"
>>> (add-to-list 'org-latex-classes
>>>    '("book"
>>>    "\\documentclass{book}"
>>>    ("\\part{%s}" . "\\part*{%s}")
>>>    ("\\chapter{%s}" . "\\chapter*{%s}")
>>>    ("\\section{%s}" . "\\section*{%s}")
>>>    ("\\subsection{%s}" . "\\subsection*{%s}")
>>>    ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
>>>
>>> ;; Pour utiliser la classe koma-script. Indiquer : #+LaTeX_CLASS:
>>> koma-article
>>> (with-eval-after-load "ox-latex"
>>>    (add-to-list 'org-latex-classes
>>>    '("koma-article" "\\documentclass{scrartcl}"
>>>    ("\\section{%s}" . "\\section*{%s}")
>>>    ("\\subsection{%s}" . "\\subsection*{%s}")
>>>    ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
>>>    ("\\paragraph{%s}" . "\\paragraph*{%s}")
>>>    ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))))
>>


-- 
Tim Cross

  reply	other threads:[~2018-08-28 16:17 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-12 20:40 org-mode in French gmx
2017-11-12 21:00 ` Thomas S. Dye
2018-08-27 19:51   ` Org-mode and koma-script gmx
2018-08-27 19:57     ` gmx
2018-08-27 22:00       ` Tim Cross
2018-08-28  1:56         ` gmx
2018-08-28 16:04           ` Tim Cross [this message]
2018-08-28 18:10             ` gmx
2018-08-28 22:38               ` Tim Cross
2018-08-29  1:13                 ` gmx
2018-08-28 21:59             ` gmx
2018-08-28 19:44         ` Nick Dokos
2018-08-28 19:50     ` Nick Dokos
2017-11-14  7:57 ` org-mode in French Rasmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d0u2iijo.fsf@gmail.com \
    --to=theophilusx@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=fredstev@gmx.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).