emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Remove \maketitle from scrlttr2 latex export
@ 2011-07-30 14:14 Peter de Jong
  2011-07-30 20:24 ` Jambunathan K
       [not found] ` <811ux6zkoh.fsf@gmail.com>
  0 siblings, 2 replies; 5+ messages in thread
From: Peter de Jong @ 2011-07-30 14:14 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 743 bytes --]

Hi,

Since a few days i use the scrlttr2 org-mode implementation of
Jambunathan. His work was posted in this list:
http://lists.gnu.org/archive/html/emacs-orgmode/2010-09/msg01264.html
http://lists.gnu.org/archive/html/emacs-orgmode/2010-09/msg01266.html

His 4 .el files are placed in ~/emacs/contrib/scrlttr2 and are loaded
in _emacs (commented out my own configuration).
I then start emacs, open brief.scrlttr2, Ctrl-c Ctrl-e d opens the
attached pdf file. I included the intermediate brief.tex.

As the pdf shows, there is a for the most blank first page with "none"
from the \maketitle statement. Whatever i do, this statement keeps
getting generated.

How can I remove this?

With kind regards and much thanks in advance,

Peter de Jong

[-- Attachment #2: org-isodoc.el --]
[-- Type: application/octet-stream, Size: 1349 bytes --]

(require 'org-latex-generic)
(require 'org-letter-utils)

;; An isodoc file starts in org-latex-generic-mode
(setq auto-mode-alist (append '(("\\.isodoc$" . org-latex-generic-mode))
                              auto-mode-alist))

;; Register sectioning structure for isodoc class. For now use the
;; generic routine.
(add-to-list
 'org-export-latex-classes
 '("isodoc" "\\documentclass{isodoc}" org-latex-generic-sectioning) t)

(defcustom org-latex-generic-isodoc-setup
  "
#+LaTeX_CLASS: isodoc
#+LATEX_HEADER: \\usepackage{mystyle}
#+OPTIONS: toc:nil
#+TITLE:
"
  "Meta lines for isodoc class. Insert your own stylesheet."
  :group 'org-letter-isodoc
  :type 'string)

(defvar org-latex-generic-isodoc-template
  '("letter"
    ("options"
     ("date" "to" "opening" "subject" "closing" "enclosures"))
    ("body"))
  "Outline structure for isodoc file."
  )

(defcustom org-latex-generic-isodoc-sectioning-alist
  '(("letter" . cmd-with-opt)
    ("options" . optarg)
    ("date" . option)
    ("to" . option)
    ("opening" . option)
    ("subject" . option)
    ("closing" . option)
    ("enclosures" . option)
    ("body" . arg))
  "Common LaTeX commands and Environment for use with isodoc class."
  :group 'org-letter-isodoc
  :type org-latex-generic-sectioning-config)

(provide 'org-isodoc)

[-- Attachment #3: org-latex-generic.el --]
[-- Type: application/octet-stream, Size: 3833 bytes --]

(require 'org)
(require 'org-latex)

(defvar org-latex-classes nil)
(defvar org-latex-generic-sectioning-config
  '(alist :tag "Org LaTeX Generic Known Headings"
          :key-type
          (string :tag "heading")
          :value-type
          (choice
           (const :tag "environment" env)                 
           (const :tag "var" var)
           (const :tag "command" cmd)
           (const :tag "command-with-options" cmd-with-opt)              
           (const :tag "options" optarg)
           (const :tag "option" option)
           (const :tag "arg" arg)
           (const :tag "text" text))))


(define-minor-mode org-latex-generic-mode
  "Fill an empty file with Org outline tree for easy editing.
The extension of the file serves as an indication of the target
LaTeX class."
  nil " LaTex Generic" nil
  (org-mode)

  (let ((class (file-name-extension buffer-file-name)))

    ;; FIXME: These should be buffer local variables for various
    ;; generic classes to coexist. For now have them as global.

    ;; The main problem is that sectioning callback happens with tex
    ;; file as current buffer and not the original org file in which
    ;; these variables are set.

    (setq org-latex-generic-class class
          org-latex-generic-setup
          (symbol-value
           (intern (format "org-latex-generic-%s-setup" class)))

          org-latex-generic-template
          (symbol-value
           (intern (format "org-latex-generic-%s-template" class)))

          org-latex-generic-sectioning-alist
          (symbol-value
           (intern (format "org-latex-generic-%s-sectioning-alist" class))))

    (when (= (point-min) (point-max))
      (insert org-latex-generic-setup)
      (org-latex-generic-insert-template))))

(defun org-latex-generic-insert-template (&optional template level)
  "Inserts an Org outline structure for the user to fill in.
See `org-latex-generic-isodoc-template' and
`org-latex-generic-scrlttr2-template' for example."
  (interactive)

  (setq template (or template org-latex-generic-template))
  (goto-char (point-max))
  (setq level (or level 1))
  (dolist (e template)
    (if (not (listp e))
        (insert  "\n" (make-string level ?*) " " e "\n")
      (org-latex-generic-insert-template e (+ level 1)))))

(defun org-latex-generic-sectioning (level heading)
  "Rules for emitting Org headings as LaTeX fragments.
Currently a heading could be configured to start a LaTeX
environment, emit a LaTeX command, set optional arguments (with
heading as key and entry body as value) and mandatory
arguments. See `org-latex-generic-scrlttr2-sectioning-alist' and
`org-latex-generic-isodoc-sectioning-alist'. "
  (let* ((heading (replace-regexp-in-string "\\s-+" "" heading))
         (pair (assoc-string heading org-latex-generic-sectioning-alist t))
         open close)

    (when pair
      (cond
       ((eq (cdr pair) 'env)
        (setq open (format "\\begin{%s}\n" (car pair))
              close (format "\\end{%s}" (car pair))))
       ((eq (cdr pair) 'var)
        (setq open (format "\n\\setkomavar{%s} {"  (car pair))
              close "}"))
       ((eq (cdr pair) 'cmd)
        (setq open "\n\\%s {"
              close "}"))
       ((eq (cdr pair) 'cmd-with-opt)
        (setq open "\n\\%s"
              close ""))
       ((eq (cdr pair) 'optarg)
        (setq open "[" close "]"))
       ((eq (cdr pair) 'option)
        (setq open (format "%s =" (car pair)) close ","))
       ((eq (cdr pair) 'arg)
        (setq open " {" close "}"))
       ((eq (cdr pair) 'text)
        (setq open "" close ""))))
    (remove-list-of-text-properties 0 (length heading) '(target) heading)
    (list heading open close open close)))

(provide 'org-latex-generic)

[-- Attachment #4: org-letter-utils.el --]
[-- Type: application/octet-stream, Size: 853 bytes --]

(require 'org-bbdb)

(org-add-link-type "bbdb" 'org-bbdb-open 'org-letter-utils-bbdb-export)
(defun org-letter-utils-bbdb-export (path desc format)
  "Convert a BBDB link to an address.
Customized for Indian style. Commas are a strict No No for
now. Make this sit nicely with `bbdb-format-address' and
friends."
  (when (eq format 'latex)
    (let* ((name path) (separator " \\\\\n")
           (indent 2) (prefix (make-string indent ? ))
           (addr (car (bbdb-record-addresses (bbdb-search-simple name nil)))))
      (concat
       prefix name separator
       (mapconcat (lambda (line) (concat prefix line))
                  (bbdb-address-streets addr) separator) separator
       prefix (bbdb-address-city addr) " - " (bbdb-address-zip addr) separator
       prefix (bbdb-address-state addr)))))

(provide 'org-letter-utils)

[-- Attachment #5: org-scrlttr2.el --]
[-- Type: application/octet-stream, Size: 1236 bytes --]

(require 'org-latex-generic)
(require 'org-letter-utils)

;; An scrlttr2 file starts in org-latex-generic-mode
(setq auto-mode-alist (append '(("\\.scrlttr2$" . org-latex-generic-mode))
                              auto-mode-alist))

;; Register sectioning structure for Scrlttr2 class. For now use the
;; generic routine.

(add-to-list
 'org-export-latex-classes
 '("scrlttr2" "\\documentclass{scrlttr2}" org-latex-generic-sectioning) t)

(defcustom org-latex-generic-scrlttr2-setup  
  "
#+LaTeX_CLASS: scrlttr2
#+LaTeX_CLASS_OPTIONS: [DIN]
#+OPTIONS: toc:nil
"
  "Meta lines for scrlttr2 class. Plug in your LCO file."
  :group 'org-scrlttr2
  :type 'string)

(defvar org-latex-generic-scrlttr2-template
  '("letter"
    ("to" "subject" "opening" "body" "encl" "closing"))
  "Outline structure for scrlttr2 file."
  )

(defcustom org-latex-generic-scrlttr2-sectioning-alist
  '(("letter" . env)
    ("to" . arg)
    ("subject" . var)
    ("opening" . cmd)
    ("body" . text)
    ("encl" . cmd)
    ("closing" . cmd))
  "Common LaTeX commands and Environment for use with scrlttr2 class."
  :group 'org-letter-scrlttr2
  :type org-latex-generic-sectioning-config)

(provide 'org-scrlttr2)

[-- Attachment #6: _emacs --]
[-- Type: application/octet-stream, Size: 276 bytes --]

;; load path
;(add-to-list 'load-path "~/emacs/")
;; load loader
;(require 'conf-loader)
;; load path
(add-to-list 'load-path "~/emacs/contrib/org-7.7/lisp")
(add-to-list 'load-path "~/emacs/contrib/scrlttr2")
;; scrlttr2 support
(require 'org-isodoc)
(require 'org-scrlttr2)

[-- Attachment #7: brief.scrlttr2 --]
[-- Type: application/octet-stream, Size: 400 bytes --]

#+LaTeX_CLASS: scrlttr2
#+LaTeX_CLASS_OPTIONS: [pdj]
#+OPTIONS: toc:nil
#+TITLE:
#+AUTHOR: 
#+DATE:
#+BIND: org-export-latex-title-command ""
* letter

** to
   Bla
** subject
   Composing letters using scrlttr2

** opening
   Friends

** body
   I would like to share with you a little utility that helps me
   compose formal letters within Org mode. Would you like to try it?

** closing
   Thanks

[-- Attachment #8: pdj.lco --]
[-- Type: application/octet-stream, Size: 290 bytes --]

\setkomavar{fromname}[Afzender]{Peter de Jong}
\setkomavar{fromemail}{p.de.jong@gmail.com}
\setkomavar{fromphone}{555-1337}
\setkomavar{fromzipcode}{0000 XX}
\setkomavar{signature}{\usekomavar{fromname}}
\setkomavar{fromaddress}{Somewhere\\Nederland}
\setkomavar{subject}{Onderwerp}

[-- Attachment #9: brief.pdf --]
[-- Type: application/pdf, Size: 42702 bytes --]

[-- Attachment #10: brief.tex --]
[-- Type: application/x-tex, Size: 779 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-08-01 11:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-30 14:14 Remove \maketitle from scrlttr2 latex export Peter de Jong
2011-07-30 20:24 ` Jambunathan K
2011-07-31 11:55   ` Peter de Jong
2011-07-31 12:30     ` Jambunathan K
     [not found] ` <811ux6zkoh.fsf@gmail.com>
     [not found]   ` <CAH-FKQbp-p+AtJuNQP7y1tk=rWc0k4vXpL_QT6tHMQT+h=NMqA@mail.gmail.com>
2011-08-01 11:05     ` Peter de Jong

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).