emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* "Minimal" LaTeX export
@ 2017-12-16 16:48 Vicente Vera
  2017-12-16 17:33 ` Rasmus
  2017-12-16 17:46 ` Berry, Charles
  0 siblings, 2 replies; 4+ messages in thread
From: Vicente Vera @ 2017-12-16 16:48 UTC (permalink / raw)
  To: emacs-orgmode

Hello

I'm trying to export a simple document to a LaTeX buffer, but just the
main content, without a preamble nor the "document" environment. The
main objective is to export several Org documents which are parts of a
larger LaTeX report. These parts are then included by means of the
"input" command.

This is what I came up with, but, of course, there are other functions
involved that seem too expensive to modify:

(defun this-is-just-a-test ()
  (interactive)
  (require 'ox-latex)
  (let ((org-export-with-date nil)
        (org-export-with-toc nil)
        (org-latex-classes
         (append org-latex-classes
                 '(("nothing-at-all"
                    "[NO-DEFAULT-PACKAGES]
[NO-PACKAGES]
[NO-EXTRA]"
                    ;; "book"
                    ("\\part{%s}" . "\\part*{%s}")
                    ("\\chapter{%s}" . "\\chapter*{%s}")
                    ("\\section{%s}" . "\\section*{%s}")
                    ("\\subsection{%s}" . "\\subsection*{%s}")
                    ("\\subsubsection{%s}" . "\\subsubsection*{%s}")))))
        (org-latex-default-class "nothing-at-all")
        (org-latex-with-hyperref nil)
        (org-latex-hyperref-template nil)
        (org-latex-prefer-user-labels t))
    (org-latex-export-as-latex)))

Is there a "clean", elispy way to do this?

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

* Re: "Minimal" LaTeX export
  2017-12-16 16:48 "Minimal" LaTeX export Vicente Vera
@ 2017-12-16 17:33 ` Rasmus
  2017-12-16 17:46 ` Berry, Charles
  1 sibling, 0 replies; 4+ messages in thread
From: Rasmus @ 2017-12-16 17:33 UTC (permalink / raw)
  To: emacs-orgmode

Hi,

Would the body only export option in the export dispatcher work? (C-c C-e
and then C-b)?

Rasmus

-- 
C is for Cookie

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

* Re: "Minimal" LaTeX export
  2017-12-16 16:48 "Minimal" LaTeX export Vicente Vera
  2017-12-16 17:33 ` Rasmus
@ 2017-12-16 17:46 ` Berry, Charles
  2017-12-16 21:45   ` Vicente Vera
  1 sibling, 1 reply; 4+ messages in thread
From: Berry, Charles @ 2017-12-16 17:46 UTC (permalink / raw)
  To: Vicente Vera; +Cc: emacs-orgmode



> On Dec 16, 2017, at 8:48 AM, Vicente Vera <vicentemvp@gmail.com> wrote:
> 
> I'm trying to export a simple document to a LaTeX buffer, but just the
> main content, without a preamble nor the "document" environment.

You want `(org-latex-export-as-latex nil nil nil t)' or `C-c C-e C-b l L'.


,----[ C-h f org-latex-export-as-latex RET ]
| org-latex-export-as-latex is an interactive autoloaded compiled Lisp
| function in ‘ox-latex.el’.
| 
| (org-latex-export-as-latex &optional ASYNC SUBTREEP VISIBLE-ONLY
| BODY-ONLY EXT-PLIST)
| 
| Export current buffer as a LaTeX buffer.
| 
| [...]
| 
| When optional argument BODY-ONLY is non-nil, only write code
| between "\begin{document}" and "\end{document}". 
|
| [...]
`----

> The main objective is to export several Org documents which are parts of a
> larger LaTeX report. These parts are then included by means of the
> "input" command.


Why not use include keywords in the org document?  They can, if needed, refer to sections in the parent document. 

See (info "(org) Include files")

HTH,

Chuck

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

* Re: "Minimal" LaTeX export
  2017-12-16 17:46 ` Berry, Charles
@ 2017-12-16 21:45   ` Vicente Vera
  0 siblings, 0 replies; 4+ messages in thread
From: Vicente Vera @ 2017-12-16 21:45 UTC (permalink / raw)
  To: Charles C. Berry; +Cc: emacs-orgmode

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

That is amazing. Thank you very much!

Yes, that's a good idea (include files); will look into it.


El dic 16, 2017 2:46 PM, "Berry, Charles" <ccberry@ucsd.edu> escribió:



> On Dec 16, 2017, at 8:48 AM, Vicente Vera <vicentemvp@gmail.com> wrote:
>
> I'm trying to export a simple document to a LaTeX buffer, but just the
> main content, without a preamble nor the "document" environment.

You want `(org-latex-export-as-latex nil nil nil t)' or `C-c C-e C-b l L'.


,----[ C-h f org-latex-export-as-latex RET ]
| org-latex-export-as-latex is an interactive autoloaded compiled Lisp
| function in ‘ox-latex.el’.
|
| (org-latex-export-as-latex &optional ASYNC SUBTREEP VISIBLE-ONLY
| BODY-ONLY EXT-PLIST)
|
| Export current buffer as a LaTeX buffer.
|
| [...]
|
| When optional argument BODY-ONLY is non-nil, only write code
| between "\begin{document}" and "\end{document}".
|
| [...]
`----

> The main objective is to export several Org documents which are parts of a
> larger LaTeX report. These parts are then included by means of the
> "input" command.


Why not use include keywords in the org document?  They can, if needed,
refer to sections in the parent document.

See (info "(org) Include files")

HTH,

Chuck

[-- Attachment #2: Type: text/html, Size: 1954 bytes --]

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

end of thread, other threads:[~2017-12-16 21:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-16 16:48 "Minimal" LaTeX export Vicente Vera
2017-12-16 17:33 ` Rasmus
2017-12-16 17:46 ` Berry, Charles
2017-12-16 21:45   ` Vicente Vera

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