Re: [O] Something like 'org-clock-in-at-time'?

2011-03-13 Thread Richard Lawrence

John Hendy jw.he...@gmail.com writes:

 Could someone fill me in on your process for clocking in things after
 the fact? I've been trying to get into to clocking, but, especially at
 home, I don't return to my computer in between every different thing.
 Instead, I stop at it when I get a pause and try to fill in what I've
 been doing. So far, this has been something akin to:

 - create a new sub-headline and call it what I was doing
 - C-c C-c to tag it
 - C-c C-x C-i followed by C-c C-x C-o to create a clocked time stamps
 - Manually edit the times
 - C-c C-c to update the count

Not sure if this is entirely relevant here, but I have a similar
problem.  I often find I need to mark recurring tasks as done that I
completed on the previous day or even earlier.  For most tasks, it
doesn't matter when I mark them as done; but if the task uses org-habits, it
means I have to manually edit the timestamp so that it doesn't mess up
the habit log going forward.

If there's a better way to deal with situations like this, I'd love to
hear about it.  If not, I just wanted to point out another use case for
anyone thinking about implementing retroactive timestamp editing
functions.

Thanks!

Richard




Re: [O] Delete in emacs on OS X

2011-03-09 Thread Richard Lawrence
John Hendy jw.he...@gmail.com writes:

 I can't figure out what key combo provides delete. Fn+delete behaves
 like backspace. In my searching, I found reference to C-?, but that
 comes up as unrecognized.

 How do I delete?

Try C-d.  If that doesn't work, look at the help for delete-char (C-h f
delete-char RET), which should tell which key it's bound to.

Best,
Richard




[O] org-map-entries and org-map-continue-from

2011-02-28 Thread Richard Lawrence
Hi all,

Bastien had advised me [1] to use

(setq org-map-continue-from (outline-next-heading))

