emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: John Kitchin <jkitchin@andrew.cmu.edu>
To: "Fraga, Eric" <e.fraga@ucl.ac.uk>
Cc: "emacs-orgmode@gnu.org" <emacs-orgmode@gnu.org>
Subject: Re: included text
Date: Mon, 4 Nov 2019 07:40:30 -0500	[thread overview]
Message-ID: <CAJ51ETp==+MYMpT9bojDRX_AEEbYPgp2RXMPkdpBsDUzfzf+UQ@mail.gmail.com> (raw)
In-Reply-To: <xuu6imo0kp7m.fsf@ucl.ac.uk>

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

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
@johnkitchin
http://kitchingroup.cheme.cmu.edu



On Mon, Nov 4, 2019 at 3:42 AM Fraga, Eric <e.fraga@ucl.ac.uk> 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/
>
>

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

  reply	other threads:[~2019-11-04 12:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-02 22:50 included text Samuel Wales
2019-11-03 13:38 ` Fraga, Eric
2019-11-03 19:36   ` Samuel Wales
2019-11-03 19:37     ` Samuel Wales
2019-11-04  8:42       ` Fraga, Eric
2019-11-04 12:40         ` John Kitchin [this message]
2019-11-04 22:16         ` Richard Lawrence
2019-11-05  0:25           ` Samuel Wales

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ51ETp==+MYMpT9bojDRX_AEEbYPgp2RXMPkdpBsDUzfzf+UQ@mail.gmail.com' \
    --to=jkitchin@andrew.cmu.edu \
    --cc=e.fraga@ucl.ac.uk \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).