emacs-orgmode
[Top][All Lists]
Advanced

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

Re: included text


From: John Kitchin
Subject: Re: included text
Date: Mon, 4 Nov 2019 07:40:30 -0500

Along the lines of what Eric suggested, you can put inline calls to src-blocks in the text. Here are some ways you could get something like what you describe I think.

* text to be included                                              :noexport:

#+name: block-1
#+BEGIN_SRC python :results value :var a="a" b="b"
return f"<<{a} {b} c>>"
#+END_SRC

#+name: lorem
#+BEGIN_EXAMPLE
Aliquam erat volutpat.  Nunc eleifend leo vitae magna.  In id erat non orci commodo lobortis.  Proin neque massa, cursus ut, gravida ut, lobortis eget, lacus.  Sed diam.  Praesent fermentum tempor tellus.  Nullam tempus.  Mauris ac felis vel velit tristique imperdiet.  Donec at pede.  Etiam vel neque nec dui dignissim bibendum.  Vivamus id enim.  Phasellus neque orci, porta a, aliquet quis, semper a, massa.  Phasellus purus.  Pellentesque tristique imperdiet tortor.  Nam euismod tellus id erat.
#+END_EXAMPLE

#+name: lorem-2
#+BEGIN_EXAMPLE
Pellentesque dapibus suscipit ligula.  
#+END_EXAMPLE


#+name: block-2
#+BEGIN_SRC sh :results output :var content=lorem
echo $content
#+END_SRC


* blog post 1

twinkle star call_block-1() {{{results(=<<a b c>>=)}}}

Later call_block-1(a=1) {{{results(=<<1 b c>>=)}}}

or call_block-1(a=5, b=7) {{{results(=<<5 7 c>>=)}}}


call_block-2(lorem) {{{results(=Aliquam erat volutpat. Nunc eleifend leo vitae magna. In id erat non orci commodo lobortis. Proin neque massa\, cursus ut\, gravida ut\, lobortis eget\, lacus. Sed diam. Praesent fermentum tempor tellus. Nullam tempus. Mauris ac felis vel velit tristique imperdiet. Donec at pede. Etiam vel neque nec dui dignissim bibendum. Vivamus id enim. Phasellus neque orci\, porta a\, aliquet quis\, semper a\, massa. Phasellus purus. Pellentesque tristique imperdiet tortor. Nam euismod tellus id erat.=)}}}

call_block-2(lorem-2) {{{results(=Pellentesque dapibus suscipit ligula.=)}}}





John

-----------------------------------
Professor John Kitchin 
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803


On Mon, Nov 4, 2019 at 3:42 AM Fraga, Eric <address@hidden> wrote:
On Sunday,  3 Nov 2019 at 12:37, Samuel Wales wrote:
> ah, or do you mean you refer the reader to the text by a regular link
> instaed of including?  that's not what i am lokoing for here as these
> are separate posts.

Yes, this is what I meant, in case the adjusted use case were of some
use.  But it would seem that it won't help you in this case.  Therefore,
I would suggest macros for short amounts of text or #+include for larger
text blocks.  Mind you, an alternative could be #+CALL-ing a src block
that generates the text as output?

--
: Professor Eric S Fraga, http://www.homepages.ucl.ac.uk/~ucecesf
: PGP/GPG key: 8F5C 279D 3907 E14A 5C29  570D C891 93D8 FFFC F67D
: Use plain text email when possible: https://useplaintext.email/


reply via email to

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