in a function called by org-map-entries in order to map that function
across just the /children/ of the current entry (i.e., to exclude the
current `parent' entry itself).  This works great, but I have now found
that it has a weird side-effect: it calls the function twice on the last
child.

For a simple example, suppose I write:
#+BEGIN_SRC emacs-lisp
(defun get-export-filenames ()
  (interactive)
  (setq export-files '())
  (progn
(org-map-entries
 (lambda ()
   (setq org-map-continue-from (outline-next-heading))
   (let ((org-trust-scanner-tags t))
 (push (org-entry-get (point) EXPORT_FILE_NAME) export-files)))
 nil 'tree)
(message export-files))) ; errors, but lets me see the list of collected 
values
#+END_SRC

And I call this function from a buffer that looks like:

* Top
point is here when I call get-export-filenames
** One
   :PROPERTIES:
   :EXPORT_FILE_NAME: one
   :END:
** Two
   :PROPERTIES:
   :EXPORT_FILE_NAME: two
   :END:
** Three
   :PROPERTIES:
   :EXPORT_FILE_NAME: three
   :END:
** Four
   :PROPERTIES:
   :EXPORT_FILE_NAME: four
   :END:

Then the list that I get back (the value of export-files) looks like:

(four four three two one)

Whereas I would like it to be just:

(four three two one)

Can anyone see what I need to do to achieve that? [Apart from just using
(cdr export-files), I mean -- I'd like to know the /right/ way.]  I'm
puzzled because outline-next-heading, if called interactively from the
last child, does indeed put point at the end of that child or at the
next (parent-level) heading, so it doesn't seem that the problem is that
it somehow loops back when there is no next child-level entry.

Many thanks if you catch something I've missed!

Best,
Richard

[1] http://article.gmane.org/gmane.emacs.orgmode/37244/


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [O] org-map-entries and org-map-continue-from

2011-02-28 Thread Richard Lawrence
Nick Dokos nicholas.do...@hp.com writes:

 The problem is that org-entry-get does not just look forward: it looks
 *around* and finds the property when point is both at the beginning
 and at the end of the headline Four, so you get four twice.

Ah, so that's the culprit.  Thanks!

 Maybe this?

 #+BEGIN_SRC emacs-lisp
   (defun get-export-filenames ()
 (interactive)
 (setq export-files '())
 (progn
   (org-map-entries
(lambda ()
  (setq org-map-continue-from (outline-next-heading))
  (if org-map-continue-from
  (let ((org-trust-scanner-tags t))
(push (org-entry-get (point) EXPORT_FILE_NAME) 
 export-files
  nil 'tree)
(message export-files))) ; errors, but lets me see the list of 
 collected values
   
 #+END_SRC

Indeed, that does seem to work: outline-next-heading returns nil if it
doesn't find a next heading, and a buffer location otherwise (at least
that's the way it looks based on some tests; the documentation doesn't
say, and I didn't crack open the code).  So wrapping the rest of the
lambda body in (if org-map-continue-from ...) prevents it from executing
that one last time.

Thanks for your help, Nick!

Best,
Richard


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: question about capture templates

2011-02-22 Thread Richard Lawrence
Carsten Dominik carsten.domi...@gmail.com writes:

 I do love dynamic scoping, this give a lot of power in Emacs.
 Org-mode internals use that power often.

This is venturing a bit far afield, at least for this thread, but I'm
curious if anyone knows: does the recent work on supporting Elisp in
Guile mean that Elisp applications are eventually expected to be ported
to Scheme?  And if so, what does that mean for Org development?

 One gotcha: S-expressions in templates are apparently always evaluated
 as function calls -- you can't just directly access a string value, like
 %(foo).

 I guess you mean a variable value?

Right, yes, a variable with a string value.  I guess my point is more
properly stated by saying there doesn't seem to be a way to evaluate an
atomic S-expression in a template.  But this seems like a fair trade for
not having to write a second set of parentheses around every non-atomic
expression.

 The shortest form may be %(symbol-value foo) if you want to access the
 value of a variable in a template.

That's handy -- thanks!

Richard


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: question about capture templates

2011-02-21 Thread Richard Lawrence
Sébastien Vauban wxhgmqzgw...@spammotel.com
writes:

 Filippo A. Salustri wrote:
 I would really like to be able to vary the file into which a captured item
 goes.  Specifically, I'd like to insert the item into whatever file I was
 visiting when I started the capture.

 You have to use backquotes so that expressions are considered as code to
 execute, instead of data. See Emacs manual.

I'm not sure that backquotes will do what the OP wants.  Backquotes will
allow the OP to compute the value of a target file at the time the (setq
org-capture templates ...) form is evaluated.  The OP needs a way to
determine the target file at the time of capture (right?), not at the
time the variable is set.

Unfortunately, I don't have any suggestions on how to hack that.  If the
target of most captures can be determined based on their type, maybe you
can just use the refile mechanism (C-c C-w instead of C-c C-c) to
manually handle the exceptions.  If not, maybe look into wrapping
or replacing org-capture-refile somehow.

Best,
Richard


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: question about capture templates

2011-02-21 Thread Richard Lawrence
Filippo A. Salustri salus...@ryerson.ca writes:

 org-capture clearly has the original buffer handy (for %a
 stuff) yet I can't get it out of there without hacking the org code, which I
 am loathe to do.

I too was in a situation just today where I was calling org-capture
programatically, and needed access to stuff in the calling environment.
My solution (which may not be very good, and may not work for you) is to
dynamically scope the calling environment stuff that I need into the
org-capture call, like so:

#+begin_src emacs-lisp
; in the calling code, I scope some val I need into `foo...'
(let ((foo some-val-I-need))
  (org-capture nil tm))
#+end_src

Then, in the template identified by tm, I have S-expression expansion
that operates on foo, even though it wasn't explicitly passed as a
parameter, e.g.:

* My capture template
  The car of foo is %(car foo).
  The cdr of foo is %(cdr foo).
  %a
  etc. ...

This works well enough for me, though it may feel kind of icky, since
from the template writer's perspective, `foo' looks like a global
variable whose value could be coming from anywhere. Accordingly, then,
this solution is mostly useful if you know that you're going to be using
the template via custom Elisp calls to org-capture, and not via the
usual capture interface, so that you can guarantee that `foo' has a
useful value when the template is expanded.

One gotcha: S-expressions in templates are apparently always evaluated
as function calls -- you can't just directly access a string value, like
%(foo).

Hope that's helpful!

Richard

P.S. Since you say you have Scheme experience: note that this solution
would NOT work in Scheme, since Scheme, unlike Emacs Lisp, is lexically
scoped.


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: ePub and Org mode

2011-02-20 Thread Richard Lawrence
Eric Schulte schulte.e...@gmail.com writes:

 The only thing missing is a function to export all (not excluded)
 subtrees one by one and honor the properties slapped onto each subtree.


 `org-map-entries' should satisfy this need. -- Eric

I have been doing something similar with LaTeX export.  Here is my
(pretty hacky) code; it should be easy to adapt to HTML export.  It
does the following:

1) export each subtree of the current tree as a separate PDF (there's
some validation here, to make sure each of these trees has properties
that I need to produce the output I want)

