[O] How to set html-postamble per file?

2013-03-11 Thread Jos'h Fuller
Hi!

In one of my *.org files, I want to change the org-export-html-postamble-format.

Is there any way to set this in the file, like with the #+OPTIONS stuff? 
The :PROPERTIES: drawer doesn't seem to work for this.

Based on a web search, I also tried this:

* COMMENT Local variables

# Local Variables:
# html-postamble: 
# End:

I tried variants like org-export-html-postamble, and nil and html strings, 
but all to no avail.

Adding #postamble { display: none; } seems to solve it the wrong way. Is 
there any way to 
override per file?

Thanks very much!

Jos'h

___

Jos'h Fuller, Production Programmer

Arc Productions Ltd. 

p: 416.682.5237  | f: 416.682.5209 | http://www.arcproductions.com 
230 Richmond Street East | Toronto, ON M5A 1P4 |





[O] How to escape backslashes from TeX when exporting to pdf?

2013-02-21 Thread Jos'h Fuller
Hi!

I have a section in a document where I have to specify some DOS file paths 
(yes, I /know/...).

Unfortunately, I have other stuff in the document that uses these options:

#+OPTIONS:   H:3 num:t toc:nil \n:nil @:t ::t |:t ^:nil -:t f:t *:t TeX:t 
LaTeX:nil skip:t d:nil tags:not-in-toc

Is there any way I can escape the backslashes so they will show up correctly 
in the final pdf? I tried the standard trick of doubling the backslashes, and
that worked about as well as you might expect...

Sample text:

 Global Paths
 Paths are specified using a
 *Paths* object. Affected fields *shall* accept the
 specification of either a single path
 (e.g. @N:\bacon\cheeseburger\no\tomato@) or a semicolon separated
 search path specification
 (e.g. @N:\bacon\cheeseburger\no\tomato;N:\chicken\sandwich\@).

___

Jos'h Fuller, Production Programmer

Arc Productions Ltd. 

p: 416.682.5237  | f: 416.682.5209 | http://www.arcproductions.com 
230 Richmond Street East | Toronto, ON M5A 1P4 |





[O] How to escape backslashes from TeX when exporting to pdf?

2013-02-21 Thread Jos'h Fuller
OK, I feel very silly... Blame it on switching back and forth from org-mode to 
textile.

The \textbackslash escape works reasonably well in plain text. However, if I had
used the appropriate ~ instead of @ to highlight the paths, it would have 
exported
correctly.

So, I needed to change this:

 (e.g. @N:\bacon\cheeseburger\no\tomato@) or a semicolon separated

to this:

 (e.g. ~N:\bacon\cheeseburger\no\tomato~) or a semicolon separated

And everything works well.

Thanks!
___

Jos'h Fuller, Production Programmer

Arc Productions Ltd. 

p: 416.682.5237  | f: 416.682.5209 | http://www.arcproductions.com 
230 Richmond Street East | Toronto, ON M5A 1P4 |





[O] Arbitrary colouration of words/sentences etc. in HTML export?

2012-08-21 Thread Jos'h Fuller
Hi!

Is there any good quick and /simple/ way to drop an arbitrary colour on a 
sequence of characters that will show up in the exported HTML page?

I have introduced a colleague to org-mode for generating documentation, however 
they want to use multiple colours to highlight different terms. Adding a CSS 
style rule for *bold* is OK, but it would be nice to do other colours without 
rendering the other common styles (/i/, _underscore_, etc.) useless. Something 
like:

#+HTML: span class=greenish
Greenword
#+HTML: /span

or even this:

@span style=color: green Greenword @/span

is far too clumsy. Especially since they're using it partly so they don't have 
to deal with HTML.

Any better way to do this?

Thanks very much!

___

Jos'h Fuller, Production Programmer

Arc Productions Ltd. 

p: 416.682.5237  | f: 416.682.5209 | http://www.arcproductions.com 
230 Richmond Street East | Toronto, ON M5A 1P4 |




Re: [O] Arbitrary colouration of words/sentences etc. in HTML export?

2012-08-21 Thread Jos'h Fuller
Perfect! Thanks /very/ much!

___

Jos'h Fuller, Production Programmer

Arc Productions Ltd. 

