emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [O] trying to write a guidebook for students using org , need help w


From: Glyn Millington
Subject: Re: [O] trying to write a guidebook for students using org , need help with formating
Date: Wed, 23 Oct 2013 23:15:24 +0100
User-agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.3 (gnu/linux)

Xebar Saram <address@hidden> writes:

> Glyn: thx alot for the example. That does work but then i really hate
> manually having to add the '-' at the start of each page and then also
> indenting each line, is there a solution for that?

My problem is that I know a little LaTeX and less lisp!  I would just do
this the hard way.  If I was driven to automate it slightly, then not
being aware of an org-mode solution I would use latex, like this.

1. Make a file, xebar-bullets.tex, which contains this latex snippet

\begin{itemize}
\item Start typing here ....
\item This is the next item you can make these lines as long as you like!!
\item
\item
\item
\item
\item
\item
\item
\item
\item
\item
\item
\item
\item
\item
\end{itemize} 

save it somewhere safe, where you store templates etc

2. Write a function in your .emacs or init.el file like this


(defun xebar-bullets ()
"This inserts the LaTeX \itemize environment into a document - LaTeX will
take care of the wrapping of each item for me"
(interactive)
(insert-file-contents "/home/xebar/templates/xebar-bullets.tex"))

Save this. Evaluate it.


3. Add a key-binding, again in .emacs or init.el, to call this where you
want it.  s-d is the Super key plus d, or pick another - again evaluate
it.

(add-hook 'org-mode-hook
          (lambda ()
            (local-set-key (kbd "s-d") 'xebar-bullets)))

Then when you want to add a list of instructions as in your sample doc,
just hit s-d and start typing at the first item.  You can make the lines
as long as you like, and when you export, LaTeX will deal with 'em!  If
you need more items, just add them in.

I've spelled this out because you said you didn't know about LaTeX -
forgive me if it is more info than you need. 

atb

Glyn





reply via email to

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