2) concatenates the resulting PDFs into a single PDF for printing (this
requires the pdftk package)

Good luck!

Richard


(defun org-export-individual-pdfs-and-concat ()
  (interactive)
  (setq export-files nil
pdf-files nil
; point must be in main tree to be exported (not a subtree)
concat-pdf-name (get-property-or-fail (point) CONCATENATED_PDF_NAME))
  (progn
(org-map-entries
 (lambda ()
   (setq org-map-continue-from (outline-next-heading))
   (org-mark-subtree)
   ; org-map-entries positions point at the beginning of each subtree
   (let ((org-trust-scanner-tags t))
 (push (get-property-or-fail (point) EXPORT_FILE_NAME) export-files))
   (org-export-as-pdf nil))
 nil 'tree)
(concat-pdfs (nreverse (mapcar 'tex-name-to-pdf-name export-files))
 concat-pdf-name)))

(defun get-property-or-fail (pom property)
  (or
   ; probably some opportunity for optimization here...see function
   ; documentation for org-map-entries
   (org-entry-get pom property)
   (error (format Entry at %s does not define property %s 
(org-heading-components) property

(defun tex-name-to-pdf-name (filename)
  (concat (file-name-sans-extension filename) .pdf))

(defun concat-pdfs (in-files out-file)
  (shell-command
   (format pdftk %s cat output %s
   (mapconcat (lambda (s) s) in-files  ) ; join pdf names with spaces
   out-file))) 


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Call org-map-entries just on children?

2011-02-08 Thread Richard Lawrence
Hi Bastien,

  How can I apply f just to the *children* of Paper 1?

 You can simply add 

   (setq org-map-continue-from (outline-next-heading))

 at the very beginning of your `f' function.

Ah, very good.  Thanks so much!

Best,
Richard

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Call org-map-entries just on children?

2011-02-07 Thread Richard Lawrence
Hi all,

I'm sure I'm just being thick here, but any help would be appreciated...

I want to call org-map-entries in a way that calls a function at each
*child* of the current tree, but not at the current tree itself.  That
is, for some function f, if my Org file looks like this:

* Paper 1
** Student 1
** Student 2
...

I want to call f at Student 1, Student 2, etc. but not at Paper 1.
But if point is positioned at Paper 1, then

(org-map-entries 'f nil 'tree)

first calls f at the Paper 1 entry, not the Student 1 entry.  How
can I apply f just to the *children* of Paper 1?

(The reason I need to do this is that f needs to enforce that each of
the children has a value for a certain property, but the parent entry
should not have this property.)

Thanks!

Richard


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [OT] Importing plain text attachments into Org

2011-01-23 Thread Richard Lawrence
Dear Orgsters,

I'm hoping I can solicit a little advice about pulling email attachments
into Org (via Gnus), since some of the folks on this list seem to have
experience interacting with Gnus from Org.  I realize that the meat of
my question may be better asked on the Gnus list, but if anyone here has
knowledge and/or a similar setup that you'd be willing to share, I would
very much appreciate hearing about it.

The background: I am about to begin teaching a writing-intensive course.
Students will email me their papers every week.  I have no desire to
download, print, and read a bunch of .doc files by hand every week.
(This is a pain, and requires proprietary software I don't have; and I
find 12pt double-spaced Times New Roman much more difficult to read than
a LaTeX article anyway.)  So I am considering asking my students to
email their papers in plain text.  I would like to then apply some
automated processing on my end that would:

1) Download each student's paper into a file in my teaching directory.

2) Apply some *very* simple transformations, like adding #+TITLE before
their title, replacing Windows `smart quote' characters with ASCII ` and
', and generally making the files play nice with Org on a GNU box.  I
might also like to do things like run a word count at this stage to make
sure they are within the guidelines for the course.

3) Use Org's export abilities to compile each paper into a PDF (or
perhaps a single PDF for the whole week's submissions).

4) [Not necessary, but would be cool:] Automatically insert TODO items
into my agenda for each paper I have to read; automatically grade
students who don't turn in papers on time; etc.

Does anyone have any ideas about how I might go about this, and whether
it's worth the effort to automate it?  (I will have about 100 papers to
read this semester.)  

Thanks so much!

Best,
Richard









___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: How can i share a single org-default-notes-file between multiple instances of emacs?

2010-12-16 Thread Richard Lawrence
Eric Holbrook eric.holbr...@smsc.com writes:

 At work i typically need to have at least 2 emacs running: 1 for the
 project i'm working on at the moment; 1 for notes, email, ~/.bashrc,
 ~/.alias, etc.

 I often have more than 1 project going at a time, so i end up with 3
 or 4 emacs running, sometimes more.

 I'd like to be able to do 'org-capture from any emacs, and have them
 all dump into the same org-default-notes-file, which i have creatively
 named notes.org.

 How can i do this? I thought of possibly setting a defadvice tied to
 notes.org that tells all running emacs to unceremoniously revert that
 buffer before doing anything else to it, and to save it when done with
 it.

I really don't know if this would help you out in your particular
scenario, but have you thought about using the Emacs server[1]?  If, for
example, you start the server from within your home Emacs, but then
visit project files from the command line using emacsclient, those
emacsclient instances will see your notes buffer in its current state,
even if it's unsaved, and changes you make there will be visible in your
home Emacs.

I think the server requires Emacs 23, so if you have that at work, it
might be worth looking into.

Richard

[1]
http://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Export LaTeX file to different directory?

2010-12-13 Thread Richard Lawrence
Hi Joost,

 If I export (part of) an org-mode file to LaTeX, the LaTeX file is created in
 the same directory as the org-mode file. Is there a way to specify the file
 should go somewhere else? Googling and looking through the manual didn't give 
 me
 anything concrete. There is apparently a property EXPORT_FILE_NAME, but 
 setting
 this doesn't seem to have any effect. (Though I may be using it wrong, there
 wasn't any description or example of it in the manual... Plus, I'd like to be
 able to specify just the export directory, not necessarily the file name as 
 well.)

As far as I know (though others may know better) this isn't possible
using per-file configuration with the simple export functions (C-c C-e l
and friends).  It *is* possible through the publishing framework,
though.

When you define a publishing target in org-publish-project-alist, you
can specify both the :base-directory and :publishing-directory options.
For example:

(setq org-publish-project-alist
  '((orgfiles
 :base-directory ~/org
 :publishing-directory ~/tmp
 :publishing-function org-publish-org-to-html
 :base-extension org$)))

See the documentation for Publishing.

This approach, however, requires you to do some Elisp customization, and
it requires you to statically define your source and destination
directories.  You may need something more flexible or configurable on a
per-file (or per-export, even) basis.  The only solution I know of there
is to export to a temporary buffer, then save that buffer in the
location you want -- though of course this requires interaction from
you.

If others know of a middle road between using the publishing framework
and just doing C-c C-e L C-x C-s every time, I would be interested in
hearing about it too.  (If there isn't a middle road, consider this my +1
on adding this feature.)

Best,
Richard


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Export LaTeX file to different directory?

2010-12-13 Thread Richard Lawrence
Jeff Horn jrhorn...@gmail.com writes:

 If you want to publish a single project, one that dumps all the files
 in the tmp directory, it would publish all files in the source
 directory (definitely not what the OP had in mind, I think). If you
 publish only this file, it might work.

Yes, there is a Publish current file option in the export dispatcher,
though I've never used it myself.  Using this option with the right
combination of :base-directory, :publishing-directory, and
:exclude/:include in org-publish-project-alist might do the trick,
depending on the OP's exact scenario.  

Richard


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Another LaTeX export corner case...

2010-12-09 Thread richard . lawrence
Scot Becker writes:

 I use the
 somewhat ugly workaround of just switching to LaTeX \footnote{} commands
 just for those footnotes where I need optional arguments.   But I'd be
 glad
 not to have to mix footnote commands.

Ah, I hadn't thought of that.  Thanks!

Richard




___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Another LaTeX export corner case...

2010-12-07 Thread Richard Lawrence
This evening, I noticed that the footnote syntax breaks if you use LaTeX
commands with an optional argument inside a footnote, e.g.:

* Some headline
Blah blah blah blah[fn:: This enlightened message brought to you by
\cite[p. 100]{SomeBibKey}]

The internal square brackets in the \cite command cause the whole
footnote to be escaped/exported literally (i.e., [fn:: ... appears in
the text of the document).

Is this a bug, or something that I must learn an Org incantation to work
around?

Thanks!
Richard


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Blockquotes in lists?

2010-12-01 Thread Richard Lawrence
Dear Orgsters,

Is it possible to embed blockquotes inside list items, so that (e.g.)
they are indented beyond the enclosing list item in LaTeX exports?

So, for example, the following Org list:

* Some headline
  - list item 1
#+BEGIN_QUOTE
A great thing was said!
#+END_QUOTE
  - list item 2

will export to LaTeX as:

% ...
\begin{itemize}
\item list item 1
\end{itemize}

\begin{quote}
A great thing was said!
\end{quote}

\begin{itemize}
\item list item 2
\end{itemize}
% ...

but what I would like is:

% ...
\begin{itemize}
\item list item 1
  \begin{quote}
  A great thing was said!
  \end{quote}
\item list item 2
\end{itemize}
% ...

Is this possible?  If so, what am I missing something?  If not, should
there be a way to get this behavior?

Thanks!

Best,
Richard


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Blockquotes in lists?

2010-12-01 Thread Richard Lawrence
Hi Nicolas,

 Is it possible to embed blockquotes inside list items, so that
 (e.g.) they are indented beyond the enclosing list item in LaTeX
 exports?

 This is a work in progress. There should be a testing phase related to
 it soon.

Great, thanks!

Richard

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: LaTeX export of lists

2010-11-27 Thread Richard Lawrence
Hi Tom,

 Is there an easy way to keep text following a list with the list, i.e,
 without a blank line following the list, during export?

 * List
   1. First item
   2. Second item
 Following text.

 Gets exported as:

 \section{List}
 \label{sec-1}

 \begin{enumerate}
 \item First item
 \item Second item
 \end{enumerate}

 Following text.

 I don't want a blank line between \end{enumerate} and Following text.

Is this because you don't want to start a new paragraph in LaTeX?  I
have used \noindent on the occasions when I have run into this issue.

* List
  1. First item
  2. Second item
\noindent
Following text

Not necessarily pretty, but it works, if you're just looking to prevent
indentation.  

Best,
Richard


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] [PATCH] Preserve math environments in title when exporting to LaTeX

2010-11-21 Thread Richard Lawrence
Carsten Dominik carsten.domi...@gmail.com writes:

 On Nov 21, 2010, at 9:54 AM, Carsten Dominik wrote:

 Hi Richard,

 I have now applied this patch.  I am not entirely sure it will have
 no adverse effects, so please, people who do export to LaTeX, check
 after the next pull if you see any problems.

 Actually, I think I have just found a better way to solve this issue,
 in a way that will also solve it for figure captions.

 Please, LaTeX export users, test the current git version.

Hi Carsten,

I've just tried the latest version, and it works for me, at least on the
case I was having trouble with before.

Thanks!

Richard

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Umlauts in LaTeX export

2010-11-03 Thread Richard Lawrence
Hi all,

I don't think this is a bug so much as an unfortunate consequence of
expected behavior, but I wanted to document it here for the sake of
future mailing list searches, because I didn't find anything about it
myself.  (If someone has a better solution than the one I propose,
please clue me in!)

To add an umlaut/trema/diaeresis to a letter in LaTeX, I use the \
command, as in:

G\{o}del

Unfortunately, due to the fact that Org export treats both `{}' and `'
specially, this will be exported to LaTeX as:

G\''\{o\}del

It isn't sufficient to surround the \{o} with math mode delimiters, e.g.,

G\(\{o}\)del

even though this will prevent Org from escaping the brackets and
converting the double-quote, because the command doesn't seem to produce
output in math mode.  (The compiled file will read Gdel.)

So, the work-around I've come up with is to use an \mbox inside math
mode, which prevents Org from doing the escapes/conversions:

G\(\mbox{\{o}}\)del

A bit ugly, but it produces the correct output.

Hope that helps someone!  And again, if there's a better way, please let
me know!

Best,
Richard


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Umlauts in LaTeX export

2010-11-03 Thread Richard Lawrence
Thanks to all for your suggestions!

 you could define some shortcut to insert the appropriate Unicode
 character into your text (as your keyboard probably does not feature
 a ö key), or copy/paste the Umlauts from another Emacs file as
 necessary. 

 But there is a nice emacs solution to enter umlauts:
 =C-x RET C-\ german-postfix RET= This enables an input method which
 allows you to enter all german umlauts: ä ü ö Ä Ü Ö and ß.

 Even better, for the OP, is to switch to the tex input method (M-x
 set-input-method RET tex RET)!  In this case, you can type \o to get ö.
 Almost all TeX and LaTeX sequences are understood (e.g. \forall to get
 ∀, \exists for ∃, \alpha for α, \leftrightharpoons for ⇋, and so on.)
 You can see all the characters with =describe-input-method=.

One concern I have with all of these solutions is that, if I use them in
a file that is encoded in ASCII, Emacs will switch the encoding to
Unicode, and that could have unexpected consequences (e.g., with version
control).  But I have also noticed that many of my Org files (though not
the one I originally encountered this problem in) are already encoded in
UTF-8, and I haven't had any Unicode-related problems.  Are these fears
misplaced?

Best,
Richard


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Differences in headline exports [was: Umlauts in LaTeX export]

2010-11-03 Thread Richard Lawrence
Nick Dokos nicholas.do...@hp.com writes:

 Nevertheless that does not absolve org from dealing with \ properly. In
 fact, it deals with it correctly in a heading but not in the text:

 * G\odel

 G\odel

 gives:

 ...
 \section{G\odel}
 \label{sec-1}


 G\''odel


 However, surrounding the o with braces breaks things in both places.

 I think part of the problem is that headings and text go through
 different processing: e.g. text goes through org-export-latex-content,
 whereas headings don't. So fixing a problem like this in one place is
 not enough.

I was recently crawling through the LaTeX export code, because I was
getting different results for how a heading was exported depending on
whether it was simply a section title or whether it was the title for
the whole document. (See: [1]) It was quite a chore for me to understand
the different code paths that a headline can go through.

I still don't fully understand why things are this way; shouldn't all
text that's exported to LaTeX be processed in the same way, regardless
of where it appears (with the exception, of course, of text between
delimiters that mark it as literal LaTeX input)?

I sent a patch [2] that basically dealt with my problem by sending
headlines that become document titles down the same code path that
headlines and content are sent through (namely,
org-export-preprocess-string), but I haven't received any response.  Is
that because there's some important reason to treat these contexts
differently?  Am I missing something?

Best,
Richard

[1] http://article.gmane.org/gmane.emacs.orgmode/32281/
[2] http://article.gmane.org/gmane.emacs.orgmode/32540/


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: General question on dealing with Latex to word conversion

2010-10-27 Thread Richard Lawrence
Jeff Horn jrhorn...@gmail.com writes:

 I'm not trying to be antagonistic, or insensitive to your particular
 situation.  But since no one else has said it, I just wanted to point
 out that it might be easier or more efficient, in terms of overall
 person-hours, to convert from Word to Org, rather than the other way
 around.

 If they're stuck in word and the OP is using org, he may be the only
 person on his team capable of changing his workflow. In that case,
 person hours are saved if he switches and doesn't have to educate
 everyone else (or they educate themselves), though *his* man hours are
 not economized.

Well, doesn't that depend on how long it would take to educate everyone
else, vs. how many hours he will eventually spend doing manual
conversion to Word?

Richard

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: General question on dealing with Latex to word conversion

2010-10-26 Thread Richard Lawrence
Hi Marvin,

 Org mode is now a part of my daily work-flow, not only do I use it for
 teaching, scheduling my time, but I also use it to store my research notes.
 The only snag is several of my collaborators is tied to microsoft word, and
 thus my only work around is to export my notes and draft from Org to plain
 text and then reformat everything in word, which real time sync., especially
 when I have to retype equations in Mathtype.

Hmm.  Given that at least one person in your team must adapt to the
others, might I ask why that person has to be you?  Is there a reason
that your collaborators can't use Org mode and/or LaTeX?  (Or at least
export their work to plain text, so you can incorporate it in your Org
files?)

