-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathox-report.el
631 lines (527 loc) · 21.3 KB
/
ox-report.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
;;; ox-report.el --- Export your org file to minutes report PDF file -*- lexical-binding: t -*-
;; Copyright (C) 2020 Matthias David
;; Author: Matthias David <db@gnu.re>
;; URL: https://github.com/DarkBuffalo/ox-report
;; Version: 0.2
;; Package-Requires: ((emacs "24.4") (org-msg "3.9"))
;; Keywords: org, outlines, report, exporter, meeting, minutes
;;; Commentary:
;;
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;;
;; This is a another exporter for org-mode that translates Org-mode file to
;; beautiful PDF file
;;
;; EXAMPLE ORG FILE HEADER:
;;
;; #+title:Readme ox-notes
;; #+author: Matthias David
;; #+options: toc:nil
;; #+ou:Zoom
;; #+quand: 20/2/2021
;; #+projet: ox-minutes
;; #+absent: C. Robert,T. tartanpion
;; #+present: K. Soulet,I. Payet
;; #+excuse:Sophie Fonsec,Karine Soulet
;; #+logo: logo.png
;;
;;; Code:
(require 'ox)
(require 'cl-lib)
(require 'org-msg)
(defgroup ox-report nil
"Export your org file to minutes report PDF file."
:group 'ox)
(defcustom ox-report-logo nil
"Logo path."
:type 'path
:group 'ox-group)
(setq org-latex-packages-alist
'(("AUTO" "babel" t ("pdflatex"))
("utf8" "inputenc" t ("pdflatex" "xelatex" "lualatex"))
("T1" "fontenc" t ("pdflatex" "xelatex" "lualatex"))))
(add-to-list 'org-latex-classes
'("report" ;;class-name
"\\documentclass[10pt]{article}
\\RequirePackage{iflang}
\\RequirePackage{setspace} %%pour le titre
\\RequirePackage{graphicx} %% gestion des images
\\RequirePackage[dvipsnames,table]{xcolor} %% gestion des couleurs
\\RequirePackage{array} %% gestion améliorée des tableaux
\\RequirePackage{calc} %% syntaxe naturelle pour les calculs
\\RequirePackage{enumitem} %% pour les listes numérotées
\\RequirePackage[footnote]{snotez} %% placer les notes de pied de page sur le coté
\\RequirePackage{microtype,textcase}
%%\\RequirePackage{titlesec}
\\RequirePackage{booktabs}
\\RequirePackage{amsmath, amssymb, amsthm} %% For including math equations, theorems, symbols, etc
\\RequirePackage[toc]{multitoc}
\\RequirePackage[a4paper,left=15mm,
top=15mm,headsep=2\\baselineskip,
textwidth=132mm,marginparsep=8mm,
marginparwidth=40mm,textheight=58\\baselineskip,
headheight=\\baselineskip]{geometry}
\\microtypesetup{protrusion=true,final}
%%----------------------------------------------------------------------------------------
%% HEADERS
%%----------------------------------------------------------------------------------------
\\makeatletter
\\newenvironment{fullpage}
{\\noindent\\begin{minipage}
{\\textwidth+\\marginparwidth+\\marginparsep}\\smallskip}
{\\end{minipage}
%%\\vspace{2mm}
}
%% COLOR %<--------------------------------------------------------->%
\\RequirePackage{xcolor}
%% Contrast colours
\\definecolor{mdgreen}{HTML}{A4C21F}
%% Additional colours
\\definecolor{mdgrey}{HTML}{A19589}
\\colorlet{mdgray}{mdgrey}
\\definecolor{mdlightgrey}{HTML}{D8D0C7}
\\colorlet{mdlightgray}{mdlightgrey}
%% DOC %<----------------------------------------------------------->%
\\ProcessOptions\\relax
%% Command to provide alternative translations
\\newcommand{\\UseLanguage}[3]{
\\IfLanguageName{french}{#1}{}
\\IfLanguageName{english}{#2}{}
\\IfLanguageName{american}{#2}{}
\\IfLanguageName{british}{#2}{}
\\IfLanguageName{german}{#3}{}
}
%% This} separating line is used across several documents,
\\newcommand{\\@separator}{%%
%% To make sure we have spacing on both sides, make an invisible rule, 2X tall
\\rule{0ex}{2ex}%%
%% Place the dashed rule 1X high
\\textcolor{mdgray}{\\rule[1ex]{\\textwidth}{0.25pt}}%%
}
%% LABEL %-------------------------------------------------------%
%% Standard style for labels, small and bold
\\newcommand{\\@labeltext}{\\large\\scshape}
\\newcommand*{\\@approvedlabel}{\\UseLanguage{APPROUVE PAR}{APPROVED BY}{FREIGEGEBEN VON}}
\\newcommand*{\\@approved}{Set with \\texttt{\textbackslash approved\\{\\}}}
\\newcommand*{\\approved}{\\renewcommand*{\\@approved}}
\\newcommand*{\\@authorlabel}{\\UseLanguage{Auteur(s)}{Author(s)}{Author(en)}}
\\newcommand*{\\@Authorlabel}{\\UseLanguage{AUTEUR(S)}{AUTHOR(S)}{AUTHOR(EN)}}
\\newcommand*{\\@checkedlabel}{\\UseLanguage{VERIFIE PAR}{CHECKED BY}{VERIFIZIERT DURCH}}
\\newcommand*{\\@checked}{Set with \\texttt{\textbackslash checked\\{\\}}}
\\newcommand*{\\checked}{\\renewcommand*{\\@checked}}
\\newcommand*{\\@datelabel}{\\UseLanguage{DATE}{DATE}{DATUM}}
\\newcommand*{\\@absentlabel}{\\UseLanguage{ABSENT}{ABSENT}{ABWESEND}}
\\newcommand*{\\@excusedlabel}{\\UseLanguage{EXCUSE}{EXCUSED}{ENTSCHULDIGT}}
\\newcommand*{\\@durationlabel}{\\UseLanguage{DUREE}{DURATION}{DAUER}}
\\newcommand*{\\@duration}{Set with \\texttt{\\textbackslash duration\\{\\}}}
\\newcommand*{\\duration}{\\renewcommand*{\\@duration}}
\\newcommand*{\\@initiatorlabel}{\\UseLanguage{INITIATEUR}{INITIATED BY}{INITIATOR}}
\\newcommand*{\\@initiator}{Set with \\texttt{\\textbackslash initiator\\{\\}}}
\\newcommand*{\\initiator}{\\renewcommand*{\\@initiator}}
\\newcommand*{\\@participantlabel}{\\UseLanguage{PARTICIPANT}{PARTICIPANT}{TEILNEHMER}}
\\newcommand*{\\@participantslabel}{\\UseLanguage{PARTICIPANTS}{PARTICIPANTS}{TEILNEHMER}}
\\newcommand*{\\@preparedlabel}{\\UseLanguage{PREPARE PAR}{PREPARED BY}{VORBEREITET VON}}
\\newcommand*{\\@prepared}{Set with \\texttt{\\textbackslash prepared\\{\\}}}
\\newcommand*{\\prepared}{\\renewcommand*{\\@prepared}}
\\newcommand*{\\@presentlabel}{\\UseLanguage{PRESENT}{PRESENT}{ANWESEND}}
\\newcommand*{\\@projectlabel}{\\UseLanguage{PROJET}{PROJECT}{PROJEKT}}
\\newcommand*{\\@project}{Set with \\texttt{\\textbackslash project\\{\\}}}
\\newcommand*{\\project}{\\renewcommand*{\\@project}}
\\newcommand*{\\@referencelabel}{\\UseLanguage{REFERENCE}{REFERENCE}{REFERENCE}}
\\newcommand*{\\@reportlabel}{\\UseLanguage{Rapport}{Report}{Bericht}}
\\newcommand*{\\@reportnumberlabel}{\\UseLanguage{RAPPORT N°}{REPORT NUMBER}{BERICHT NUMMER}}
\\newcommand*{\\@reportnumber}{Set with \\texttt{\\textbackslash reportnumber\\{\\}}}
\\newcommand*{\\reportnumber}{\\renewcommand*{\\@reportnumber}}
\\newcommand*{\\@wheremeeting}{Set with \\texttt{\\textbackslash wheremeeting\\{\\}}}
\\newcommand*{\\wheremeeting}{\\renewcommand*{\\@wheremeeting}}
\\newcommand*{\\@whenmeeting}{Set with \\texttt{\\textbackslash whenmeeting\\{\\}}}
\\newcommand*{\\whenmeeting}{\\renewcommand*{\\@whenmeeting}}
%% TASKS
\\newcommand*{\\@tasklistlabel}{\\UseLanguage{Liste de tâches}{Task List}{Aufgaben}}
\\newcommand*{\\@tasknumberlabel}{\\#}
\\newcommand*{\\@tasklabel}{\\UseLanguage{TACHE}{TASK}{Aufgabe}}
\\newcommand*{\\@duelabel}{\\UseLanguage{DATE D'ECHEANCE}{DUE DATE}{ERLEDIGUNGSDATUM}}
\\newcommand*{\\@responsiblelabel}{\\UseLanguage{RESPONSABLE}{RESPONSIBLE}{VERANTWORTLICH}}
%% MINUTES %-------------------------------------------------------%
\\ProcessOptions\\relax
\\PassOptionsToPackage{table}{xcolor}
\\renewcommand*{\\@authorlabel}{\\UseLanguage{ECRIT PAR}{WRITTEN BY}{GESCHRIEBEN VON}}
%% Setting up header and footer
\\RequirePackage{fancyhdr,lastpage}
\\pagestyle{fancy}
%% Header
\\fancyhead{}
\\renewcommand{\\headrulewidth}{0pt}
%% Footer
\\renewcommand{\\footrulewidth}{0pt}
\\fancyfoot[c]{%%
\\sffamily%%
\\color{mdgray}
\\@separator\\newline
~~%%
\\begin{minipage}[c]{0.5\\textwidth}
\\hspace*{3pt}\\small{\\textbf{\\@projectlabel}}\\newline
\\hspace*{\\tabcolsep}\\@project
\\end{minipage}%%
\\hfill
\\thepage\\ \\UseLanguage{de}{of}{von} \\pageref{LastPage}
~~\\newline
\\@separator
}
%% The logo box.
\\newcommand{\\@rlogo}{
\\noindent
\\scriptsize
\\raggedleft
\\setlength{\\parskip}{1ex}
\\includegraphics[height=70px,width=70px,keepaspectratio]{\\@mainlogo}
%%\\includegraphics[width=\\textwidth]{\\@mainlogo}
}
\\RequirePackage{xparse}
\\newcommand{\\@participantstable}{}
\\NewDocumentCommand \\participant { O{present} m }{
\\g@addto@macro \\@participantstable {
\\multicolumn{2}{l}{#2}
& \\ifstrequal{#1}{present} {$\\bullet$}{}
& \\ifstrequal{#1}{absent} {$\\bullet$}{}
& \\ifstrequal{#1}{excused} {$\\bullet$}{}\\\\
}
}
\\RequirePackage{tabularx,ltxtable}
\\newcommand{\\@tasktable}{}
\\newcommand{\\tasklist}{%%
\\section*{\\@tasklistlabel}
\\vspace{-\\baselineskip}
\\begin{longtable}{rp{0.55\\textwidth}p{0.2\\textwidth}l}
\\multicolumn{4}{@{}c@{}}{\\@separator}\\\\*
\\@labeltext \\@tasknumberlabel & \\@labeltext \\@tasklabel &
\\@labeltext \\@responsiblelabel & \\@labeltext \\@duelabel\\\\*
\\multicolumn{4}{@{}c@{}}{\\@separator}
\\@tasktable\\\\*
\\end{longtable}
}
\\newcounter{sinteftask}
\\newcommand{\\task}[3]{%%
\\g@addto@macro \\@tasktable {%%
\\\\
\\refstepcounter{sinteftask}\\thesinteftask & #1 & #2 & #3 \\\\*
\\multicolumn{4}{@{}c@{}}{\\@separator}%%
}%%
}
%% Recipient address and information colophon
\\RequirePackage{colortbl,tabularx,rotating}
\\newcommand{\\frontmatter}{%%
\\sffamily%%
\\noindent%%
\\begin{minipage}[b]{0.7\\textwidth}
\\setlength{\\parskip}{2ex}%%
\\huge\\textbf\\@title
%% ~ ensures \\ does not crash when \@wheremeeting is empty
\\Large \\@wheremeeting~\\\\\\@whenmeeting
\\end{minipage}
\\hfill
\\begin{minipage}[b]{0.20\\textwidth}
%% Bring the colophon and address back up a bit
\\vspace*{-25pt}
\\@rlogo
\\end{minipage}
\\vspace{1ex}%%
\\noindent%%
\\@separator\\\\
\\rowcolors{4}{}{mdlightgray}
\\begin{tabularx}{\\textwidth}{XXccc}
\\rowcolor{white}
\\parbox{\\linewidth}{{\\@labeltext \\@initiatorlabel}\\\\\\@initiator}
& \\parbox{\\linewidth}{{\\@labeltext \\@authorlabel}\\\\\\@author}
& \\raisebox{-1cm}{\\begin{sideways}\\parbox{2cm}{\\raggedright\\@labeltext\\@presentlabel}\\end{sideways}}
& \\raisebox{-1cm}{\\begin{sideways}\\parbox{2cm}{\\raggedright\\@labeltext\\@absentlabel}\\end{sideways}}
& \\raisebox{-1cm}{\\begin{sideways}\\parbox{2cm}{\\raggedright\\@labeltext\\@excusedlabel}\\end{sideways}}\\\\
\\rowcolor{white} \\multicolumn{5}{@{}c@{}}{\\@separator}\\\\
\\rowcolor{white} \\@labeltext \\@participantslabel\\\\
\\@participantstable
\\end{tabularx}
\\rowcolors{1}{}{} %% Back to normal
\\@separator\\\\
\\begin{minipage}{0.40\\textwidth}
\\hspace*{3pt}{\\@labeltext\\@projectlabel}\\\\
\\hspace*{\\tabcolsep}\\@project
\\end{minipage}
\\hfill
\\begin{minipage}{0.3\\textwidth}
{\\@labeltext \\@datelabel}\\\\
\\@date
\\end{minipage}
\\begin{minipage}{0.2\\textwidth}
{\\@labeltext \\@durationlabel}\\\\
\\@duration
\\end{minipage}\\\\
\\@separator
\\noindent
}
\\makeatother
" ;;import de la feuille de syle dans texmf
("\\section{%s}" . "\\section*{%s}")
("\\subsection{%s}" . "\\subsection*{%s}")
("\\subsubsection{%s}" . "\\subsubsection*{%s}")
("\\paragraph{%s}" . "\\paragraph*{%s}")
("\\subparagraph{%s}" . "\\subparagraph*{%s}")))
(defun ox-report-export-to (backend &optional async subtreep visible-only
body-only info)
"Export buffer to BACKEND.
See `org-export-as' for the meaning of ASYNC SUBTREEP
VISIBLE-ONLY BODY-ONLY and INFO."
(let* ((fname (buffer-file-name))
(extensions '((html . ".html")
(latex . ".tex")
(ascii . ".txt")
(odt . ".odf")))
(cp (point))
(mm) ;marker to save place
(export-name (concat (file-name-sans-extension fname)
(or (cdr (assoc backend extensions)) ""))))
(org-export-with-buffer-copy
;; Note I use a marker here to make sure we stay in the same place we were.
;; This is more robust than save-excursion I think, since processing moves
;; points around. In theory the marker should move too.
(setq mm (make-marker))
(move-marker mm cp)
(goto-char (marker-position mm))
(set-marker mm nil)
(pcase backend
;; odt is a little bit special, and is missing one argument
('odt (org-open-file (org-odt-export-to-odt async subtreep visible-only
info)
'system))
(_
(org-open-file (org-export-to-file backend export-name
async subtreep visible-only
body-only info)
'system))))))
(defun ox-report-export-to-ascii (&optional async subtreep visible-only
body-only info)
"Export the buffer to ascii and open.
See `ox-report-export-as' for the meaning of ASYNC SUBTREEP
VISIBLE-ONLY BODY-ONLY and INFO."
(ox-report-export-to 'ascii async subtreep visible-only
body-only info))
(org-export-define-derived-backend 'report 'latex
:options-alist
'((:latex-class "LATEX_CLASS" nil "report" t)
(:present "PRESENT" nil nil)
(:absent "ABSENT" nil nil)
(:excuse "EXCUSE" nil nil)
(:secretaire "SECRETAIRE" nil nil t)
(:secretaire "SECRETARY" nil nil t)
(:dure "DURE" nil " ")
(:dure "DURATION" nil " ")
(:ou "OU" nil " ")
(:ou "WHERE" nil " ")
(:quand "QUAND" nil " ")
(:quand "WHEN" nil " ")
(:initiateur "INITIATEUR" nil " ")
(:initiateur "INITIATOR" nil " ")
(:projet "PROJET" nil " ")
(:projet "PROJECT" nil " ")
(:with-toc nil "toc" 1 )
(:latex-hyperref-p nil "texht" org-latex-with-hyperref t)
(:resume "resume" nil nil)
(:logo "LOGO" nil " ")
(:style "STYLE" nil nil))
:translate-alist '((template . ox-report-template))
:menu-entry
'(?R "Export to Report layout"
((?a "to Ascii" ox-report-export-to-ascii)
(?l "As LaTeX file" ox-report-export-to-latex)
(?p "As PDF file" ox-report-export-to-pdf)
(?o "As PDF and Open"
(lambda (a s v b)
(if a (ox-report-export-to-pdf t s v b)
(org-open-file (ox-report-export-to-pdf nil s v b)))))
(?m "As PDF an attach to mail"
(lambda (a s v b)
(if a (ox-report-export-to-pdf t s v b)
(ox-report-pdf-to-mu4e (ox-report-export-to-pdf nil s v b))))))))
(defun ox-report-pdf-to-mu4e (att)
"Export Pdf ATT to mail."
(when (require 'mu4e nil 'noerror)
(mu4e--start))
(compose-mail)
(when att
(if (file-exists-p att)
(org-msg-attach-attach att)
(message "File not found"))))
(defun ox-report-template (contents info)
"INFO are the header data and CONTENTS is the content of the
org file and return complete document string for this export."
(concat
;; Time-stamp.
(and (plist-get info :time-stamp-file)
(format-time-string "%% Créé le %d/%m/%Y %a %H:%M \n"))
;; Document class and packages.
(let* ((class (plist-get info :latex-class))
(class-options (plist-get info :latex-class-options))
(header (nth 1 (assoc class org-latex-classes)))
(document-class-string
(and (stringp header)
(if (not class-options) header
(replace-regexp-in-string
"^[\t]*\\\\documentclass\\(\\(\\[[^]]*\\]\\)?\\)"
class-options header t nil 1)))))
(if (not document-class-string)
(user-error "Unknown LaTeX class `%s'" class)
(org-latex-guess-babel-language
(org-latex-guess-inputenc
(org-element-normalize-string
(org-splice-latex-header
document-class-string
nil ;;org-latex-default-packages-alist ; Defined in org.el.
org-latex-packages-alist nil ; Defined in org.el.
(concat (org-element-normalize-string (plist-get info :latex-header))
(plist-get info :latex-header-extra)))))
info)))
;; Now the core content
(let ((auteur (plist-get info :author))
(titre (plist-get info :title)))
(concat "
"(when (plist-get info :org-latex-with-hyperref)
(format "{%s}" (plist-get info :org-latex-with-hyperref) ))"
\\author{"
(if (plist-get info :secretaire)
(format "%s" (plist-get info :secretaire))
(org-export-data auteur info))
"}
\\title{"(org-export-data titre info)"}
\\wheremeeting{"(when (plist-get info :ou)
(format "%s" (plist-get info :ou) )) "}
\\whenmeeting{"(when (plist-get info :quand)
(format "%s" (plist-get info :quand) )) "}
\\initiator{"(when (plist-get info :initiateur)
(format "%s" (plist-get info :initiateur) )) "}
\\project{"(when (plist-get info :projet)
(format "%s" (plist-get info :projet) )) "}
\\duration{"(when (plist-get info :dure)
(format "%s" (plist-get info :dure) )) "}
\\makeatletter
"(if (file-exists-p (plist-get info :logo))
(format "\\newcommand{\\@mainlogo}{%s}" (plist-get info :logo))
(when ox-report-logo
(format "\\newcommand{\\@mainlogo}{%s}" (expand-file-name ox-report-logo)))) "
\\makeatother
"
(when (plist-get info :present)
(mapconcat (lambda (element)
(format "\\participant[present]{%s}" element))
(split-string (plist-get info :present) ",")
"\n"))
(when (plist-get info :absent)
(mapconcat (lambda (element)
(format "\\participant[absent]{%s}" element))
(split-string (plist-get info :absent) ",")
"\n"))
(when (plist-get info :excuse)
(mapconcat (lambda (element)
(format "\\participant[excused]{%s}" element))
(split-string (plist-get info :excuse) ",")
"\n"))
"
\\begin{document}
\\begin{fullpage}
\\frontmatter
"(when (plist-get info :with-toc)
(concat
(format "\\setcounter{tocdepth}{%d}" (plist-get info :with-toc) )
"\\tableofcontents" ) )"
\\end{fullpage}
\\pagenumbering{arabic}
" contents "
\\singlespacing
\\end{document}
"))))
;;;###autoload
(defun ox-report-export-to-latex
(&optional async subtreep visible-only body-only ext-plist)
"Export current buffer as a Report (tex).
If narrowing is active in the current buffer, only export its
narrowed part.
If a region is active, export that region.
A non-nil optional argument ASYNC means the process should happen
asynchronously. The resulting file should be accessible through
the `org-export-stack' interface.
When optional argument SUBTREEP is non-nil, export the sub-tree
at point, extracting information from the headline properties
first.
When optional argument VISIBLE-ONLY is non-nil, don't export
contents of hidden elements.
When optional argument BODY-ONLY is non-nil, only write contents.
EXT-PLIST, when provided, is a property list with external
parameters overriding Org default settings, but still inferior to
file-local settings.
When optional argument PUB-DIR is set, use it as the publishing
directory.
Return output file's name."
(interactive)
(let ((outfile (org-export-output-file-name ".tex" subtreep)))
(org-export-to-file 'report outfile
async subtreep visible-only body-only ext-plist)))
;;;###autoload
(defun ox-report-export-to-pdf
(&optional async subtreep visible-only body-only ext-plist)
"Export current buffer as a Report (pdf).
If narrowing is active in the current buffer, only export its
narrowed part.
If a region is active, export that region.
A non-nil optional argument ASYNC means the process should happen
asynchronously. The resulting file should be accessible through
the `org-export-stack' interface.
When optional argument SUBTREEP is non-nil, export the sub-tree
at point, extracting information from the headline properties
first.
When optional argument VISIBLE-ONLY is non-nil, don't export
contents of hidden elements.
When optional argument BODY-ONLY is non-nil, only write code
between \"\\begin{letter}\" and \"\\end{letter}\".
EXT-PLIST, when provided, is a property list with external
parameters overriding Org default settings, but still inferior to
file-local settings.
Return PDF file's name."
(interactive)
(let ((file (org-export-output-file-name ".tex" subtreep)))
(org-export-to-file 'report file
async subtreep visible-only body-only ext-plist
(lambda (file) (org-latex-compile file)))))
;;;###autoload
(defun ox-report-export-to-pdf-and-open
(&optional async subtreep visible-only body-only ext-plist)
"Export current buffer as a Report (pdf) and open.
If narrowing is active in the current buffer, only export its
narrowed part.
If a region is active, export that region.
A non-nil optional argument ASYNC means the process should happen
asynchronously. The resulting file should be accessible through
the `org-export-stack' interface.
When optional argument SUBTREEP is non-nil, export the sub-tree
at point, extracting information from the headline properties
first.
When optional argument VISIBLE-ONLY is non-nil, don't export
contents of hidden elements.
When optional argument BODY-ONLY is non-nil, only write code
between \"\\begin{letter}\" and \"\\end{letter}\".
EXT-PLIST, when provided, is a property list with external
parameters overriding Org default settings, but still inferior to
file-local settings.
Return PDF file's name."
(interactive)
(let ((outfile (org-export-output-file-name ".tex" subtreep)))
(org-export-to-file 'report outfile
async subtreep visible-only body-only ext-plist
(lambda (file) (org-latex-compile file)))))
(provide 'ox-report)
;;; ox-report.el ends here