emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Src blocks laid out side-by-side
@ 2020-02-07 22:59 Steve Downey
  2020-02-08 10:13 ` Fraga, Eric
  0 siblings, 1 reply; 4+ messages in thread
From: Steve Downey @ 2020-02-07 22:59 UTC (permalink / raw)
  To: org mode

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

I have a need to lay out source blocks side by side, in order to present
before and after changes to the source. If I could embed a block in a
table, that would do it.

Is there another obvious way that I'm missing?

Hilight etc is important, but also actually compiling the code to maintain
correctness.

https://isocpp.org/files/papers/D1988R1.html

Has an example at the top. That's done with pandoc markdown with a bunch of
post processing. I'd like to go back to org.

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

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

* Re: Src blocks laid out side-by-side
  2020-02-07 22:59 Src blocks laid out side-by-side Steve Downey
@ 2020-02-08 10:13 ` Fraga, Eric
  2020-02-08 18:14   ` Berry, Charles via General discussions about Org-mode.
  2020-02-08 19:02   ` Steve Downey
  0 siblings, 2 replies; 4+ messages in thread
From: Fraga, Eric @ 2020-02-08 10:13 UTC (permalink / raw)
  To: Steve Downey; +Cc: org mode

On Friday,  7 Feb 2020 at 17:59, Steve Downey wrote:
> I have a need to lay out source blocks side by side, in order to present
> before and after changes to the source. If I could embed a block in a
> table, that would do it.

Do you need this layout in org file itself or only in an exported
document from the org file?

For the latter, you can use inline directives to achieve this.  E.g. if
you were exporting to PDF via LaTeX, you could start/end minipages
around each src block.

-- 
: Eric S Fraga via Emacs 28.0.50, Org release_9.3.2-233-gc2bc48

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

* Re: Src blocks laid out side-by-side
  2020-02-08 10:13 ` Fraga, Eric
@ 2020-02-08 18:14   ` Berry, Charles via General discussions about Org-mode.
  2020-02-08 19:02   ` Steve Downey
  1 sibling, 0 replies; 4+ messages in thread
From: Berry, Charles via General discussions about Org-mode. @ 2020-02-08 18:14 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: org mode, Steve Downey



> On Feb 8, 2020, at 2:13 AM, Fraga, Eric <e.fraga@ucl.ac.uk> wrote:
> 
> On Friday,  7 Feb 2020 at 17:59, Steve Downey wrote:
>> I have a need to lay out source blocks side by side, in order to present
>> before and after changes to the source. If I could embed a block in a
>> table, that would do it.
> 
> Do you need this layout in org file itself or only in an exported
> document from the org file?
> 
> For the latter, you can use inline directives to achieve this.  E.g. if
> you were exporting to PDF via LaTeX, you could start/end minipages
> around each src block.
> 


Right. And the side-by-side issue for markdown is handled with inline html like this:

https://stackoverflow.com/questions/43232279/how-can-one-display-tables-side-by-side-in-github-markdown

The trick is that 'md snippets fall back to html. So @@html: <table> @@ etc are needed.

HTH,

Chuck 

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

* Re: Src blocks laid out side-by-side
  2020-02-08 10:13 ` Fraga, Eric
  2020-02-08 18:14   ` Berry, Charles via General discussions about Org-mode.
@ 2020-02-08 19:02   ` Steve Downey
  1 sibling, 0 replies; 4+ messages in thread
From: Steve Downey @ 2020-02-08 19:02 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: org mode

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

Only needs to be in the exported document, and doesn't necessarily need to
render that way within org. However, I'd like to avoid having to choose the
export form with custom markup in the org document. I often have documents,
or parts of docs, that are exported to both HTML and latex.

The equivalent that I'm doing in markdown are custom fenced blocks that
pandoc post-processes.

I suppose I could write some markup that on export gets processed to the
appropriate html or latex.

On Sat, Feb 8, 2020, 05:13 Fraga, Eric <e.fraga@ucl.ac.uk> wrote:

> On Friday,  7 Feb 2020 at 17:59, Steve Downey wrote:
> > I have a need to lay out source blocks side by side, in order to present
> > before and after changes to the source. If I could embed a block in a
> > table, that would do it.
>
> Do you need this layout in org file itself or only in an exported
> document from the org file?
>
> For the latter, you can use inline directives to achieve this.  E.g. if
> you were exporting to PDF via LaTeX, you could start/end minipages
> around each src block.
>
> --
> : Eric S Fraga via Emacs 28.0.50, Org release_9.3.2-233-gc2bc48
>

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

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

end of thread, other threads:[~2020-02-08 19:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-07 22:59 Src blocks laid out side-by-side Steve Downey
2020-02-08 10:13 ` Fraga, Eric
2020-02-08 18:14   ` Berry, Charles via General discussions about Org-mode.
2020-02-08 19:02   ` Steve Downey

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