p: 416.682.5237  | f: 416.682.5209 | http://www.arcproductions.com 
230 Richmond Street East | Toronto, ON M5A 1P4 |


 -Original Message-
 From: Eric Schulte [mailto:eric.schu...@gmx.com]
 Sent: Tuesday, August 21, 2012 12:06 PM
 To: Jos'h Fuller
 Cc: emacs-orgmode@gnu.org
 Subject: Re: [O] Arbitrary colouration of words/sentences etc. in HTML
 export?
 
 Jos'h Fuller Jos'h.ful...@arcproductions.com writes:
 
  Hi!
 
  Is there any good quick and /simple/ way to drop an arbitrary colour
 on a sequence of characters that will show up in the exported HTML
 page?
 
  I have introduced a colleague to org-mode for generating
  documentation, however they want to use multiple colours to highlight
  different terms. Adding a CSS style rule for *bold* is OK, but it
  would be nice to do other colours without rendering the other common
  styles (/i/, _underscore_, etc.) useless. Something like:
 
  #+HTML: span class=greenish
  Greenword
  #+HTML: /span
 
  or even this:
 
  @span style=color: green Greenword @/span
 
  is far too clumsy. Especially since they're using it partly so they
 don't have to deal with HTML.
 
  Any better way to do this?
 
 
 Hi Jos'h,
 
 Add the following to your Emacs config,
 
 ;; -*- emacs-lisp -*-
 (org-add-link-type
  color
  (lambda (path)
(message (concat color 
 (progn (add-text-properties
 0 (length path)
 (list 'face `((t (:foreground ,path
 path) path
  (lambda (path desc format)
(cond
 ((eq format 'html)
  (format span style=\color:%s;\%s/span path desc))
 ((eq format 'latex)
  (format {\\color{%s}%s} path desc)
 
 and then you can use [[color:red][in red]] for colored export.
 
 Best,
 
 --
 Eric Schulte
 http://cs.unm.edu/~eschulte



Re: [O] Mail composed using emacs --- saving a copy in an org file.

2012-03-15 Thread Jos'h Fuller
Hi!


You could try doing something with org-capture and the org-capture-templates so 
that you would be creating your email from the start as an org tree entry under 
the appropriate location. You can override the org-capture-before-finalize hook 
(see org-capture.el) to send the mail when you're done typing in the indirect 
buffer and hit C-c C-c (or org-capture-finalize).

I have org-capture set up so I can use it immediately from anywhere in Emacs 
with the C-cc keys:

   (define-key global-map \C-cc 'org-capture) 

That combined with a suitable template and the hook override might give you 
what you're looking for.

Hope this helps!

Jos'h Fuller, Production Programmer
p: 416.682.5200 x5395 | f: 416.682.5209 | Arc Productions Ltd. | 230 Richmond 
Street East | Toronto, ON M5A 1P4 | www.arcproductions.com 
 


 -Original Message-
 From: emacs-orgmode-bounces+jos'h.fuller=arcproductions@gnu.org
 [mailto:emacs-orgmode-bounces+jos'h.fuller=arcproductions@gnu.org]
 On Behalf Of Alan E. Davis
 Sent: Thursday, March 15, 2012 1:24 PM
 To: org-mode
 Subject: [O] Mail composed using emacs --- saving a copy in an org
 file.
 
 I am partial to just opening a mail buffer and writing email in Emacs.
 Just that.  However, it would be great to save a copy in an org file.
 
 An emacs FAQ suggests sending a BCC or FCC to oneself.  What I want is
 a copy stored in an org-mode subtree, with a convenient headline
 indicating the name of the recipient and the date.
 
 So far, I haven't gotten my head around the idea of using BABEL, and I
 still like text for email. My experiments with GNUS have not been
 very successful.  So far.
 
 I apologize for the naive level of this and some of my other questions.
 Though I may not be getting the maximum usefulness of all of org-mode's
 features, those features I do use are awesome.   Thank you.
 
 Alan Davis




[O] Sending and archiving emails with capture...

2012-03-15 Thread Jos'h Fuller

Hi!

Assuming I've got everything set up correctly and this email makes it
to the list, this is in response to Alan E. Davis' question about
sending an email from Emacs and saving a copy in org-mode.

I make the assumption here that your Emacs is set up to properly send
emails using the ~mail~ command. Also note that my
~org-capture-templates~ setup has more than just an email template.

Install the lines below just after your org-mode install.

To use:

  - Invoke org-capture from any buffer with C-cc.
  - Choose the Mail template ([m] key).
  - Enter the recipient's address, then [enter].
  - Enter the mail subject, then [enter].
  - Your cursor is positioned at the start of the email.
  - Write your email.
  - C-c C-c sends it on its way!

This is very crude and could certainly be improved. However, perhaps
it's a reasonable starting point!

Jos'h


-- snip! 

;; Capture Setup

(setq org-capture-templates
  (quote
   ((m Mail entry (file+olp org-default-notes-file Emails) ** Email 
%T
From: Your Name yourn...@yourcompany.com
To: %^{Send mail to}
Subject: %^{Subject}
--text follows this line--
%?

___

This is a signature...)
(t todo entry (file org-default-notes-file)
 * TODO %?\n%U\n%a\n  %i :clock-in t :clock-resume t)
(n note entry (file org-default-notes-file)
 * %? :NOTE:\n%U\n%a\n  %i :clock-in t :clock-resume t)
(h Habit entry (file org-default-notes-file)
 * NEXT %?\n%U\n%a\nSCHEDULED: %t .+1d/3d\n:PROPERTIES:\n:STYLE: 
habit\n:REPEAT_TO_STATE: NEXT\n:END:\n  %i

(defun my-finalize-capture ()
  This is run from the org-capture-before-finalize hook just
before the indirect buffer is closed. 

If the current local capture is a 'Mail' message, I extract it
and send it on it's way. Because I am cautious, I extract the
text from the org buffer and put it into a private temporary
buffer before sending it as an email. 

This may not be the best way to do this...

  (message * Running custom finalize hook...)
  
  (if (string= Mail (org-capture-get :description)) 
  (save-excursion 
(goto-char (org-capture-get :begin-marker t))
(next-line) ; Skip past org slug line.
(let* ((msg (buffer-substring (point) (org-capture-get :end-marker t
  (with-temp-buffer
(insert msg)
(mail-send)
))
))
)

(add-hook 'org-capture-before-finalize-hook 'my-finalize-capture)

(define-key global-map \C-cc 'org-capture)

___

Jos'h Fuller, Production Programmer

Arc Productions Ltd. 

p: 416.682.5237  | f: 416.682.5209 | http://www.arcproductions.com 
230 Richmond Street East | Toronto, ON M5A 1P4 |



Re: [O] Sending and archiving emails with capture...

2012-03-15 Thread Jos'h Fuller
Hi!

 I tried it and I get Heading not found on level 1: Emails

Sorry, I forgot to say that you need to make a heading in your 
org-default-notes-file (whatever that is) called Emails:

 * Tasks
 * Done
 * Emails

The emails will be filed under there, like this:

:* Emails
:** Email 2012-03-15 Thu 15:20
:
:From: Me m...@me.com
:To: y...@you.com
:Subject: Testing!
:--text follows this line--
:This is a test...
:
:
___
:
:Signature!

See if that fixes it!

Jos'h Fuller, Production Programmer
p: 416.682.5200 x5395 | f: 416.682.5209 | Arc Productions Ltd. | 230 Richmond 
Street East | Toronto, ON M5A 1P4 | www.arcproductions.com 





Re: [O] extra whitespace on first page of LaTeX PDF

2012-03-14 Thread Jos'h Fuller
Hi!

 I wanted a page break after the Table of Contents so I modified my org-
 export-latex-classes and added:

Have you tried using \newpage instead of \clearpage?

When I want a page break after the TOC, I'll usually just drop a \newpage in 
just before the first heading like this:

#+ORG_EXPORT_SETTINGS...
\newpage
* First Heading
** A Subhead

This seems to work satisfactorily. My understanding is that \newpage is what 
you use for regular pagebreaks, while \clearpage is for ending a chapter 
because it flushes out floating elements. This discussion on 
tex.stackexchange.com /may/ be helpful:


http://tex.stackexchange.com/questions/45609/is-it-wrong-to-use-clearpage-instead-of-newpage

Hope this helps!

(Disclaimer: This advice is worth what you paid for it... ; - )

Jos'h 



[O] Tangling without clutter?

2012-03-14 Thread Jos'h Fuller
Hi!

I was writing some documentation about how to use a Python function, so I 
decided to try the tangling feature. However, the result, when exported to PDF, 
is unsatisfactory because the referenced code block is included twice -- first 
in the original location, then again where I referenced it with 
function-definition. 

This is, of course, exactly what it needs to do to be able to execute the code 
properly and show the result. But it doesn't look nice. Is there any way to 
suppress the second printing inside the function-demo block?
 
If this isn't clear from the example below, I can provide examples of the 
duplication in action as well as what I'd like the output to look like.

Thanks very much!

Example file:
#+TITLE: Tangle Test
#+LANGUAGE:  en
#+OPTIONS:   H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:nil -:t f:t *:t :t
#+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc

* Tangled Code
  I want to show the definition of a function first:
  #+name: function-definition
  #+begin_src python :tangle yes :exports code
def entable(data):
if not data: return /No data./

columns = len(data[0])
sizes   = [0,]*columns
for row in data:
sizes = [max(x) for x in zip(sizes, [len(str(t)) for t in row])]

format = |  +  | .join([%%%ds % x for x in sizes])+ |
return \n.join([format % tuple(row) for row in data])
  #+end_src

  Now I want to show a demonstration of how the function might be
  called. I need the function to be included so that demonstration
  code can be executed, but I don't want to include the function
  definition twice:

  #+name: function-demo
  #+begin_src python :tangle yes :exports both :noweb yes :results output
function-definition

print entable([[One, 2, 3],[Four, 5, 6], [Seven, 8, 9]])
  #+end_src

  Which gives us this result:

  #+results: function-demo
  : |   One | 2 | 3 |
  : |  Four | 5 | 6 |
  : | Seven | 8 | 9 |



Re: [O] Tangling without clutter?

2012-03-14 Thread Jos'h Fuller
Hi!

 Does the :no-expand header argument do what you want?  See
 http://orgmode.org/manual/no_002dexpand.html#no_002dexpand.

I tried using it like this:

  #+name: function-demo
  #+begin_src python :exports both :noweb yes :results output :no-expand
function-definition

print entable([[One, 2, 59],[Four, 5, 27], [Seven, 8, 9]])
  #+end_src

But it didn't seem to affect the results at all. I may be using it wrong, the 
documentation is a bit sparse, without any examples...

It seems like I almost need some variant of the tangle argument to :noweb 
where syntax references are expanded for evaluation, but not for anything else. 

Thanks for taking a look!

Jos'h


 -Original Message-
 From: Thomas S. Dye [mailto:t...@tsdye.com]
 Sent: Wednesday, March 14, 2012 2:23 PM
 To: Jos'h Fuller
 Cc: emacs-orgmode@gnu.org
 Subject: Re: Tangling without clutter?
 
 Jos'h Fuller Jos'h.ful...@arcproductions.com writes:
 
  Hi!
 
  I was writing some documentation about how to use a Python function,
 so I decided to try the tangling feature. However, the result, when
 exported to PDF, is unsatisfactory because the referenced code block is
 included twice -- first in the original location, then again where I
 referenced it with function-definition.
 
  This is, of course, exactly what it needs to do to be able to execute
 the code properly and show the result. But it doesn't look nice. Is
 there any way to suppress the second printing inside the function-demo
 block?
 
  If this isn't clear from the example below, I can provide examples of
 the duplication in action as well as what I'd like the output to look
 like.
 
  Thanks very much!
 
  Example file:
  #+TITLE: Tangle Test
  #+LANGUAGE:  en
  #+OPTIONS:   H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:nil -:t f:t *:t
 :t
  #+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-
 toc
 
  * Tangled Code
I want to show the definition of a function first:
#+name: function-definition
#+begin_src python :tangle yes :exports code
  def entable(data):
  if not data: return /No data./
 
  columns = len(data[0])
  sizes   = [0,]*columns
  for row in data:
  sizes = [max(x) for x in zip(sizes, [len(str(t)) for t in
 row])]
 
  format = |  +  | .join([%%%ds % x for x in sizes])+ |
  return \n.join([format % tuple(row) for row in data])
#+end_src
 
Now I want to show a demonstration of how the function might be
called. I need the function to be included so that demonstration
code can be executed, but I don't want to include the function
definition twice:
 
#+name: function-demo
#+begin_src python :tangle yes :exports both :noweb yes :results
 output
  function-definition
 
  print entable([[One, 2, 3],[Four, 5, 6], [Seven, 8, 9]])
#+end_src
 
Which gives us this result:
 
#+results: function-demo
: |   One | 2 | 3 |
: |  Four | 5 | 6 |
: | Seven | 8 | 9 |
 
 
 Aloha!
 
 Does the :no-expand header argument do what you want?  See
 http://orgmode.org/manual/no_002dexpand.html#no_002dexpand.
 
 hth,
 Tom
 --
 Thomas S. Dye
 http://www.tsdye.com



Re: [O] Tangling without clutter?

2012-03-14 Thread Jos'h Fuller
Hi!

  It seems like I almost need some variant of the tangle argument to
  :noweb where syntax references are expanded for evaluation, but not
  for anything else.
 
 
 Why would you want to tangle out a python src file with an un-expanded
 noweb reference?  Either way, who am I to judge.  I've just added a new
 eval option to the noweb header argument which will expand noweb
 references *only* during interactive evaluation.

Please allow me to explain, I think it's a legitimate use case...

I would like to provide a listing of a Python function, then later in the 
document show a demonstration of how it's used. I just did this when preparing 
some documentation for another programmer who is porting an application between 
languages. 

So I listed the function, then after a discussion, I had a demonstration of how 
to use the function. I wanted the output from the demonstration to be live, 
generated from the demonstration code. Therefore, I needed to reference the 
function defined above. Unfortunately, the reference was expanded during export 
so that the same block of code appeared /twice/, presenting the reader with 
something like this:

: Here's a function:
:  def gorking():
:   return gork
:
: Here's how to use the function:
:  def gorking():
:   return gork
:
:  print gorking()
: 
: Which gives us:
:  gork

As you can see, it's rather clumsy to have the function in the output twice. 
It's not too bad for this example, but anything more than a few lines becomes 
quite a distraction! This would have been preferable:

: Here's a function:
:  def gorking():
:   return gork
:
: Here's how to use the function:
:  function-gorking
: 
:  print gorking()
: 
: Which gives us:
:  gork

The original %.org file would look like this:

: Here's a function:
:  #+name: function-gorking
:  #+begin_src python :tangle yes
:  def gorking():
:   return gork
:  #+end_src
:
: Here's how to use the function:
:  #+name: function-gorking-demo
:  #+begin_src python :tangle yes
:  function-gorking
:
:  print gorking()
:  #+end_src
: 
: Which gives us:
:  #+results: function-gorking-demo
:  gork

Does that explain it better?

Thanks!

Jos'h





Re: [O] Tangling without clutter?

2012-03-14 Thread Jos'h Fuller
Hi!

 Yes, although it seems that the existing no-export or strip-export
 options to the :noweb header argument may better suit your purposes.
 These are described in the Org-mode manual, however, they are not
 mentioned in the online version of the manual which is out of date.

I thought I had the latest at 7.8.03... Are you referring to a development 
version? I don't see a reference to those in the documentation that came with 
that version.

Thanks!

Jos'h



Re: [O] [PATCH] Option for clock and timer to be displayed in frame-title

2012-03-06 Thread Jos'h Fuller
Hi!

 Can you change the frame title by doing (setq
 frame-title-format ...) on Windows emacs normally?  

Just to let you know, I am using Windows Emacs 23.2.1 (i386-mingw-nt5.2.3790)

I tried:

  (setq-frame-title-format This is a test.)

in the *scratch* window and got:

  Debugger entered--Lisp error: (void-function setq-frame-title-format)
  (setq-frame-title-format This is a test.)
  eval((setq-frame-title-format This is a test.))
  eval-last-sexp-1(t)
  eval-last-sexp(t)
  eval-print-last-sexp()
  call-interactively(eval-print-last-sexp nil nil)

I'm a little behind the current Emacs, but not that much. However, I have 
noticed other frame and window manipulation functions that are available on 
UNIX, but not Windows.

Hope this helps!


___

Jos'h Fuller, Production Programmer

Arc Productions Ltd. 

p: 416.682.5237  | f: 416.682.5209 | http://www.arcproductions.com 
230 Richmond Street East | Toronto, ON M5A 1P4 |


 -Original Message-
 From: emacs-orgmode-bounces+jos'h.fuller=arcproductions@gnu.org
 [mailto:emacs-orgmode-bounces+jos'h.fuller=arcproductions@gnu.org]
 On Behalf Of George Kettleborough
 Sent: Tuesday, March 06, 2012 1:01 PM
 To: Bernt Hansen
 Cc: emacs-orgmode@gnu.org
 Subject: Re: [O] [PATCH] Option for clock and timer to be displayed in
 frame-title
 
 Hi Bernt,
 
 On Tue, Mar 06 2012, Bernt Hansen wrote:
  I tried this patch at work and it hangs my Emacs session in Windows
 on
  startup.  It's totally unresponsive and I have to kill the process
 with
  the task manager.
 
  I think there's an implementation problem here but I don't have any
  other useful information about what it might be.
 
 Thanks for testing the patch.  That's quite alarming and I have no idea
 why this would happen.  Can you change the frame title by doing (setq
 frame-title-format ...) on Windows emacs normally?  I don't currently
 have any Windows boxen to test this on unfortunately.
 
 Also, what emacs version are you running?
 
 Thanks,
 
 George.




[O] Controlling pagination on headings in Latex/PDF export?

2012-02-16 Thread Jos'h Fuller
Hi!

I'm have an org-mode document something like this:

* Period 2012-02-06 to 2012-02-12
** Asset
*** DEPARTMENT
| Data| Data | Data | Data |
|-+--+--+--|
|  XX |1 |1 |0 |
|  YY |5 |4 |0 |

(There are more Assets, each with several DEPARTMENTS. The tables are short, 
perhaps 10-15 rows.)

When I go to export a PDF, I will often get DEPARTMENT at the bottom of one 
page, with the actual data table at the start of the next. Is there any way to 
keep the heading together with the table?

I tried using the longtable environment, but that just splits the table itself, 
so that I might have the heading at the bottom of the page with one row of the 
table and a continued message. I also tried the LaTeX directives \goodbreak 
before the headings and \nobreak between the headings and tables but they 
didn't seem to affect anything.

Thanks very much!
___

Jos'h Fuller, Production Programmer

Arc Productions Ltd. 

p: 416.682.5237  | f: 416.682.5209 | http://www.arcproductions.com 
230 Richmond Street East | Toronto, ON M5A 1P4 |





Re: [O] Controlling pagination on headings in Latex/PDF export?

2012-02-16 Thread Jos'h Fuller
Hi!

I am familiar with \newpage (and I especially like to put it at the front of 
the document to keep my content out of my table of contents!), but I was hoping 
to be able to do this in some more automatic fashion, since these are long 
reports and I want to be able to process them unattended.

Is it possible to do something like this:

* Period...
** Asset
#+latex: \keepthisstufftogether{begin}
*** DEPARTMENT A
| Table | Data | Here. |
| Table | Data | Here. |
| Table | Data | Here. |
#+latex: \keepthisstufftogether{end}
*** DEPARTMENT B
...

I have no idea what /actual/ LaTeX call fills in for \keepthisstufftogether 
though...

Thanks!

___

Jos'h Fuller, Production Programmer

Arc Productions Ltd. 

p: 416.682.5237  | f: 416.682.5209 | http://www.arcproductions.com 
230 Richmond Street East | Toronto, ON M5A 1P4 |


 -Original Message-
 From: nicholas.do...@hp.com [mailto:nicholas.do...@hp.com]
 Sent: Thursday, February 16, 2012 1:21 PM
 To: Jos'h Fuller
 Cc: emacs-orgmode@gnu.org; nicholas.do...@hp.com
 Subject: Re: [O] Controlling pagination on headings in Latex/PDF
 export?
 
 Jos'h Fuller Jos'h.ful...@arcproductions.com wrote:
 
  Hi!
 
  I'm have an org-mode document something like this:
 
  * Period 2012-02-06 to 2012-02-12
  ** Asset
  *** DEPARTMENT
  | Data| Data | Data | Data |
  |-+--+--+--|
  |  XX |1 |1 |0 |
  |  YY |5 |4 |0 |
 
  (There are more Assets, each with several DEPARTMENTS. The tables
 are short, perhaps 10-15 rows.)
 
  When I go to export a PDF, I will often get DEPARTMENT at the
 bottom of one page, with the actual data table at the start of the
 next. Is there any way to keep the heading together with the table?
 
 
 Try adding
 
 #+LATEX: \newpage
 
 before the heading where you want the page break to occur:
 
 --8---cut here---start-8---
 Period 2012-02-06 to 2012-02-12
 ** Asset
 #+LATEX: \newpage
 *** DEPARTMENT
 | Data| Data | Data | Data |
 |-+--+--+--|
 |  XX |1 |1 |0 |
 |  YY |5 |4 |0 |
 
 --8---cut here---end---8---
 
 You should probably do that as a last resort in the last editing
 round, just to fix problematic spots.
 
  I tried using the longtable environment, but that just splits the
  table itself, so that I might have the heading at the bottom of the
  page with one row of the table and a continued message. I also tried
  the LaTeX directives \goodbreak before the headings and \nobreak
  between the headings and tables but they didn't seem to affect
  anything.
 
 
 IIRC, these influence LaTeX's internal measures of whether this is a
 good or bad place to do it, but there are several factors in
 competition
 and they probably lose in comparison to the other factors.
 
 \newpage otoh is Thor's hammer: no questions asked.
 
 Nick



Re: [O] Controlling pagination on headings in Latex/PDF export?

2012-02-16 Thread Jos'h Fuller
Hi Sebastien!

I tried it, and it didn't work. However, I may not have set it up right:

--snip!--
#+latex \def\mykeepwithnextpar{\par\nobreak\@afterheading}

#+latex: \newpage
* Period...
** Asset
#+latex: \mykeepwithnextpar{}
*** DEPARTMENT
| Table | Data | Here |
--snip!--

Did I do this correctly or does the mykeepwithnextpar definition have to go 
into a different file?

Thanks very much!
___

Jos'h Fuller, Production Programmer

Arc Productions Ltd. 

p: 416.682.5237  | f: 416.682.5209 | http://www.arcproductions.com 
230 Richmond Street East | Toronto, ON M5A 1P4 |


 -Original Message-
 From: emacs-orgmode-bounces+jos'h.fuller=arcproductions@gnu.org
 [mailto:emacs-orgmode-bounces+jos'h.fuller=arcproductions@gnu.org]
 On Behalf Of Sebastien Vauban
 Sent: Thursday, February 16, 2012 2:44 PM
 To: emacs-orgmode@gnu.org
 Subject: Re: [O] Controlling pagination on headings in Latex/PDF
 export?
 
 Hi Jos'h,
 
 Jos'h Fuller wrote:
  I am familiar with \newpage (and I especially like to put it at the
 front of
  the document to keep my content out of my table of contents!), but I
 was
  hoping to be able to do this in some more automatic fashion, since
 these are
  long reports and I want to be able to process them unattended.
 
  Is it possible to do something like this:
 
  * Period...
  ** Asset
  #+latex: \keepthisstufftogether{begin}
  *** DEPARTMENT A
  | Table | Data | Here. |
  | Table | Data | Here. |
  | Table | Data | Here. |
  #+latex: \keepthisstufftogether{end}
  *** DEPARTMENT B
  ...
 
  I have no idea what /actual/ LaTeX call fills in for
  \keepthisstufftogether though...
 
 I have written such a thing, years ago, first for LaTeX, now for Org:
 
 --8---cut here---start-8---
 % how not to have a page break with what is following?
 \def\mykeepwithnextpar{\par\nobreak\@afterheading}
 --8---cut here---end---8---
 
 and I put whereever it's needed
 
 --8---cut here---start-8---
 ** Asset
 #+latex: \mykeepwithnextpar{}
 *** DEPARTMENT A
 | Table | Data | Here. |
 | Table | Data | Here. |
 | Table | Data | Here. |
 *** DEPARTMENT B
 --8---cut here---end---8---
 
 Does it work for you?
 
 Best regards,
   Seb
 
 --
 Sebastien Vauban
 




Re: [O] Controlling pagination on headings in Latex/PDF export?

2012-02-16 Thread Jos'h Fuller
OK, I'm an idiot. I forgot to put in the : after the #+latex, so it didn't 
get processed correctly.

However, once I did put it in, it does work to keep the headings together with 
the table data. However... it also seems to embed the spurious word 
afterheading (in italics) after most (but not all) of the top level headings 
in the file.

So, it totally works to keep the headings and tables together, but the 
/afterheading/ thing is very strange. 

I've probably still done something wrong. Any ideas?

Thanks again!

Jos'h
___

Jos'h Fuller, Production Programmer

Arc Productions Ltd. 

p: 416.682.5237  | f: 416.682.5209 | http://www.arcproductions.com 
230 Richmond Street East | Toronto, ON M5A 1P4 |


 -Original Message-
 From: emacs-orgmode-bounces+jos'h.fuller=arcproductions@gnu.org
 [mailto:emacs-orgmode-bounces+jos'h.fuller=arcproductions@gnu.org]
 On Behalf Of Jos'h Fuller
 Sent: Thursday, February 16, 2012 3:09 PM
 To: Sebastien Vauban; emacs-orgmode@gnu.org
 Subject: Re: [O] Controlling pagination on headings in Latex/PDF
 export?
 
 Hi Sebastien!
 
 I tried it, and it didn't work. However, I may not have set it up
 right:
 
 --snip!--
 #+latex \def\mykeepwithnextpar{\par\nobreak\@afterheading}
 
 #+latex: \newpage
 * Period...
 ** Asset
 #+latex: \mykeepwithnextpar{}
 *** DEPARTMENT
 | Table | Data | Here |
 --snip!--
 
 Did I do this correctly or does the mykeepwithnextpar definition have
 to go into a different file?
 
 Thanks very much!
 ___
 
 
 Jos'h Fuller, Production Programmer
 
 Arc Productions Ltd.
 
 p: 416.682.5237  | f: 416.682.5209 |
 http://www.arcproductions.com
 230 Richmond Street East | Toronto, ON M5A 1P4 |
 
 
  -Original Message-
  From: emacs-orgmode-bounces+jos'h.fuller=arcproductions@gnu.org
  [mailto:emacs-orgmode-
 bounces+jos'h.fuller=arcproductions@gnu.org]
  On Behalf Of Sebastien Vauban
  Sent: Thursday, February 16, 2012 2:44 PM
  To: emacs-orgmode@gnu.org
  Subject: Re: [O] Controlling pagination on headings in Latex/PDF
  export?
 
  Hi Jos'h,
 
  Jos'h Fuller wrote:
   I am familiar with \newpage (and I especially like to put it at the
  front of
   the document to keep my content out of my table of contents!), but
 I
  was
   hoping to be able to do this in some more automatic fashion, since
  these are
   long reports and I want to be able to process them unattended.
  
   Is it possible to do something like this:
  
   * Period...
   ** Asset
   #+latex: \keepthisstufftogether{begin}
   *** DEPARTMENT A
   | Table | Data | Here. |
   | Table | Data | Here. |
   | Table | Data | Here. |
   #+latex: \keepthisstufftogether{end}
   *** DEPARTMENT B
   ...
  
   I have no idea what /actual/ LaTeX call fills in for
   \keepthisstufftogether though...
 
  I have written such a thing, years ago, first for LaTeX, now for Org:
 
  --8---cut here---start-8---
  % how not to have a page break with what is following?
  \def\mykeepwithnextpar{\par\nobreak\@afterheading}
  --8---cut here---end---8---
 
  and I put whereever it's needed
 
  --8---cut here---start-8---
  ** Asset
  #+latex: \mykeepwithnextpar{}
  *** DEPARTMENT A
  | Table | Data | Here. |
  | Table | Data | Here. |
  | Table | Data | Here. |
  *** DEPARTMENT B
  --8---cut here---end---8---
 
  Does it work for you?
 
  Best regards,
Seb
 
  --
  Sebastien Vauban
 
 




Re: [O] Controlling pagination on headings in Latex/PDF export?

2012-02-16 Thread Jos'h Fuller
Hi!

Thanks for your kind words! ; - )

I did wrap the mykeepwithnextpar definition and I moved the call between the 
heading and the table as suggested, but it still doesn't seem to want to 
cooperate (heading on one page, table on the next).

Since this seems to be strange behaviour, I will set up a minimal failing %.org 
file and send it tomorrow to demonstrate the problem. 

Thanks again!

Jos'h

___

Jos'h Fuller, Production Programmer

Arc Productions Ltd. 

p: 416.682.5237  | f: 416.682.5209 | http://www.arcproductions.com 
230 Richmond Street East | Toronto, ON M5A 1P4 |