I'm not trying to be antagonistic, or insensitive to your particular
situation.  But since no one else has said it, I just wanted to point
out that it might be easier or more efficient, in terms of overall
person-hours, to convert from Word to Org, rather than the other way
around.

(I don't know anything about MathType, but it would seem within the
realm of possibility to *automatically* convert a Word document
containing MathType that has been exported as plain text into something
Org and/or LaTeX can understand.  This site, for example, makes it look
like MathType can export to TeX and LaTeX, so maybe that gets you most
of the way there:

http://www.dessci.com/en/products/mathtype/features.htm)

Best,
Richard


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] [PATCH] Preserve math environments in title when exporting to LaTeX

2010-10-25 Thread Richard Lawrence
Hi all,

This patch fixes the issue I originally described here:
http://article.gmane.org/gmane.emacs.orgmode/32281

It preserves math-mode delimiters (e.g. $ and \() in the document
title when exporting to LaTeX.  (That is, it prevents them from being
escaped, by running the title through org-export-preprocess-string,
which marks them with the org-protected property.)  It should work
regardless of whether the title is pulled from a headline, from the text
before the first headline, or from an explicit #+TITLE declaration.

(This is my first time contributing a patch to a Free Software project
-- so please, let me know what you think!)

Best,
Richard

diff --git a/lisp/org-latex.el b/lisp/org-latex.el
index 4fcbbb7..f97436c 100644
--- a/lisp/org-latex.el
+++ b/lisp/org-latex.el
@@ -727,13 +727,33 @@ when PUB-DIR is set, use this as the publishing directory.
 	 (org-current-export-file buffer-file-name)
 	 (title (or (and subtree-p (org-export-get-title-from-subtree))
 		(plist-get opt-plist :title)
-		(and (not
-			  (plist-get opt-plist :skip-before-1st-heading))
-			 (org-export-grab-title-from-buffer))
+		(unless (plist-get opt-plist :skip-before-1st-heading)
+		  (let ((pt (org-export-grab-title-from-buffer)))
+			(remove-text-properties 0 (length pt)
+		'(:org-license-to-kill t) pt)
+			pt))
 		(and buffer-file-name
 			 (file-name-sans-extension
 			  (file-name-nondirectory buffer-file-name)))
 		No Title))
+	 ; Preprocessing preserves math environments in title
+	 (title
+	  (and title (string-match \\S- title)
+	   (org-export-preprocess-string
+		title
+		:emph-multiline t
+		:for-LaTeX t
+		:comments nil
+		:tags (plist-get opt-plist :tags)
+		:priority (plist-get opt-plist :priority)
+		:footnotes (plist-get opt-plist :footnotes)
+		:drawers (plist-get opt-plist :drawers)
+		:timestamps (plist-get opt-plist :timestamps)
+		:todo-keywords (plist-get opt-plist :todo-keywords)
+		:add-text nil
+		:select-tags nil
+		:exclude-tags nil
+		:LaTeX-fragments nil)))
 	 (filename
 	  (and (not to-buffer)
 	   (concat
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: Bug: Re: Latex export: Differing behavior for symbols in headlines

2010-10-24 Thread Richard Lawrence
Richard Lawrence richard.lawre...@berkeley.edu responds to himself:

 2) If so, what's the right way to work around it?  If not, where should
 I look to try and fix it?
 

 I'm still wondering about the latter question here.  This is important
 enough to me that I am willing to take a stab at fixing it, but my Elisp
 experience is basically limited to init file customizations.  Can anyone
 who knows the ins and outs of the LaTeX export code give me a few
 pointers about where to start?

OK, I've been reading the code in org-latex.el for a while now, and I
have at least come to understand why $'s in a headline are escaped when
the export is restricted to a subtree.

The explanation is this: within org-export-as-latex, the headline is
bound to `title', and passed to org-export-latex-make-header, which in
turn passes the value into org-export-latex-content, thusly:

;; org-latex.el, line 1283

 (format
  \n\n\\title{%s}\n
  ;; convert the title
  (org-export-latex-content
   title '(lists tables fixed-width keywords)))

org-export-latex-content works by performing a series of mutations on a
temporary buffer.  One of these mutations,
org-export-latex-special-chars, replaces $ with \$.  So that's
where the replacement is happening when the headline of a subtree is
used as the title for a LaTeX export.

(Actually, this begs the question: how should one export an Org file to
LaTeX if part of the title should be in math mode?  Is escaping $'s in
the document title really the best behavior?  My guess would be that
people need math mode in their document titles far more often than they
need a literal $.)

Here's what I don't understand yet: when the entire Org file is
exported, rather than just a subtree, the headlines (which eventually
become the section titles in the output) are apparently *not* processed
this way, because then the $'s in such headlines pass through unescaped.
I'm not sure if this is because they never pass through
org-export-latex-content, or because $'s have had the org-protected
property set by the time they *do* pass through it.

Guidance would be much appreciated!

Best,
Richard


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Bug: Re: Latex export: Differing behavior for symbols in headlines

2010-10-23 Thread Richard Lawrence

Nick Dokos nicholas.do...@hp.com writes:

 1) Is this difference between whole-document vs. current-subtree export
 the expected behavior?
 
 Looks like a bug to me. I can reproduce it too.

Was my original email enough to constitute a bug report?  

 2) If so, what's the right way to work around it?  If not, where should
 I look to try and fix it?
 

I'm still wondering about the latter question here.  This is important
enough to me that I am willing to take a stab at fixing it, but my Elisp
experience is basically limited to init file customizations.  Can anyone
who knows the ins and outs of the LaTeX export code give me a few
pointers about where to start?

Thanks,
Richard


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Bug: ordered lists after unordered

2010-10-21 Thread Richard Lawrence
Hi Nicolas,

Thanks for getting back to me.

 I think I've found a bug with the way org-meta-return behaves. I
 occasionally need to follow an unordered list by an ordered list,
 without any intervening text. For example:

 * Some heading 
   - unordered
   - unordered
   - unordered

   1) ordered

 I am using Org version 7.01trans.

 This behavior has been fixed in development version of Org mode. You
 may upgrade.

Great!  Pulling from git fixed this issue for me.

 By the way, please note that, by default, you now need to insert two
 blank lines to separate lists (that is unless you set
 `org-empty-line-terminates-plain-lists' to t).

Thanks for the tip!

Best,
Richard

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Latex export: Differing behavior for symbols in headlines

2010-10-21 Thread Richard Lawrence
Dear Orgsters,

I am seeing differing behavior for how special symbols that appear in a
headline are exported to LaTeX, depending on whether I export an entire
Org document or just the current subtree.

I have, for example, a file that looks like this:

* Headline 1
** Headline 2, concerning $\alpha$ and $\beta$

If I export the whole document, the $'s around \alpha and \beta are
properly interpreted as math-mode delimiters, and Headline 2 becomes a
section title that looks exactly as I would expect.

If I export just Headline 2, however, the $'s are escaped, and show up
as literal '$' characters in the title of the exported document.

(I can't remove the $'s, because I am actually using some custom LaTeX
commands, not special symbols like \alpha and \beta that Org would
recognize as needing to be put in math mode.)

So, two questions:

1) Is this difference between whole-document vs. current-subtree export
the expected behavior?

2) If so, what's the right way to work around it?  If not, where should
I look to try and fix it?

(I am running the latest development version of Org.)

Thanks!

Best,
Richard


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Bug: ordered lists after unordered

2010-10-20 Thread Richard Lawrence
Hello all, 

I think I've found a bug with the way org-meta-return behaves. I
occasionally need to follow an unordered list by an ordered list,
without any intervening text.  For example:

* Some heading
  - unordered
  - unordered
  - unordered

  1) ordered

I normally use M-return (org-meta-return) to add a new item to a list.
But in this kind of situation, using M-return to insert the next
ordered list item displays the message Not in an item and modifies the
above lists to look like this:

* Some heading
  1  - unordered
  - unordered
  - unordered

  1) ordered

  1)

And point ends up after the first 1, before the first - in the
unordered list.

(If the ordered and unordered lists are reversed, M-return doesn't act
quite so strangely, though it does convert any items in the unordered
list into ordered list items.  This might be a feature; but it's not the
behavior I personally would prefer.)

I am using Org version 7.01trans.

Thanks!

Best,
Richard Lawrence

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Publishing configuration

2010-10-10 Thread Richard Lawrence
Hi all,

Is there a way to tell org-publish-org-to-html something like:

If you find a link to a file outside the base-directory, copy
that file as an attachment to publishing-directory/attachments

in org-publish-project-alist?

I have PDFs that need to remain distributed throughout the file system
(i.e., not in a single location I can set as a base-directory) but that
I would like to also publish as attachments on my Org-maintained Web site.

I can't find anything in the documentation that gives me a hint about
how to do this, or if there's a better solution that I haven't thought
of.  Any help (included pointers to documentation that I have
thick-headedly missed) would be much appreciated!

Thanks!

Richard


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


<    1   2   3   4