Eric S Fraga <esfli...@gmail.com> writes:

> On Wednesday, 28 Feb 2018 at 09:56, Sharon Kimble wrote:
>> I have this as a recipe -
>
> [...]
>
>> How can I have the ingredients in a left-most column and the method in a
>> right-most column please? So that everything below the index entries is
>> in 2-column mode which ends after the citation. And it can then be
>> renewed below the next index entries of the next entry, ad infinitum.
>>
>> This is for an org-mode document that is exported to latex and built
>> into a pdf file.
>
> You could use special blocks (section 12.10.10 of org manual).  See
> attached example for your recipe.  Does require LaTeX magic...

This is what Eric has suggested -

--8<---------------cut here---------------start------------->8---
* Recipes
#+begin_export latex
\definecolor{verypaleblue}{rgb}{0.95,0.95,1}
\makeatletter\newenvironment{ingredients}{\begin{lrbox}{\@tempboxa}\begin{minipage}{0.3\textwidth}}{\end{minipage}\end{lrbox}\colorbox{verypaleblue}{\usebox{\@tempboxa}}}\makeatother
\makeatletter\newenvironment{steps}{\begin{lrbox}{\@tempboxa}\begin{minipage}{0.6\textwidth}\centering}{\end{minipage}\end{lrbox}\usebox{\@tempboxa}}\makeatother
#+end_export

** Date Bread
#+begin_ingredients
/12 ounces stoned dates/\\
/1 teaspoonful bicarbonate of soda/\\
/1 cupful boiling water/\\
/4 ounces margarine/\\
/1 egg/\\
/2 cups flour/\\
/$\frac{1}{2}$ cup sugar/\\
/pinch of salt/
#+end_ingredients
#+begin_steps
- Cut dates into pieces, shake soda over the dates, and pour water over.
- Add margarine cut into small pieces and stir well.
- Break egg into mixture, then add sugar and flour.
- Divide into two loaf tins and bake 90 minutes in moderate oven, Regulo 4.
#+end_steps
--8<---------------cut here---------------end--------------->8---

And to use these two blocks I've written 2 new snippets -

--8<---------------cut here---------------start------------->8---
# -*- mode: snippet -*-
# name: 2 column, part 1, recipes
# key: xin
# --
#+begin_ingredients
$0
#+end_ingredients
--8<---------------cut here---------------end--------------->8---

and -

--8<---------------cut here---------------start------------->8---
# -*- mode: snippet -*-
# name: 2 column, part 2, recipes
# key: xst
# --
#+begin_steps
$0
#+end_steps
--8<---------------cut here---------------end--------------->8---

And its now all working very well, and greatly enhances the look of the
printed page.

Thanks very much Eric, its working perfectly.

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
DrugFacts = https://www.drugfacts.org.uk  
Debian 9.3, fluxbox 1.3.7, emacs 25.3.2, org-mode 9.1.6-10-g0c9329-elpaplus

Attachment: signature.asc
Description: PGP signature

Reply via email to