emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] shell scripts in yasnippet?


From: John Kitchin
Subject: Re: [O] shell scripts in yasnippet?
Date: Sun, 06 Sep 2015 12:34:31 -0400

This will not work. That is not what yasnippets are for. What you want
is more like this:

http://kitchingroup.cheme.cmu.edu/blog/2013/10/14/Lisp-links-in-org-mode-to-dynamically-generated-content/

Or this:
* test fortune


#+BEGIN_SRC emacs-lisp :exports results :results org
(format "#+BEGIN_QUOTE:
%s
,#+END_QUOTE
" (shell-command-to-string "fortune"))
#+END_SRC

#+BEGIN_SRC emacs-lisp :exports none
(let ((org-export-babel-evaluate t))
  (browse-url (org-html-export-to-html nil t)))
#+END_SRC



Tobias Frischholz writes:

> On 05 Sep 2015, at 00:19, John Kitchin <address@hidden> wrote:
>>
>> That code worked verbatim for me running it from the src block. You may not 
>> need the escaped quotes the way you are doing it.
>
> I tried to adopt it this way:
>
> #+TITLE: Wochenplan KW37
> #+AUTHOR: Tobias Frischholz
> #+OPTIONS: toc:nil
> #+LATEX_CLASS_OPTIONS: [a4paper]
> #+LATEX_HEADER: \usepackage[german]{isodate}
>
> #+BEGIN_SRC emacs-lisp
> #+BEGIN_QUOTE:
> ${1:`(shell-command-to-string "fortune")`}
> #+END_QUOTE
> #+END_SRC
>
> * Stundenplan
>
>   |----------------+--------------+-----------+------------+---------|
>   | Montag         | Dienstag     | Mittwoch  | Donnerstag | Freitag |
>   |----------------+--------------+-----------+------------+---------|
>   | Englisch 8dM   | Englisch 9dM | Mathe 9dM |            |         |
>   | Mathematik 9dM | Englisch 9dM |           |            |         |
>   |                | Englisch 9eM | Mathe 9eM |            |         |
>   | AWT 9dM        |              |           |            |         |
>   | AWT 9dM        | Sport 9abc   |           |            |         |
>   |                | Sport 9abc   |           |            |         |
>   |----------------+--------------+-----------+------------+---------|
>
> * Wochenplan
>
> ** Montag
> *** Englisch 8dM [3/3]
>     /Es fehlen: Hans, Sepp, Franzi/
> - [X] Wiederholung present progressive
> - [X] Buch, S. 17
> - [X] HA: Buch, S. 17/1-5
> Mit Schülern vereinbart, dass Nr. 5 wegfallen kann.
>
> *** Mathematik 9dM [0/3]
> - [ ] Pythagoras wiederholen
> - [ ] Üben, S. 12/4-5
> - [ ] HA, S. 13/6a,b
>
> ** Dienstag
> ** Mittwoch
> ** Donnerstag
> ** Freitag
>
> However nothing seems to get executed when I export to LaTeX PDF.
>
>
> Tobi

--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]