Re: R terminal output does not match src block output due to ">" character in results

2022-01-25 Thread John Hendy
Ugh. Thanks for that. Three contributing factors: a) doing a git pull/make
and seeing output as usual without really paying attention, b) scanning for
commit date, seeing January which seemed AboutRight but completely missing
the "oh right, it's 2022 now," and c) the root cause being it'd been so
long since I fetched that I was tracking *master*, not main. Now:

$ git log
commit 70970dff8d68f009947b2167c5b2bd886c6de984 (HEAD -> main, origin/main)
Author: Ihor Radchenko 
Date:   Tue Jan 25 22:53:08 2022 +0800

org-before-first-heading-p: Use cache and clarify docstring

In addition, this makes a lot more sense:

M-x version
Org mode version 9.5.2 (release_9.5.2-323-g70970d @
/home/jwhendy/.elisp/org/lisp/)

And, most importantly, I can no longer reproduce my example from above.


Thanks again, my fault, and I appreciate you pointing out what was there in
plain sight!
John

On Sun, Jan 23, 2022 at 10:49 PM Jack Kamm  wrote:

> Hi John,
>
> > $ git log
> > commit 7fa8173282f85c2ca03cc7f51f28f6adfb250610 (HEAD -> master,
> > origin/master, origin/HEAD)
> > Author: Ian Martins 
> > Date:   Sat Jan 16 15:52:21 2021 -0500
>
> It looks like the last commit you're on is from about a year ago (Jan
> 2021), so I suspect you're on an older version of org mode. Maybe
> there's an issue with the remote you're pulling from?
>
> I tested out your example R blocks and didn't get any prompt mangling
> errors, so I think this issue may have been solved already.
>
> Jack
>


Re: R terminal output does not match src block output due to ">" character in results

2022-01-16 Thread John Hendy
On Sun, Jan 16, 2022 at 7:30 AM Jeremie Juste  wrote:
>
> Hello John,
>
> As promised, I'm coming back about the formatting of  NA_characters_.
> In org-mode 9.5 NA_characters_ are not printed anymore with :results
> value. See example 2 and 3 for more details. Please let me know if
> this post solves your issues. Woudl updating to 9.5 be an option for
> you?
>
> Best regards,
> Jeremie
>

>From our other thread, I *think* I'm already on 9.5? Re-pasting my
org-version answer here:

#+begin_quote
$ git log
commit 7fa8173282f85c2ca03cc7f51f28f6adfb250610 (HEAD -> master,
origin/master, origin/HEAD)
Author: Ian Martins 
Date:   Sat Jan 16 15:52:21 2021 -0500

But Mx-version:
Org mode version 9.4.4 (release_9.4.4-186-g7fa817.dirty @
/home/jwhendy/.elisp/org/lisp/)

So perhaps it appends the git commit to the system version?
#+end_quote

9.5 appears 4mos old... so I think I'm on it?
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/

I'll try the example later. I'd like for this to work for :results
output and :results value. I'm pretty sure I already explored :results
value and found it to work. One thing that confused me was why I
didn't get a header row with the org table coming from :results value?

Thanks for the help and I'll get back to you early this week to
confirm on the example below.


John

> #+BEGIN_SRC elisp
>(org-version)
>   #+END_SRC
>
>   #+RESULTS:
>   : 9.5
>
> #+BEGIN_SRC elisp
>   (emacs-version)
> #+end_src
>
> #+RESULTS:
> : GNU Emacs 27.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.24)
> :  of 2021-11-26
>
> * Example 1
> #+BEGIN_SRC R :results output
> data.frame(abc=NA_character_)
> #+end_src
>
> #+RESULTS:
> :abc
> : 1 
>
> * Example 2
> #+BEGIN_SRC R :results value
> a <- data.frame(column1=NA_character_,column2=1:10)
> #+end_src
>
> #+RESULTS:
> |   |  1 |
> |   |  2 |
> |   |  3 |
> |   |  4 |
> |   |  5 |
> |   |  6 |
> |   |  7 |
> |   |  8 |
> |   |  9 |
> |   | 10 |
>
>
> * Example 3
> #+BEGIN_SRC R :results value :colnames yes
> library(RSQLite)
> con <- dbConnect(RSQLite::SQLite(), ":memory:")
>
> dbWriteTable(con, "df", data.frame(column1=NA_character_,column2=1:10))
> dbGetQuery(con, "SELECT * FROM df")
> #+end_src
>
> #+RESULTS:
> | column1 | column2 |
> |-+-|
> | |   1 |
> | |   2 |
> | |   3 |
> | |   4 |
> | |   5 |
> | |   6 |
> | |   7 |
> | |   8 |
> | |   9 |
> | |  10 |
>
>



Re: Question Regarding Creating Workflow For Automatic Formulas For Finance Based Org Spreadsheet

2022-01-16 Thread John Hendy
On Sun, Jan 16, 2022 at 9:20 AM Samuel Banya  wrote:

>
> In that case, would a running csv where you paste in each month's new
> pull work? You could even keep the totals to the side, so that as you
> paste new data in e.g. cols A-D, your totals (in E and beyond) can sit
> right there happily? I alluded to this with respect to the request to
> automate csv -> org; without knowing which things must be org and why,
> it's hard to comment on these kinds of inquiries. Maybe org is just
> more fun, maybe it's mandatory because there's some other aspect of
> this we don't know.
>
>
> How would you able to keep the running totals in Column E?
>
> Can you provide me with an example of this?
>

Sure, attached.
- running csv, named "running_total.csv"
- toy examples of your jan and feb downloads

Routine each month:
- open month's bank download
- copy all but the header (easy to do with ctrl+shift+arrow to get to
bottom row)
- ctrl+arrow to get to last row in running_totals.csv
- update the month's formula with
sum(first_row_of_this_month:last_row_of_this_month)
- you could  even get fancy with an auto-date formula I'm sure

Just keep the total formulas far enough right (I said column E, but it's
arbitrary) to not get pasted over depending on your institution's number of
columns.

This is basically doing what you're doing in org, but in a csv (or use a
regular ods or xlsx if you need the last month's formulas to stay as
formulas, not static values on save/exit).

John



> On Sun, Jan 16, 2022, at 10:15 AM, Samuel Banya wrote:
>
> Hello,
>
> I appreciate the enthusiasm for Ledger, but I really just don't like the
> double posting idea period.
>
> I just need totals spreadsheet style, that's about it. I think the whole
> idea behind bean count is tedious.
>
> I just don't think like a mathematician in this respect, too brainy for me.
>
> I'll take a look at the Org Mode way to solve this problem via the
> previous posts, thanks.
>
> Sincerely,
>
> Sam
>
> On Fri, Jan 14, 2022, at 2:54 PM, Quiliro Ordóñez wrote:
>
> El 2022-01-09 22:42, Samuel Banya escribió:
> > Ah, Ledger is way too complicated for what it's worth. I've seen
> > videos on YouTube about it, and every person who's praised it is
> > pretty much too smart enough to be able to explain it in simple terms.
>
> It is very easy.  I made a video for EmacsConf 2019
> https://emacsconf.org/2019/talks/12/ .   I wish someone had showed me
> examples like these when I started with it.
>
> My fiancee is a preschool teacher (programming is not her area of
> expertize).  But she quickly learned how to use it.  She keeps about
> 3700 per year with 4500 lines.  It takes her about 10 minutes per day.
> With that investment, she can even tell how much we have spent on apples
> or on all fruits (as detailed or general as she wants).  On these two
> years, she has saved us about half our budget and has us living much
> better thanks to the knowledge of what we want to invest on.  (We now do
> not think of how to spend money, but how to invest it.  That changes the
> point view completely.)
>
> There are complicated reports as well as very simple ones that can be
> generated.  And you can always customize them to the last bit.  There is
> also a website http://plaintextaccounting.org .  There is plenty of
> information there.  You can also use org-babel to include formulas for
> Ledger reports.
>
> Just ask away!  :-)
>
>
>
>
>
"date","value"
"jan",1,,,"jan",6
"jan",2,,,"feb",30
"jan",3,,,"mar",
"feb",4,,,"arp",
"feb",5,,,"may",
"feb",6,,,"jun",
"feb",7,,,"jul",
"feb",8,,,"aug",
"sep",
"oct",
"nov",
"dec",
"total",36
"date","value"
"jan",1
"jan",2
"jan",3
"date","value"
"feb",4
"feb",5
"feb",6
"feb",7
"feb",8


Re: What determines if R source block output is wrapped in begin_example or not?

2022-01-14 Thread John Hendy
On Fri, Jan 14, 2022 at 3:48 AM Eric S Fraga  wrote:
>
> Have a look at
>
> ,[ C-h v org-babel-min-lines-for-block-output RET ]
> | org-babel-min-lines-for-block-output is a variable defined in ‘ob-core.el’.
> |
> | Its value is 10
> |
> | The minimum number of lines for block output.
> | If number of lines of output is equal to or exceeds this
> | value, the output is placed in a #+begin_example...#+end_example
> | block.  Otherwise the output is marked as literal by inserting
> | colons at the starts of the lines.  This variable only takes
> | effect if the :results output option is in effect.
> |
> `

Well, indeed, that's definitely it! Out of curiosity, despite being an
org-mode user for... 10(?) yrs now, is there a heuristic on when to
look at the manual vs. when to M-x help RET v RET
[guess-and-check-randomly]?

I don't feel familiar enough with org internals to have known where to
look... despite this being 100% exactly what I experienced, so much so
it's comedic how accurately it's written vs. what I I would have
described.

Thanks so much!
John
> --
> : Eric S Fraga, with org release_9.5.2-298-g1f48d2 in Emacs 29.0.50



Re: What determines if R source block output is wrapped in begin_example or not?

2022-01-13 Thread John Hendy
Possible false alarm. As I continued to work on this, I accidentally
didn't use :results output code, yet the formatting was fine... I'm
wondering if I had a dangling #+begin_src with no matching end?

Still, I am intrigued by the toggle between prepending with ":" and
wrapping in example blocks, despite what appears to be no practical
impact at this point.

John

On Thu, Jan 13, 2022 at 2:49 PM John Hendy  wrote:
>
> Greetings,
>
> I was perplexed when a table in my exported latex/pdf document came
> out garbled, to find out it's being included like "normal text." In
> another block with well-behaving output, I observed the same src
> header args, but it was wrapped in #+begin/end_example for free,
> without me trying.
>
> Here's a reproducible example. This output would not look right when exported:
>
> #+begin_src R :exports results :results output :eval yes
> data.frame(
>   x = c(1:3))
> #+end_src
>
> #+RESULTS:
> :   x
> : 1 1
> : 2 2
> : 3 3
>
> From trial and error, it seems the magical length is 9 where it gets wrapped:
>
> #+begin_src R :exports results :results output :eval yes
> data.frame(
>   x = c(1:9))
> #+end_src
>
> #+RESULTS:
> #+begin_example
>   x
> 1 1
> 2 2
> 3 3
> 4 4
> 5 5
> 6 6
> 7 7
> 8 8
> 9 9
> #+end_example
>
> I see nothing like this mentioned in the docs on the results of evaluation:
> https://orgmode.org/manual/Results-of-Evaluation.html
>
> For now, my workaround is to use :results output code. I guess my
> typical output must usually be longer than 9, or I use :results value
> and manually add header rows to the generated org table, as I don't
> recall dealing with this before!
>
> Thanks for help understanding.
>
> Best regards,
> John



What determines if R source block output is wrapped in begin_example or not?

2022-01-13 Thread John Hendy
Greetings,

I was perplexed when a table in my exported latex/pdf document came
out garbled, to find out it's being included like "normal text." In
another block with well-behaving output, I observed the same src
header args, but it was wrapped in #+begin/end_example for free,
without me trying.

Here's a reproducible example. This output would not look right when exported:

#+begin_src R :exports results :results output :eval yes
data.frame(
  x = c(1:3))
#+end_src

#+RESULTS:
:   x
: 1 1
: 2 2
: 3 3

>From trial and error, it seems the magical length is 9 where it gets wrapped:

#+begin_src R :exports results :results output :eval yes
data.frame(
  x = c(1:9))
#+end_src

#+RESULTS:
#+begin_example
  x
1 1
2 2
3 3
4 4
5 5
6 6
7 7
8 8
9 9
#+end_example

I see nothing like this mentioned in the docs on the results of evaluation:
https://orgmode.org/manual/Results-of-Evaluation.html

For now, my workaround is to use :results output code. I guess my
typical output must usually be longer than 9, or I use :results value
and manually add header rows to the generated org table, as I don't
recall dealing with this before!

Thanks for help understanding.

Best regards,
John



Re: Help debugging R source code block output problem with :session

2022-01-12 Thread John Hendy
On Wed, Jan 12, 2022 at 1:50 AM Jeremie Juste  wrote:
>
> Hello John,
>
> Many thanks for reporting.  I'm short of time right now, but I'll take a 
> closer look at the problem over
> the weekend and keep you posted. Could you let me know which version of
> org-mode you are currently using?

Sure thing and thanks for the quick note! I use org from git and
*thought* it used to report the most recent release tag, but I see:

$ git log
commit 7fa8173282f85c2ca03cc7f51f28f6adfb250610 (HEAD -> master,
origin/master, origin/HEAD)
Author: Ian Martins 
Date:   Sat Jan 16 15:52:21 2021 -0500

But Mx-version:
Org mode version 9.4.4 (release_9.4.4-186-g7fa817.dirty @
/home/jwhendy/.elisp/org/lisp/)

So perhaps it appends the git commit to the system version?

Btw, it's dirty as I was able to apply Jack's patches (with some mods)
successfully and am a happy camper. In case it's helpful, I attached
the patches as I applied them (first -1, then -2) to this org-version.
Nothing special, they are just Jack's patches with a couple sections
removed (one change was already present, and I removed the adjustments
to the testing file as they were failing).

Thanks so much to all of you who contributed to that, as I'm so happy
that I can at least continue on with my report at this point with good
looking output!

Many thanks,
John

>
> Best regards,
> Jeremie Juste
>
>
> On Tuesday, 11 Jan 2022 at 17:36, John Hendy wrote:
> > Greetings,
> >
> > Apologies for writing off-list, but I don't have the original thread
> > anymore to reply to. I just pulled this group in directly from the
> > email I found... I just got bitten by this as well and burned most of
> > my afternoon trying to figure out what the issue was.
> >
> > Any further thoughts on a patch that could be finalized/applied?
> >
> > Is the one from the thread still the best from your continued experience?
> > https://list.orgmode.org/87zgxc42qg@gmail.com/
> >
> > This r/orgmode post was what finally got me to the existence of this
> > as a previous issue (I'd just sent my own email to list as my
> > searching did not find the above):
> > https://www.reddit.com/r/orgmode/comments/pt3em4/source_block_modifying_format_of_results_r/
> >
> > And it links to a patch as well:
> > https://gist.github.com/gtuckerkellogg/e356d20497cfdc8e4fc683412e320e3e
> >
> > Many thanks,
> > John
diff --git a/lisp/ob-R.el b/lisp/ob-R.el
index 5e9d35f58..b37e3965a 100644
--- a/lisp/ob-R.el
+++ b/lisp/ob-R.el
@@ -437,24 +439,23 @@ (defun org-babel-R-evaluate-session
 	  (org-babel-import-elisp-from-file tmp-file '(16)))
 	column-names-p)))
 (output
- (mapconcat
-  'org-babel-chomp
-  (butlast
-   (delq nil
-	 (mapcar
-	  (lambda (line) (when (> (length line) 0) line))
-	  (mapcar
-	   (lambda (line) ;; cleanup extra prompts left in output
-		 (if (string-match
-		  "^\\([>+.]\\([ ][>.+]\\)*[ ]\\)"
-		  (car (split-string line "\n")))
-		 (substring line (match-end 1))
-		   line))
-	   (org-babel-comint-with-output (session org-babel-R-eoe-output)
-		 (insert (mapconcat 'org-babel-chomp
-(list body org-babel-R-eoe-indicator)
-"\n"))
-		 (inferior-ess-send-input)) "\n"
+ (let* ((tmp-file (org-babel-temp-file "R-")))
+   (with-temp-file tmp-file
+	 (insert (concat body "\n" org-babel-R-eoe-indicator)))
+   (with-current-buffer session
+	 (let* ((process (get-buffer-process (current-buffer)))
+		(string-buffer "")
+		(comint-output-filter-functions
+		 (cons (lambda (text) (setq string-buffer
+	(concat string-buffer text)))
+		   comint-output-filter-functions)))
+	   (ess-send-string
+	process (format "source('%s', print.eval=TRUE)"
+			(org-babel-process-file-name tmp-file 'noquote)))
+	   (while (not (string-match (regexp-quote org-babel-R-eoe-output)
+ string-buffer))
+	 (accept-process-output process))
+	   (substring string-buffer 0 (match-beginning 0
 
 (defun org-babel-R-process-value-result (result column-names-p)
   "R-specific processing of return value.

diff --git a/lisp/ob-R.el b/lisp/ob-R.el
index b37e3965a..5ddf0ebd1 100644
--- a/lisp/ob-R.el
+++ b/lisp/ob-R.el
@@ -441,7 +441,7 @@ (defun org-babel-R-evaluate-session
 (output
  (let* ((tmp-file (org-babel-temp-file "R-")))
(with-temp-file tmp-file
-	 (insert (concat body "\n" org-babel-R-eoe-indicator)))
+	 (insert body))
(with-current-buffer session
 	 (let* ((process (get-buffer-process (current-buffer)))
 		(string-buffer "")
@@ -450,8 +450,9 @@ (defun org-babel-R-evaluate-session
 	(concat string-buffer text)))
 		   comint-output-filter-functions)))
 	   (ess-send-string

Re: Help debugging R source code block output problem with :session

2022-01-11 Thread John Hendy
Greetings,

Apologies for writing off-list, but I don't have the original thread
anymore to reply to. I just pulled this group in directly from the
email I found... I just got bitten by this as well and burned most of
my afternoon trying to figure out what the issue was.

Any further thoughts on a patch that could be finalized/applied?

Is the one from the thread still the best from your continued experience?
https://list.orgmode.org/87zgxc42qg@gmail.com/

This r/orgmode post was what finally got me to the existence of this
as a previous issue (I'd just sent my own email to list as my
searching did not find the above):
https://www.reddit.com/r/orgmode/comments/pt3em4/source_block_modifying_format_of_results_r/

And it links to a patch as well:
https://gist.github.com/gtuckerkellogg/e356d20497cfdc8e4fc683412e320e3e

Many thanks,
John



Re: R terminal output does not match src block output due to ">" character in results

2022-01-11 Thread John Hendy
Ok, after more searching, I found that this is a duplicate issue
that's already been discussed. Not sure why all my incantations didn't
bring me to the reddit post or mailing list from google, but simply
searching "prompt blocks R" on r/orgmode directly got me here:
https://www.reddit.com/r/orgmode/comments/pt3em4/source_block_modifying_format_of_results_r/

And that links to a patch:
https://gist.github.com/gtuckerkellogg/e356d20497cfdc8e4fc683412e320e3e

And that points to this mailing list thread where the topic has already come up:
https://list.orgmode.org/87zgxc42qg@gmail.com/

It appears the discussion/fix is stalled out at this point?

Best regards,
John


On Tue, Jan 11, 2022 at 4:42 PM John Hendy  wrote:
>
> I just ran into an issue where results look fine in the terminal, but
> not in the results of a source block. I can't share the real example
> as it's work confidential, but a couple of rows across 7 columns looks
> like this in the terminal:
>
> #+begin_example terminal
> dbGetQuery(con, paste0("SELECT TOP 2 * FROM table"))
> 1NANA  FALSE  0  5
> 2NANA  FALSE  0  5
> #+end_example
>
> When I use this with :exports results :results output drawer in my
> document, I get:
> #+begin_example src
> 1   <
> NANA <
> FALSE  0  5
> 2   <
> NANA <
> FALSE  0  5
> #+end_example
>
> I had an entirely separate email written and about to send, when it
> dawned on me that the > character is the same as the R terminal prompt
> and might be the cause.
>
> My first attempt to reproduce was unsuccessful:
>
> #+begin_src R :session :exports results :results output drawer
> df <- data.frame(
>   x = letters[1:3],
>   y = c(1, 2, NA),
>   z = c("x", NA,"z"))
> df
> #+end_src
>
> #+RESULTS:
> :results:
>   x  yz
> 1 a  1x
> 2 b  2 
> 3 c NAz
> :end:
>
> I'm not sure if it's about more columns or more rows, but this does the trick:
>
> #+begin_src R :session :exports results :results output drawer
> df <- data.frame(
>   x = letters[1:7],
>   y = c(1, 2, NA, NA, NA, NA, NA),
>   z = c("x", NA, NA, NA, NA, NA, "z"),
>   a = c(1, rep(NA, 6)))
> df
> #+end_src
>
> #+RESULTS:
> :results:
>   x  yz  a
> 1 a  1x  1
> 2 b  2 <
> NA
> 3 c NA <
> NA
> ### ... shortened
> :end:
>
> If you comment out the line with z=, it works again... but that's the
> column with all the  values. Then again, if you end the data.frame
> at z and don't add column a, it *also* works despite the presence of
> many  values.
>
> #+RESULTS:
> :results:
>   x  yz
> 1 a  1x
> 2 b  2 
> 3 c NA 
> ### ... shortened
> :end:
>
> I'm imagining there's a... "parser?" somewhere that typically strips
> off the command prompt from the results perhaps (and recall some vague
> memory of someone telling me this years ago on the list). Is there a
> way to stop this from happening?
>
> Would this line be responsible, or something else?
> https://github.com/bzg/org-mode/blob/main/lisp/ob-R.el#L453
>
>
> Many thanks,
> John



R terminal output does not match src block output due to ">" character in results

2022-01-11 Thread John Hendy
I just ran into an issue where results look fine in the terminal, but
not in the results of a source block. I can't share the real example
as it's work confidential, but a couple of rows across 7 columns looks
like this in the terminal:

#+begin_example terminal
dbGetQuery(con, paste0("SELECT TOP 2 * FROM table"))
1NANA  FALSE  0  5
2NANA  FALSE  0  5
#+end_example

When I use this with :exports results :results output drawer in my
document, I get:
#+begin_example src
1   <
NANA <
FALSE  0  5
2   <
NANA <
FALSE  0  5
#+end_example

I had an entirely separate email written and about to send, when it
dawned on me that the > character is the same as the R terminal prompt
and might be the cause.

My first attempt to reproduce was unsuccessful:

#+begin_src R :session :exports results :results output drawer
df <- data.frame(
  x = letters[1:3],
  y = c(1, 2, NA),
  z = c("x", NA,"z"))
df
#+end_src

#+RESULTS:
:results:
  x  yz
1 a  1x
2 b  2 
3 c NAz
:end:

I'm not sure if it's about more columns or more rows, but this does the trick:

#+begin_src R :session :exports results :results output drawer
df <- data.frame(
  x = letters[1:7],
  y = c(1, 2, NA, NA, NA, NA, NA),
  z = c("x", NA, NA, NA, NA, NA, "z"),
  a = c(1, rep(NA, 6)))
df
#+end_src

#+RESULTS:
:results:
  x  yz  a
1 a  1x  1
2 b  2 <
NA
3 c NA <
NA
### ... shortened
:end:

If you comment out the line with z=, it works again... but that's the
column with all the  values. Then again, if you end the data.frame
at z and don't add column a, it *also* works despite the presence of
many  values.

#+RESULTS:
:results:
  x  yz
1 a  1x
2 b  2 
3 c NA 
### ... shortened
:end:

I'm imagining there's a... "parser?" somewhere that typically strips
off the command prompt from the results perhaps (and recall some vague
memory of someone telling me this years ago on the list). Is there a
way to stop this from happening?

Would this line be responsible, or something else?
https://github.com/bzg/org-mode/blob/main/lisp/ob-R.el#L453


Many thanks,
John



Re: Question Regarding Creating Workflow For Automatic Formulas For Finance Based Org Spreadsheet

2022-01-10 Thread John Hendy
On Mon, Jan 10, 2022 at 6:32 PM Samuel Banya  wrote:
>
> The double reporting thing still doesn't apply to me.
>
> Even if you pay with credit cards, ultimately it comes out of your regular 
> bank account to pay off.
>
> To me, its easier to just focus on the single bank account, and obtain the 
> latest .csv from the current week (Last Saturday to current Saturday), and 
> treat the entire list as a list of negative value expenses, and positive 
> income items to keep it super simple.
>
> The simpler it is, the better for me, because I honestly hate doing finances, 
> and only do them to make sure I'm ontop of everything as its the last thing I 
> want to do on a given week.
>
> Hope that helps give some background, since I don't want to appear to be 
> difficult, but would rather just "keep it in a spreadsheet".
>
> To kind of back it up just a slight bit, even the average Excel user would 
> say the same exact thing, especially ones that try to avoid having to use 
> Quicken or more complicated pieces of software (which I know, there DOES 
> exist GNU Cash, etc).
>
> But yeah, keep it simple, keep it Emacs, keep it Org Mode, and keep it fun :) 
> No need for Ledger.

I totally get the resistance to ledger from having tried it myself for
a bit, but that last line made me chuckle out loud. No one using emacs
and org-mode is keeping it *that* simple :p

The simplest answer is probably Mint.



Re: Question Regarding Creating Workflow For Automatic Formulas For Finance Based Org Spreadsheet

2022-01-10 Thread John Hendy
On Mon, Jan 10, 2022 at 11:09 AM Samuel Banya  wrote:
>
> The 'double reporting' idea might have been why I just flat out shook my head 
> when I saw the one presentation on 'ledger' in Emacs on YouTube a while ago 
> as its a bit too complicated and unnecessary for a layman.

Fair, it's a bit to wrap one's head around. That said, I think it's
also standard and one doesn't end up having to actually create two
entries for every transaction, for what it's worth.

> I just don't need that kind of over-thinking when it comes to my finances 
> since I just need a spreadsheet that listed expenses, and to count totals. 
> That's about it.

In that case, would a running csv where you paste in each month's new
pull work? You could even keep the totals to the side, so that as you
paste new data in e.g. cols A-D, your totals (in E and beyond) can sit
right there happily? I alluded to this with respect to the request to
automate csv -> org; without knowing which things must be org and why,
it's hard to comment on these kinds of inquiries. Maybe org is just
more fun, maybe it's mandatory because there's some other aspect of
this we don't know.

> I will take a look at the other suggestions with specific Org Mode formulas, 
> looked awesome, thanks.

Happy to help and good luck!
John

> On Mon, Jan 10, 2022, at 10:31 AM, Greg Minshall wrote:
>
> > I'm wondering if your opinion about Ledger isn't influenced by the fact
> > that it uses basic accounting principles, like the idea of double-entry
> > accounting.  For me, it's /very/ simple and intuitive, but I graduated
> > in economics many years ago and had a (basic, but still) course on
> > accounting.  If that is your problem, I'd suggest spending some time on
> > understanding that - even if you don't end up using Ledger but some
> > other software, you might find learning about accounting useful.  (Also,
> > it's fascinating.  No, really!  It's an extremely clever abstract
> > system with a real-life use-case.)
>
> i agree that learning the principles of double-entry is worthwhile,
> actually interesting, and of a very interesting history!
>
>



Re: Question Regarding Creating Workflow For Automatic Formulas For Finance Based Org Spreadsheet

2022-01-09 Thread John Hendy
On Sun, Jan 9, 2022 at 11:17 AM Samuel Banya  wrote:
>
> Hey there,
>

[...]

> After Reading The Online Manual, I Figured This Out:
>
> I tried using the 'org-table-edit-formulas' function via the "C-c ' (single 
> quote)" (Obtained this formula via the docs, 
> 'https://www.gnu.org/software/emacs/manual/html_mono/org.html#Formula-syntax-for-Lisp')
> I then accepted the mini buffer's changes with 'C-c C-c' which goes back to 
> the spreadsheet.
> I then hit 'C-c *' to update the tables present.
> The problem with this is that when I attempt to do this function for each 
> separate calculation row, both of the bottom calculation rows now only refer 
> to a single formula for some reason.
>

>From using org table formulas, I think the problem is that to my
knowledge, there is no way to maintain multiple formulas for a column.

"""
When you assign a formula to a simple column reference like ‘$3=’, the
same formula is used in all fields of that column
"""
https://orgmode.org/manual/Column-formulas.html

>
> For Reference, Here's A Modified Version Of My Running Finance Spreadsheet

[...]

> Why can't I use individual row formulas in this scenario?
> Why is it that when I use "C-c ' (single quote)" the row formulas are the 
> same for completely separate rows

After you enter these formulas, do you see the line that shows up
below the table? They were omitted in the sample spreadsheet above,
but for me, they look like this:

#+TBLFM: $3=vsum(@1$3..@2$3)::$4=vsum(@1$4..@2$4)

To my knowledge, Org-mode has no mechanism for what you really want,
per *cell* formulas. You're using per *column* formulas, and the
notation matches: for column 4, the formula is foo. There is no
differentiation for rows a and b, just that all of this column will
calculate foo.

> My Main Workflow Questions Include The Following:
>
> Is there a way I can maybe automate the initial steps of converting that .csv 
> into an .org mode doc, and to paste them into the existing org spreadsheet?

Probably, but without full knowledge of what you exactly want/need,
it's hard to comment further. For example, in theory you could just
open the .csv in emacs directly and:

`M-x replace-string [RET] , [RET] |

That would get you at least partially there. Do you need the .csv in
org-mode for some reason? Maybe the answer is "yes" and thus it
justifies solving this aspect further. Maybe the answer is "not
really, I just care about the totals" in which case this is a bit of a
tangent.

> Is there a way I can also update the existing formula for the given month if 
> Emacs would somehow know the current date time stamp and figure out the 
> month's row at the bottom of the spreadsheet accordingly to update the 
> correct row?

I think the reason ledger was suggested (a plain text finance program
with a mode for emacs) is that the answer is probably "no, this is
getting a bit complicated for org spreadsheets and calculations
directly."

I might suggest learning a little bit of python or R. Probably sounds
daunting, but I think it would be easier to pick up at least as much
as you've already taught yourself with respect to org calculation
field syntax! Here's an example:

#+begin_example
* foo

#+name: foo
|+-+---+--|
| 01/03/2022 | Example Rent Expense|
| -1061.67 |
| 01/04/2022 | Example Food Expense|
| -1061.67 |
| 02/05/2022 | Example Utility Expense |
| -2061.67 |
| 02/06/2022 | Example Random Expense  |
| -2061.67 |
|+-+---+--|
#+TBLFM: $3=vsum(@1$3..@2$3)::$4=vsum(@1$4..@2$4)

#+begin_src R :var foo=foo
jan <- sum(foo[1:2, 4])
feb <- sum(foo[3:4, 4])

result <- data.frame(
  month = c("jan", "feb"),
  total = c(jan, feb))

print(result)
#+end_src

#+RESULTS:
| jan | -2123.34 |
| feb | -4123.34 |
#+end_example

R can read in org tables, so that could merge these two solutions. R
can *also* just read in .csv files... so you'd not need to monkey with
.csv -> org at all. As mentioned, teaching yourself @1$4..@2$4 isn't
that much different from [1:2, 4] in R :)

Plus, then you absolutely have date manipulation available, either in
native R or with packages like lubridate which could read in your data
source date syntax (you'd tell it that the date was in "%m/%d/%Y"
format, and then filter to month == 1 for January.

> Anyway, I know my question might be a bit ambiguous and most likely will 
> involve using 'F3' to record macros, but I figured i would ask to maybe make 
> it easier since one of my goals for the new year is to make recording 
> finances an easier process.
>
> I felt like I've been over complicating this, and figured someone probably is 
> doing org finance spreadsheets better than me to figure this out.

Hopefully some useful ideas above. Sorry that I don't have a better
answer to 

Re: A quick LaTeX reference guide in Org

2021-10-25 Thread John Hendy
On Mon, Oct 25, 2021 at 7:49 AM Eric S Fraga  wrote:
>
> On Monday, 25 Oct 2021 at 11:35, Juan Manuel Macías wrote:
> > Thank you very much for this information, I did not know it. I just saw
> > that there is a `latex2e-help-texinfo' package in my distro (Arch), not in
> > the official repositories but in the AUR. Very useful.
>
> It's in CTAN, the official (?) LaTeX repository.

As an arch user, just confirming. For what it's worth, the way to find
the package's "home base" is in the  upstream url, which is as Eric
says.

https://aur.archlinux.org/packages/latex2e-help-texinfo/
"""
Upstream URL: https://ctan.org/pkg/latex2e-help-texinfo
"""
>
> --
> Professor Eric S Fraga
> Fresa: https://tinyurl.com/5t8t5auv & doi:10.5281/zenodo.5045812
> PGP/GnuPG key: 8F5C 279D 3907 E14A 5C29  570D C891 93D8 FFFC F67D
>
> Latest paper (10 Sep 2021): doi:10.1016/j.nucengdes.2021.111432
>



Re: Clarification on org-startup-fold behavior vs. docs

2021-10-19 Thread John Hendy
On Tue, Oct 19, 2021 at 12:28 PM Ihor Radchenko  wrote:
>
> John Hendy  writes:
> The value should be a symbol, not a string:
>
> (setq org-startup-folded 'overview)
>
> customise interface even tries to warn you that something is wrong:
>
> > In addition, M-x customize-variable for org-startup-folded says:
> >
> > #+begin_quote
> > org-startup-folded: "overview"
> > State : CHANGED outside Customize. (mismatch) <--- this is a clue
> >Non-nil means entering Org mode will switch to OVERVIEW. Hide

Thanks, this is helpful. I would, then, chalk this up to my ignorance
on emacs variables and such. This note also appeared when I was using
emacs -Q and it said I couldn't change it because I might have started
with -q, so I thought the "mismatch" might have just been some
artifact of that. I didn't know what "mismatch" meant and suspected it
might merely mean that I'd set this in a config, not with M-x
customize-variable.

> If you select the value from customise interface, Emacs would set it
> correctly.  Direct setting is indeed possible, but you need to consult
> how the variable is defined.  Note the :type specifier below (also, see
> 15.4 Customization Types section of Elisp manual).

This is a good reminder and I've done this before (see what it does to
my config custom variable section, then replicate directly). I didn't
think to do it this time.

My remaining question is why anything except nil (string or not) isn't
non-nil? Like I get that to set a specific setting, you'd need to
match a defined variable... but is it the case that non-parseable
types (expected var, got string) evaluates to nil?

I think the docs still throw me off. Note that showeverthing in the
lead up to the options is fontified as a variable (no backticks), but
below they are all backticked. I actually thought those were all
quoted, only realizing now they are [probably] backticks. I didn't
expect  both fixed width (which my brain reads as "code/variable")
*and* backticks on top.
https://orgmode.org/manual/In_002dbuffer-Settings.html

Actually, now I'm realizing these backticks go in the opposite slant
as what I'm used to? Or are they really single quotes, indeed?


Thanks again,
John
>
> Best,
> Ihor



Clarification on org-startup-fold behavior vs. docs

2021-10-19 Thread John Hendy
Greetings,

I was surprised to open a file and find it in a fully expanded state.
I took a moment to try and figure out what one should do on a global
level. I searched "orgmode startup folded" and got here:
https://orgmode.org/manual/Initial-visibility.html

This points me to org-startup-folded, which has documentation here:
https://orgmode.org/manual/In_002dbuffer-Settings.html

#+begin_quote

The first set of options deals with the initial visibility of the
outline tree. The corresponding variable for global default settings
is org-startup-folded with a default value of showeverything.

‘overview’ Top-level headlines only.
‘content’ All headlines.
‘showall’ No folding on any entry.
‘show2levels’ Headline levels 1-2.
‘show3levels’ Headline levels 1-3.
‘show4levels’ Headline levels 1-4.
‘show5levels’ Headline levels 1-5.
‘showeverything’ Show even drawer contents.
#+end_quote

In addition, M-x customize-variable for org-startup-folded says:

#+begin_quote
org-startup-folded: "overview"
State : CHANGED outside Customize. (mismatch)
   Non-nil means entering Org mode will switch to OVERVIEW. Hide

   This can also be configured on a per-file basis by adding one of
   the following lines anywhere in the buffer:

  #+STARTUP: fold  (or ‘overview’, this is equivalent)
  #+STARTUP: nofold(or ‘showall’, this is equivalent)
  #+STARTUP: content
  #+STARTUP: showeverything
#+end_quote

Using the following min-config, I am unable to get a file to open in
folded state:

#+begin_example
(add-to-list 'load-path "~/.elisp/org/lisp/")
(add-to-list 'load-path "~/.elisp/org/contrib/lisp/")
(setq org-startup-folded "overview")
#+end_example

#+begin_example
* head1
asdf

* head2
asdf
#+end_example

With emacs -Q and M-x load-file path/to/min-config, it opens expanded
with either of these:
(setq org-startup-folded "fold")
(setq org-startup-folded "overview")

This does work:
(setq org-startup-folded t)

Is this the fact that I still don't really understand emacs inner
workings/elisp... or am I sane in feeling that the documentation and
behavior is not intuitive?

Interestingly this reddit thread poses the exact same question, yet
one user thinks this is completely expected? That said, he/she both
says "non-nil" and therefore `t` works... but not why "overview" or
"fold" are also not equivalent to "non-nil"?
https://www.reddit.com/r/emacs/comments/izf6xe


Thanks for taking a look,
John



Re: Request to Unsubscribe

2021-10-01 Thread John Hendy
You may be able to do this yourself, but I'm not positive.

Perhaps try the bottom field of this page:
https://lists.gnu.org/mailman/listinfo/emacs-orgmode

Best regards,
John


On Fri, Oct 1, 2021 at 1:58 PM Jain, Rishabh  wrote:
>
> Hi:
>
> Hope you are doing well. I'd appreciate if you can help unsubscribe me from 
> the orgmode mailing list.
>
> Please let me know if you have any questions or concerns.
>
> Kind Regards,
> Rishabh



Adjust git redirect to [correct] savannah repo

2021-09-28 Thread John Hendy
Greetings,

I haven't updated org in quite some time. Doing my typical git pull, I
got this notice:

$ git pull
make clfatal: unable to update url base from redirection:
  asked for: 
https://code.orgmode.org/bzg/org-mode.git/info/refs?service=git-upload-pack
   redirect: 
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/?service=git-upload-pack

I tried manually using `git remote set-url` to force the savannah
address, but from looking at the docs, it seems it should just be
.../git/..., not the supplied .../cgit/..., which fails:

$ git remote set-url origin https://git.savannah.gnu.org/cgit/emacs/org-mode.git
$ git pull
fatal: repository
'https://git.savannah.gnu.org/cgit/emacs/org-mode.git/' not found

Looking at the savannah site, they provide these three clone URLs:
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/

#+begin_quote
Clone
git://git.savannah.gnu.org/emacs/org-mode.git
https://git.savannah.gnu.org/git/emacs/org-mode.git
ssh://git.savannah.gnu.org/srv/git/emacs/org-mode.git
#+end_quote

I'm just passing this along in case there are other lingering stale
updaters out there who might have this occur. Could the redirect at
code.orgmode.org be adjusted accordingly?


Best regards,
John



Re: Number format for table results outut from R data.frame/tibble

2021-08-21 Thread John Hendy
On Fri, Aug 6, 2021 at 2:30 PM Berry, Charles  wrote:
>
> John,
>
> > On Aug 6, 2021, at 8:38 AM, John Hendy  wrote:
> >
> > Greetings,
> >
> > I'm wondering how to align the results from the R buffer (which I
> > like) vs. the results printed by Org-mode for table results. Here's a
> > toy example:
> >
>
> `tbl_df' objects come with their own print/show method. And it does things 
> like add color and text formats. This is nice in a terminal, but not when you 
> want to display them in org.
>
> Turning off the color might be enough to give you a usable result:
>
> #+begin_src R :session foo :results output drawer
> library(tibble)
> options( cli.num_colors=1 )
> tmp <- tibble(x=1:5, y=x/pi)
> tmp
> #+end_src
>
> #+RESULTS:
> :results:
>
> # A tibble: 5 x 2
>   x y
>
> 1 1   0.3
> 2 2   0.6
> 3 3   1.
> 4 4   1.
> 5 5   2.
> :end:
>

Interesting, and thanks for taking a look. I don't think I specified
sufficiently that I'm actually aiming for latex/pdf output and
therefore want the org table. I can just add my own header row and get
booktabs formatting free upon export. If I keep with :results output,
the color options trick does remove a bunch of garbage from the
output... but :results value still yields:

#+RESULTS:
| 1 | 0.318309886183791 |
| 2 | 0.636619772367581 |
| 3 | 0.954929658551372 |
| 4 |  1.27323954473516 |
| 5 |  1.59154943091895 |

I was hoping there was a way to either (a) have org post-format or (b)
take the results as printed. I'm not sure on the exact mechanism used
which creates the mismatched output in the session vs. the table. I
get that behind the scenes I still have long, irrational numbers
here... it's just that if org can print them with x decimal places, is
there some way to get Org to intercept *those* values?

John

>
> If this is not close to what you need, I suggest writing your own formatting 
> function. If you have limited emacs-lisp skill, I suggest doing this in R.
>
> HTH,
>
> Chuck



Number format for table results outut from R data.frame/tibble

2021-08-06 Thread John Hendy
Greetings,

I'm wondering how to align the results from the R buffer (which I
like) vs. the results printed by Org-mode for table results. Here's a
toy example:

#+begin_src R :session foo :output results :type table :results value
library(tibble)

tmp <- tibble(x=1:5, y=x/pi)
tmp
#+end_src

In org, I get this:

#+RESULTS:
| 1 | 0.318309886183791 |
| 2 | 0.636619772367581 |
| 3 | 0.954929658551372 |
| 4 |  1.27323954473516 |
| 5 |  1.59154943091895 |

In the buffer, I get this:
  x y
   
1 1 0.318
2 2 0.637
3 3 0.955
4 4 1.27
5 5 1.59

>From the tibble side, R points one to the pillar package[1], which
indeed affects the output in the buffer, but not in the Org results.

#+begin_src R :session foo :output results :type table :results value
library(tibble)
library(pillar)

options(pillar.sigfig=1)
tmp <- tibble(x=1:5, y=x/pi)
tmp
#+end_src

# A tibble: 5 × 2
  x y
   
1 1   0.3
2 2   0.6
3 3   1.
4 4   1.
5 5   2.

The last example here touches on accomplish this[2]... but is the only
method to write an elisp block that post-process my R results? It
seems so enticing that R can output the correct format... can Org
latch onto the exact output somehow?

I also discovered the round_df package[3], so I could bring that into
the mix and round flexibly, it seems. I don't *really* want to round,
though, I just want more digestible output.

Many thanks for any pointers, I'm suspecting the answer is before my
eyes, but I haven't figured out the proper incantation of :results,
:type, :wrap, etc...


Best regards,
John


[1] https://pillar.r-lib.org/articles/digits.html
[2] https://orgmode.org/manual/Results-of-Evaluation.html
[3] https://rdrr.io/cran/forestmangr/man/round_df.html



Re: Large source block causes org-mode to be unusable

2021-06-21 Thread John Hendy
Indeed. The top google hit for "emacs fontify proof block slow" I provided
says exactly that :)

https://emacs.stackexchange.com/questions/46561/org-mode-9-too-slow-with-long-code-blocks
"""
That said, I think keeping 2000 lines of source code inside an org src
block is neither a standard use case nor a reasonable idea. You can use the
#+INCLUDE ... src ... directive or split the block into a number of more
reasonably sized cells. If you insist on keeping the entire block, then
disable native highlighting of src code blocks.
"""

On Mon, Jun 21, 2021 at 2:23 PM John Kitchin 
wrote:

> A quick and dirty way to fix this might be an include file, i.e. move
> the block out of your manuscript file into a separate org file, and then
> just include it.
>
> Léo Ackermann  writes:
>
> > Dear all,
> >
> > I am working in an org-file of reasonable size (<2000 lines): my first
> > paper written in org-mode. Everything fine (and fast) until I started to
> > add `#+BEGIN_proof / #+END_proof` within my .org to make my .pdf export
> > prettier. This caused the editing of the proofs to be very slow:
> navigation
> > within the proof is fast but adding/removing any char takes around 4s per
> > char.
> > It seems that the fontify function is responsible for that (see
> > screenshot). As far as I understand, this function tries to fontify the
> > whole block as soon as a single char is modified. In my case, it then
> tries
> > to fontify a whole proof (~4 pages in my .pdf, with many LaTeX formulas)
> > several times per second...
> >
> > Is there a way to make this fontify function to act "around my cursor" ?
> >
> > Best,
> > Leo
>
>
> --
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
> Pronouns: he/him/his
>
>


Re: issue in orgmode manual

2020-05-18 Thread John Hendy
I ran into this as well and did not see a response back from the list
yet. Emailed about just this issue last week.

https://www.mail-archive.com/emacs-orgmode@gnu.org/msg127933.html

John


On Sat, May 16, 2020 at 10:21 AM Max Mustermann
 wrote:
>
> Hey,
> On https://orgmode.org/manual/LaTeX-Export.html#Tables-in-LaTeX-export,
> 13.10.5 -13.10.11 refer back to its parent 13.10
> same with 13.9.6-13.9.11 and probably others.
>
> Sorry if this is already known or intended.
>
> Have a nice weekend.



Proper links for Latex documentation in manual

2020-05-06 Thread John Hendy
Greetings,

I was looking to see if there was a way to rotate images and refresh
myself on available attr_latex commands. Google took me here:

https://orgmode.org/manual/LaTeX-Export.html

Clicking "Images in LaTeX export" points here:

https://orgmode.org/manual/LaTeX-Export.html#Images-in-LaTeX-export

But nothing happens, I just stay on that page. I got to the previous
link from here:

https://orgmode.org/manual/Main-Index.html

Going back and clicking the link for "Images in LaTeX export" (instead
of attr_latex as I originally clicked) has the same effect.

I'm assuming this is not the desired behavior, as the first three
links go to LaTeX relevant pages, but the rest do not.


Best regards,
John



Re: Problem with LaTeX class scrlttr2

2020-04-03 Thread John Hendy
Thanks! Saves a lot of time to recreate an example.

I get the same error, but wouldn't you know I'm on TexLive 2019 which
must have just hit end of life... tlmgr says it's frozen and won't let
me try and add new packages. I do want to help but am not going to
update to 2020 for this :)

One thing popped out to me...

#+LATEX_CLASS: scrltttr2

Is that a typo (ttt, not tt)? If someone doesn't get to this before
me, I'll try again after I update TL 2020 over the weekend.

Best regards,
John

On Fri, Apr 3, 2020 at 8:26 PM Charles Millar  wrote:
>
> On 4/3/20 7:19 PM, John Hendy wrote:
> > Please attach an actual .org file so we can test/reproduce.
> >
>
> See attached
> > Generally "unknown latex class" means you don't have the package
> > installed. How about posting the output of this:
> >
> > $ tlmgr list --only-installed | grep scrlttr2
> >
>  >
> No output; however I have TeXlive package, Debian testing, installed. I
> found an example that uses scrlttr2 at
>
> https://tex.stackexchange.com/questions/229032/how-to-add-company-name-to-return-back-address-in-scrlttr2#229037
>
> and ran it using TexStudio - no problem, i.e. resulted with a letter. So
> I expect that scrlttr2 is installed as part of the TexLive komascript.
> >
> > On Fri, Apr 3, 2020 at 4:06 PM Charles Millar  wrote:
> >>
> >> I apologize for reposting - I forgot to complete my
> >>
> >>
> >>  Forwarded Message 
> >> Subject: Problem
> >> Date: Fri, 3 Apr 2020 16:49:15 -0400
> >> From: Charles Millar 
> >> To: emacs-orgmode@gnu.org 
> >>
> >> I am attempting to use ox-koma-letter, etc.
> >>
> >> My set up
> >>
> >> GNU Emacs 28.0.50 (build 84, x86_64-pc-linux-gnu, GTK+ Version 3.24.14,
> >> cairo version 1.16.0) of 2020-04-03
> >> Org mode version 9.3.6 (release_9.3.6-449-gb99357 @
> >> /usr/local/share/org-mode/lisp/)
> >>
> >> org-latex-classes includes
> >>
> >> "default-koma-letter" "\\documentclass[11pt]{scrlttr2}"
> >>
> >> There are no other entries that include scrlttr2 in org-latex-classes
> >>
> >> I have a barebones header
> >>
> >> #+LATEX_CLASS: scrlttr2 (I also have tried 'default-koma-letter')
> >>
> >> and then entered the Romeo to Juliet letter
> >>
> >> and i receive the following error
> >>
> >> Unknown LaTex class scrlttr2
> >>
> >> I searched the list and one suggested problem does not seem to be
> >> applicable - I do not have a mixed org installation.
> >>
> >> Any suggestions.
> >>
> >> Charlie Millar
> >>
> >
> >
>



Re: Problem with LaTeX class scrlttr2

2020-04-03 Thread John Hendy
Please attach an actual .org file so we can test/reproduce.

Generally "unknown latex class" means you don't have the package
installed. How about posting the output of this:

$ tlmgr list --only-installed | grep scrlttr2

John

On Fri, Apr 3, 2020 at 4:06 PM Charles Millar  wrote:
>
> I apologize for reposting - I forgot to complete my
>
>
>  Forwarded Message 
> Subject: Problem
> Date: Fri, 3 Apr 2020 16:49:15 -0400
> From: Charles Millar 
> To: emacs-orgmode@gnu.org 
>
> I am attempting to use ox-koma-letter, etc.
>
> My set up
>
> GNU Emacs 28.0.50 (build 84, x86_64-pc-linux-gnu, GTK+ Version 3.24.14,
> cairo version 1.16.0) of 2020-04-03
> Org mode version 9.3.6 (release_9.3.6-449-gb99357 @
> /usr/local/share/org-mode/lisp/)
>
> org-latex-classes includes
>
> "default-koma-letter" "\\documentclass[11pt]{scrlttr2}"
>
> There are no other entries that include scrlttr2 in org-latex-classes
>
> I have a barebones header
>
> #+LATEX_CLASS: scrlttr2 (I also have tried 'default-koma-letter')
>
> and then entered the Romeo to Juliet letter
>
> and i receive the following error
>
> Unknown LaTex class scrlttr2
>
> I searched the list and one suggested problem does not seem to be
> applicable - I do not have a mixed org installation.
>
> Any suggestions.
>
> Charlie Millar
>



Re: rmarkdown-like production of multiple plots in org

2020-03-31 Thread John Hendy
On Tue, Mar 31, 2020 at 2:22 PM Matt Price  wrote:
>
> I'm completely new to R.
>
> I've started working with a project that creates plots using the ggplot 
> package -- so by default it creates grid objects, rather than writing to 
> files.
>
> In rmarkdown/rstudio, I can write something like this in a SOMEFILE.Rmd :
>
> ```
> install_github('eeholmes/CoV19')
> library(CoV19)
> getdata();
> plot4(world, 'Ontario Canada')
> plot2(world, 'Italy')
> plot4(states, "WA")
> ```
>

Interesting. I hadn't really thought that approach through. For
exploratory analysis, this sounds awesome and I don't think I've ever
tried multiple plots in a single chunk in RStudio. Only after seeing
Thomas' reply just now did I realize this isn't just plot(), though...
where are those functions from? There might be hidden conveniences
that don't apply to pure ggplot() calls... dunno.

I will add that as soon as you want to start tailoring sizes or how
these appear in the resultant file, I think you'd have to split these
into separate chunks in order to set the options, no?

> I sort of love how the rmarkdown package will just create all 3 of those 
> plots, save them to auto-named files, and render to HTML.  In RStudio, 
> running just that block will also create all three blocks and display them in 
> the editor.
>
> By contrast, creating a series of many plots in org is fairly tedious.  I 
> have to name the plot individually & put each function call in its own src 
> block. Is there any way to mimic the behaviour of rmarkdown instead? I odn't 
> understand babel or R enough to really even see how something like that could 
> be implemented, but I'd appreciate some pointers.  Thank you!

Perhaps an alternative is running all your plots in one block, but
using ggsave() (or similar) to save out the files directly (vs. using
:output/:file to do it). Then you could have file links in the org
file instead of the typical 1:1 match-up of a single block to a single
result. I did this once during an effort to optimize a neural network.
I had a big loop iterating through parameters, and would
programmatically save out one residual plot per combination, e.g.
model_var1-value_var2-value_etc.png, I also generated an org-mode
section and exported headers for each combination, embedding the
corresponding [[./plots/foo.png]] image link within that heading.
Exporting to pdf let me page through all my residual plots handily to
compare them.

Anyway, maybe something helpful in there?

John



Re: default units for graphics in R code blocks

2020-03-30 Thread John Hendy
Bummer, that does indeed read pretty straightforwardly about inches.
Sorry about that.

Thanks for your efforts. I find org documentation challenging at
times, and am still not clear on worg vs. org. I believe I've asked on
this list before why those pages exist, as this seems like it should
be in the org official docs vs. in a sort of tutorial site. It makes
it tough as you can't find certain header args in the org docs; you
have to kind of know what you're looking for, or at least that the
header arg is *only* for, say, R, and not for anything else.

Anyway, thanks for contributing!

Best,
John

On Mon, Mar 30, 2020 at 11:58 AM Tyler Smith  wrote:
>
> John Hendy writes:
>
> >
> > Best to cite exactly which article you're referring to. Trying to look
> > myself, for example, found me this as the only worg hit from googling
> > "worg R plotting":
> > - https://orgmode.org/worg/org-tutorials/org-R/org-R.html
> > """
> > Output options
> > height:1000set height of graphical output in (pixels for png, jpeg,
> > bmp, tiff; default 480) / (inches for pdf, ps; default 7)
> > width:1000set width of graphical output in pixels (default 480 for png)
> > """
> >
> The article I was referring to is:
>
> https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html
>
> The tutorial you found suggests the corrections needed in the one I
> found; I can do that now!
>
> Tyler
>
>
> > It seems that aligns with my recollection, but may very well differ
> > from the article you found. Thanks for any edits/corrections you make!
> >
> > Best regards,
> > John
> >
> >>
> >> Best,
> >>
> >> Tyler
> >>
> >>
> >>
> >> --
> >> Tyler Smith
> >> http://plantarum.ca
> >>
>
>
> --
> Tyler Smith
> http://plantarum.ca



Re: default units for graphics in R code blocks

2020-03-30 Thread John Hendy
On Mon, Mar 30, 2020 at 10:45 AM Tyler Smith  wrote:
>
> Hi,
>
> The worg documentation for R code indicates the default units for
> graphics output is 'in', inches. However, when I try the following:
>
> #+begin_src R :results file graphics :file ca.jpg :width 8 :height 11
>   plot(1:10)
> #+end_src
>
> I get an error noting the margins are too large. If I change the width
> and height arguments to 800, it works just fine, and the resulting image
> is pretty small.

When you examine the properties of this "pretty small" resulting
image, is the size equal to 800 x 800px?

> I can also get a working image by specifying units as in and res as 100.
>
> I conclude from this that the default units are actually pixels? Is that
> correct? If so I can update the docs.

I'd have to look deeper/test to confirm, but believe the units are
according to the output device. I'm near certain, for example, that
PDF output is in inches. I think png and jpg may both be px. It may
not be consistent/universal is my point!

Edit before sending:

Best to cite exactly which article you're referring to. Trying to look
myself, for example, found me this as the only worg hit from googling
"worg R plotting":
- https://orgmode.org/worg/org-tutorials/org-R/org-R.html
"""
Output options
height:1000set height of graphical output in (pixels for png, jpeg,
bmp, tiff; default 480) / (inches for pdf, ps; default 7)
width:1000set width of graphical output in pixels (default 480 for png)
"""

It seems that aligns with my recollection, but may very well differ
from the article you found. Thanks for any edits/corrections you make!

Best regards,
John

>
> Best,
>
> Tyler
>
>
>
> --
> Tyler Smith
> http://plantarum.ca
>



Re: LaTeX export failure

2020-01-29 Thread John Hendy
On Wed, Jan 29, 2020 at 2:32 PM Thomas S. Dye  wrote:
>
> Happy New Year!
>
> Returning to a writing project after a few months absence, I'm no
> longer able to export the writing project subtree.  Here is what I
> find in *Messages*:
>
>   Wrote /home/dk/Projects/historical-inference/r14c.org
>   executing Shell code block...
>   Wrote /tmp/babel-j0SOWm/ob-input-aS23DO
>   Code block evaluation complete.
>   match-string-no-properties: Args out of range: #,
>   3, 11
>

Are you able to share a portion of this? Or have you tried, say,
creating a copy of the file and removing all but the first heading and
a sentence to see if it fails?

Someone else might recognize that particular failure from past
experience, but I'd have to try something locally. In the past to
debug I've moved all headings after the first under a new one, marked
that as :noexport:, and exported iteratively, moving each one out of
the :noexport: heading until I find the offending one. Then I can hone
in on where I should be looking.

John

> The writing project exported without issue on November 7, 2019.
>
> I'm typically using up-to-date org-plus-contrib from Elpa, so
> suspect my issue is due to a recent change in Org mode.
>
> I don't know how to track down the problem.  Any ideas?
>
> All the best,
> Tom
> --
> Thomas S. Dye
> https://tsdye.online/tsdye
>



Re: Keyboard macros and export dispatcher

2020-01-09 Thread John Hendy
On Thu, Jan 9, 2020 at 12:24 PM Jack Kamm  wrote:
>
> Hello,
>
> I have an org-mode file, and am exporting one of its subtrees to a
> beamer presentation.
>
> I would like to use a keyboard macro for this, because re-exporting the
> presentation requires a lot of keypresses:
> - Jump to the appropriate heading
> - Start the dispatcher
> - Toggle subtree export (C-s)
> - Finally, export
>
> So, I defined a keyboard macro to do all this, but when I try to run it,
> Emacs simply hangs, and I need to quit with C-g. I think this might be
> the fault of the export dispatcher, but am not sure.

Funny timing. I have used Org for maybe 10 years and just found about
about macros yesterday! I have a spreadsheet with reference
information per work group, coded up some R code to spit out a
tree-per-group, and then wanted to export these 51 documents to their
own PDFs. I've done this before, but got sick of `C-e C-s l p` for
every one so I looked into it. I had no problem doing the following:

- C-x (
- C-e C-s l p C-n
- C-x )
- go to first of my results headlines
- C-u 51 C-x e

It sounds like you already tried this... are you using `C-x (` or are
you defining the macros via elisp? If the latter, can we see the code?
Anything in the Messages buffer? I had an error yesterday and realized
that some of the group names were "Foo/Bar" and since my code titles
the tree's :export_file_name property according to the group name,
emacs was interpreting the `/` in the filename as a directory that
didn't exist.

My suggestion:
- give us a stripped down, beamer file so we can reproduce (maybe with
one non-exporting headline and an analog of your target subtree to
export)
- tell us what you run manually to accomplish your goal
- give us the exact details of your macro setup

John

>
> Anyone have ideas on what's going wrong here, or on alternative
> approaches to achieve what I want?
>
> Thanks,
> Jack
>



Re: Publish to PDF on Linux: An impossible task?

2019-11-10 Thread John Hendy
On Sun, Nov 10, 2019 at 6:41 PM Marcin Borkowski  wrote:
>
>
> On 2019-11-11, at 01:25, John Hendy  wrote:
>
> > On Sun, Nov 10, 2019 at 6:01 PM Nathan Neff  wrote:
> >>
> >> After using org-mode for 10 years, I run for the doorway when
> >> I even think about trying to convert an org-mode file to PDF.
> >>
> >> *** I quiver when I see errors such as:
> >>
> >> warning: kpathsea: configuration file texmf.cnf not found in these 
> >> directories: 
> >> /usr/bin:/usr/bin/share/texmf-local/web2c:/usr/bin/share/texmf-dist/web2c:/usr/bin/share/texmf/web2c:/usr/bin/texmf-local/web2c:/usr/bin/texmf-dist/web2c:/usr/bin/texmf/web2c:/usr:/usr/share/texmf-local/web2c:/usr/share/texmf-dist/web2c:/usr/share/texmf/web2c:/usr/texmf-local/web2c:/usr/texmf-dist/web2c:/usr/texmf/web2c://texmf-local/web2c:/://share/texmf-local/web2c://share/texmf-dist/web2c://share/texmf/web2c://texmf-local/web2c://texmf-dist/web2c://texmf/web2c.
> >> This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Arch Linux) 
> >> (preloaded format=pdflatex)
> >>
> >> kpathsea: Running mktexfmt pdflatex.fmt
> >> mktexfmt: No such file or directory
> >> I can't find the format file `pdflatex.fmt'!
> >
> > These look like latex errors to me, nothing to do with Org. Guessing
>
> These are not LaTeX errors, they are lower-level ones.

By "LaTeX" I mean "that which is necessary to have a functioning latex
system." If by lower-level you mean the ecosystem itself vs. compiling
errors, completely agree. Clearly some core components are missing.
For example, the texmf.cnf file is provided by the arch package
texlive-core (assuming a package was used), so that's potentially not
even installed.
- https://www.archlinux.org/packages/extra/any/texlive-core/

> > you used the arch package? I'm on arch myself, but after getting
> > bitten by package mismatches and things being hopelessly broken, I
> > switched to just using texlive directly:
> > - https://www.tug.org/texlive/
> >
> > It's not that bad. There's even a quick guide to walk you through the
> > tl-install script. If you'd rather troubleshoot what you have going on
> > now, here's some places to start:
> > - you're missing files... figure out which package is supposed to
> > provide them and install it
>
> He misses LaTeX format file itself, and apparently mktexfmt (which
> should create it) cannot be found.  This seems more serious than what
> you write.

I would divide "serious" into "major but simple" and "complicated." In
easily 90% of cases with error output like this, it's going to be a
missing package, not some intricate system glitch that requires
troubleshooting. Indeed, my guess is exactly that: there are "serious"
errors because nothing resembling a functioning latex system exists.
The root cause is probably very simple.

> > - check your paths
>
> Agreed, but this may be quite subtle...

Again, I suspect much simpler. When using texlive directly, for
example, one has to set paths correctly. This If it's looking in
system paths vs. a user path (e.g. I install to ~/.texlive, not /usr)
and this was not set via .bashrc, that's what I mean one should check.
This presumes the expected packages are installed at all.

I would start with simply:

$ pacman -Q |grep tex

and

$ which pdflatex

John

>
> Best,
>
> --
> Marcin Borkowski
> http://mbork.pl



Re: Publish to PDF on Linux: An impossible task?

2019-11-10 Thread John Hendy
On Sun, Nov 10, 2019 at 6:01 PM Nathan Neff  wrote:
>
> After using org-mode for 10 years, I run for the doorway when
> I even think about trying to convert an org-mode file to PDF.
>
> *** I quiver when I see errors such as:
>
> warning: kpathsea: configuration file texmf.cnf not found in these 
> directories: 
> /usr/bin:/usr/bin/share/texmf-local/web2c:/usr/bin/share/texmf-dist/web2c:/usr/bin/share/texmf/web2c:/usr/bin/texmf-local/web2c:/usr/bin/texmf-dist/web2c:/usr/bin/texmf/web2c:/usr:/usr/share/texmf-local/web2c:/usr/share/texmf-dist/web2c:/usr/share/texmf/web2c:/usr/texmf-local/web2c:/usr/texmf-dist/web2c:/usr/texmf/web2c://texmf-local/web2c:/://share/texmf-local/web2c://share/texmf-dist/web2c://share/texmf/web2c://texmf-local/web2c://texmf-dist/web2c://texmf/web2c.
> This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Arch Linux) 
> (preloaded format=pdflatex)
>
> kpathsea: Running mktexfmt pdflatex.fmt
> mktexfmt: No such file or directory
> I can't find the format file `pdflatex.fmt'!

These look like latex errors to me, nothing to do with Org. Guessing
you used the arch package? I'm on arch myself, but after getting
bitten by package mismatches and things being hopelessly broken, I
switched to just using texlive directly:
- https://www.tug.org/texlive/

It's not that bad. There's even a quick guide to walk you through the
tl-install script. If you'd rather troubleshoot what you have going on
now, here's some places to start:
- you're missing files... figure out which package is supposed to
provide them and install it
- check your paths
- google the error and see what you find

> *** I run for cover when I read documentation such as:
>
> https://orgmode.org/manual/LaTeX-Export.html#LaTeX-Export
>
> I think people who have been using LaTex and related tools for a long time 
> have
> no issue with this (seemingly) insurmountable feat.  However, I am not 
> familiar with
> such a myriad of tools and I'm simply looking for the "easiest" way to 
> convert/export an org
> mode file to PDF on Linux.

I would save this for last. For now, just take your document and
export to the .tex file (don't compile). Then go to a command line and
do:

$ pdflatex ./file.tex

and see what happens. Until you can do that manually, nothing from the
Org side will help you. In fact, Org just assumes that this stuff
exists, spits out the right .tex file based on your markdown, and
leverages the existing latex system utilities to process it. This will
end up being that you don't have a functioning latex setup on your
system, and thus Org can't work its magic.


John

>
> Can anyone point me to some tutorials?  I'm sorry if I miss something obvious.
>
> Thanks,
> --Nate



Re: Refresher on including R/ggplot2 output via latex/pdf?

2019-10-29 Thread John Hendy
On Tue, Oct 29, 2019 at 9:51 AM Jack Kamm  wrote:
>
> > Closing the loop. I can confirm that my example works on this commit
> > (one before the relevant change) (thanks, Chuck!).
> >
> > commit ed9bdfd220b75233e5bae2ef39164d14624060fa (HEAD)
> > Merge: 0954d4c25 0ae2e656d
> > Author: Marco Wahl 
> > Date:   Fri Oct 5 00:54:19 2018 +0200
> >
> > Completely stumped on how that works for you.
>
> My version of org-mode is from September 30, shortly before this commit,
> I guess that's why it still works for me. Though I'm confused why the
> example didn't work for you on your older version of Org from June.

Chuck clarified offline that the commit is from Oct *2018*, not 2019.
Both 9.2.4 and 9.2.6 are much more recent.

At least I interpret your response as thinking this is a recent change
(which is exactly what I thought at first!)?

John

> I guess I'll have to prepare for some breakage with ob-R next time I
> update -- thanks for the heads up on this. I'll test it out and report
> my findings when I get a chance.



Re: Refresher on including R/ggplot2 output via latex/pdf?

2019-10-29 Thread John Hendy
On Mon, Oct 28, 2019 at 12:46 PM Jack Kamm  wrote:
>
> > 2) why does this [still] work for Jack? (Jack, what's M-x org-version for 
> > you?)
>
> I tested on my laptop and desktop, both work for me, they are running the 
> following 2 versions of org:
>
> Org mode version 9.2.4 (9.2.4-13-g9a543b-elpaplus @ 
> /home/jack/.emacs.d/elpa/org-plus-contrib-20190729/)
> Org mode version 9.2.6 (9.2.6-4-ge30905-elpaplus @ 
> /home/jack/.emacs.d/elpa/org-plus-contrib-20190930/)

Closing the loop. I can confirm that my example works on this commit
(one before the relevant change) (thanks, Chuck!).

commit ed9bdfd220b75233e5bae2ef39164d14624060fa (HEAD)
Merge: 0954d4c25 0ae2e656d
Author: Marco Wahl 
Date:   Fri Oct 5 00:54:19 2018 +0200

Completely stumped on how that works for you.

My final question; is the documentation accurate, or more accurately,
is it unambiguous?

14.8.2.2 :results
file Interpret as path to a file. Inserts a link to the file. Usage
example: :results value file.

14.8.2.3 :file
An external :file that saves the results of execution of the code
block... A link to the file is inserted.

As written, using :results file and :file both claim to insert a link
to the file. Should this be clarified?

Thanks all,
John



Re: Refresher on including R/ggplot2 output via latex/pdf?

2019-10-28 Thread John Hendy
On Mon, Oct 28, 2019 at 11:22 AM Berry, Charles  wrote:
>
>
>
> > On Oct 28, 2019, at 12:43 AM, John Hendy  wrote:
> >
> > On Mon, Oct 28, 2019 at 1:14 AM Jack Kamm  wrote:
> >>
> >>> This is with emacs -Q and loading the minimal config from the initial
> >>> email. Any ideas on where I might look next?
> >>
> >> Sorry, I don't have many ideas here. Have you checked that ggplot works 
> >> fine in a regular R session?
> >
> > Indeed, it does. And as mentioned, if I used :results file graphics,
> > everything works. It's able to plot and write to file... the magic
> > just isn't happening with :results output graphics for some reason.
> >
> >
>
>
> To wit:
>
> commit 5c55d3a53c982563c0409e342b8940009e1409f2
> Author: Nicolas Goaziou 
> Date:   Sat Aug 24 00:04:06 2019 +0200
>
> manual: Remove erroneous footnote about :file header argument
>
> * doc/org-manual.org (Type): :file header argument no longer
> implies :results file.
>
> commit 26ed66b23335eb389f1f2859e409f46f66279e15
> Author: Nicolas Goaziou 
> Date:   Sat Oct 6 08:56:05 2018 +0200
>
> ob: :file and :file-ext no longer imply :results file
>
> * lisp/ob-core.el (org-babel-execute-src-block): ":results file" must
>   be specified in order to return a file.
> (org-babel-merge-params): :file and :file-ext no longer imply :results
> file.
> * testing/lisp/test-ob.el (test-ob/indented-cached-org-bracket-link):
> (test-ob/result-file-link-type-header-argument):
> (test-ob/result-graphics-link-type-header-argument): Update tests.
>
> Deducing the results from some other arguments is not obvious.
> Moreover, it prevents users from setting, e.g., :file-ext, in a node
> property, as every block would then create a file.
>
> Reported-by: Alex Fenton 
> <http://lists.gnu.org/r/emacs-orgmode/2018-05/msg00469.html>

Ok, this is promising. How do we explain the results, though?

I had this issue in the original post on:

Org mode version 9.2.4 (release_9.2.4-381-g226363 @
/home/jwhendy/.elisp/org/lisp/)

commit 226363482305d596bfb91e50246eb82d78689795
Author: Nicolas Goaziou 
Date:   Sat Jun 22 09:33:33 2019 +0200

Then I updated and still got the same behavior on:

Org mode version 9.2.6 (release_9.2.6-559-ga01a8f @
/home/jwhendy/.elisp/org/lisp/)

commit a01a8f55d8bf259ebecc050c162c48e29da13bee (HEAD -> master,
origin/master, origin/HEAD)
Merge: 58ceff522 9c611fd8a
Author: Kyle Meyer 
Date:   Sun Oct 27 15:55:30 2019 -0400

My questions:

1) why didn't my example work for me on the commit from Jun 22 (< Aug or Oct)
2) why does this [still] work for Jack? (Jack, what's M-x org-version for you?)
3) optionally: can you reproduce the issue?

Thanks,
John

> HTH,
>
> Chuck
>
>
>



Re: Refresher on including R/ggplot2 output via latex/pdf?

2019-10-28 Thread John Hendy
On Mon, Oct 28, 2019 at 1:14 AM Jack Kamm  wrote:
>
> > This is with emacs -Q and loading the minimal config from the initial
> > email. Any ideas on where I might look next?
>
> Sorry, I don't have many ideas here. Have you checked that ggplot works fine 
> in a regular R session?

Indeed, it does. And as mentioned, if I used :results file graphics,
everything works. It's able to plot and write to file... the magic
just isn't happening with :results output graphics for some reason.

> I tried again with emacs -Q and the minimal config below and it still worked 
> fine for me:
>
> 
> ;; set load paths
> ;; set load dirs and global config options
> (add-to-list 'load-path "~/.emacs.d/elpa/org-plus-contrib-20190729/")
> (add-to-list 'load-path "~/.emacs.d/elpa/ess-20190627.1806/")
>
> (require 'ess)
> (require 'ess-r-mode)
>
> ; setup babel languages
> (org-babel-do-load-languages
>  'org-babel-load-languages
>  '((R . t)))
> 



Re: Refresher on including R/ggplot2 output via latex/pdf?

2019-10-27 Thread John Hendy
On Mon, Oct 28, 2019 at 12:02 AM Jack Kamm  wrote:
>
> John Hendy  writes:
>
> > On Sun, Oct 27, 2019 at 11:31 PM Jack Kamm  wrote:
> >>
> >> Your code block looks fine to me. The typical R code block headers I use 
> >> is as follows:
> >
> > Did you try to reproduce my example, by chance?
>
> I've just now tried executing/exporting your example code blocks, and
> they worked fine for me.
>
> When I execute them I get a link to a result png inserted into the
> buffer, and when I export to latex/pdf I get the plot image inserted
> correctly into the PDF.
>
> This is for the example code blocks in both the original and reply
> emails, with and without the :session header.

Wow, I'm stumped then. I just did a git pull and make clean/make and
still get the same results.

Org mode version 9.2.6 (release_9.2.6-559-ga01a8f @
/home/jwhendy/.elisp/org/lisp/)

This is my full file after C-c C-c on the block:
-
* test

#+begin_src R :session :results output graphics :file foo.png :exports
results :eval never-export
library(ggplot2)

df <- data.frame(x=c(1, 2), y=c(2, 4))
p <- ggplot(df, aes(x = x, y = y)) + geom_point()
print(p)

#+end_src

#+RESULTS:
-

This is with emacs -Q and loading the minimal config from the initial
email. Any ideas on where I might look next?

John



Re: Refresher on including R/ggplot2 output via latex/pdf?

2019-10-27 Thread John Hendy
On Sun, Oct 27, 2019 at 11:31 PM Jack Kamm  wrote:
>
> Your code block looks fine to me. The typical R code block headers I use is 
> as follows:

Did you try to reproduce my example, by chance?

> :session :results output graphics :file path/to/file.png :exports results 
> :eval never-export

Using this:
-
#+begin_src R :session :results output graphics :file foo.png :exports
results :eval never-export
library(ggplot2)

df <- data.frame(x=c(1, 2), y=c(2, 4))
p <- ggplot(df, aes(x = x, y = y)) + geom_point()
print(p)
#+end_src
-

I get an empty #+RESULTS: header, but no inserted file link. The plot
is not in the exported PDF either.

If I make it this:
-
#+begin_src R :session :results file graphics :file foo.png :exports
results :eval never-export
-

I get the expected results, and the plot is in the output PDF.
-
#+RESULTS:
[[file:foo.png]]
-

> One thing I've noticed, if I have an existing graphics device open, it
> can mess up plots when executing an org-babel cell. Calling dev.off() a
> few times fixes this for me.
>
> Note I pretty much always use R blocks with the :session argument,
> things might be pretty different without it.

I usually use :session as well (and have it in my actual document, but
left it off for this test case). Still, using your header (minus
changing the file path/type) didn't work for me.

Thanks for taking a look,
John



Refresher on including R/ggplot2 output via latex/pdf?

2019-10-27 Thread John Hendy
Greetings,

I used to use orgmode + R/ggplot2 for some time, but for various
reasons I've been using python almost exclusively for a couple years.
I just went to use what I think is how I used to include ggplot2
results in PDF experts, but it's not working.

In referring to the documentation, this is listed as an example:
- https://orgmode.org/worg/org-contrib/babel/languages/ob-doc-R.html#org046a0ff

* does produce a file, by using :results output
#+begin_src R :file 3.png :results output graphics
library(lattice)
xyplot(1:10 ~ 1:10)
#+end_src

My test file:
-
* test

#+begin_src R :results output graphics :exports results :file foo.png
library(ggplot2)

df <- data.frame(x=c(1, 2), y=c(2, 4))
p <- ggplot(df, aes(x = x, y = y)) + geom_point()
print(p)
#+end_src
-

I'm using emacs -Q, followed by M-x load-file RET path/to/min-config:
-
;; set load paths
;; set load dirs and global config options
(add-to-list 'load-path "~/.elisp/org/lisp/")
(add-to-list 'load-path "~/.elisp/org/contrib/lisp/")
(add-to-list 'load-path "~/.elisp/ess/lisp/")

(require 'ess-site)

; setup babel languages
(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)))
-

M-x org-version: Org mode version 9.2.4 (release_9.2.4-381-g226363 @
/home/jwhendy/.elisp/org/lisp/)

When I run the code, the #+RESULTS: output is just blank. foo.png *is*
generated, but the file link ([[foo.png]]) I'd expect is not getting
inserted. It also, unsurprisingly, does not show in the file.

Hmmm. One last hail Mary google incantation before I sent this off
suggests that perhaps it's :results file now? Or :results graphics
file?
- 
https://stackoverflow.com/questions/50054520/python-vs-r-in-org-mode-babel-output-graphics

Thanks for any pointers. I'd be happy to assist with updated
documentation if the earlier link is now outdated/incorrect.


Best regards,
John



Re: [O] minimal testing setup for pdf export?

2019-08-30 Thread John Hendy
Whew, the world is whole again! No worries, and I've been in the exact
same situation more than I'd like. We joke at work that if you want to
fix a problem, just ask someone to come watch it happen and it will
magically go away :)

Glad you're on your way!
John

On Fri, Aug 30, 2019 at 9:27 AM Matt Price  wrote:
>
>
>
> On Thu, Aug 29, 2019 at 11:27 AM John Hendy  wrote:
>>
>> On Tue, Aug 27, 2019 at 6:34 PM Matt Price  wrote:
>> >
>> >
>> >
>> > On Tue, Aug 27, 2019 at 1:33 PM John Kitchin  
>> > wrote:
>> >>
>> >> that does suggest that pdflatex is getting called somewhere else.
>> >>
>> >> Maybe you can edebug the export function and check the value of 
>> >> default-directory to see where it is getting called.
>> >>
>> >> You could also try this
>> >>
>> >> #+BEGIN_SRC emacs-lisp
>> >> (defun my-build (quoted-tex-file)
>> >>   (message "Building %s. Called from %s" quoted-tex-file 
>> >> default-directory))
>> >>
>> >> (setq org-latex-pdf-process 'my-build)
>> >> #+END_SRC
>> >>
>> >> It won't build the pdf, but it will tell you in the messages where it was 
>> >> called from. It might help figure out what is happening.
>> >
>> >
>> > huh.  that was kinda cool... but the value of default-directory seems to 
>> > be correct.  However, this helped a bit:
>> >
>> > #+BEGIN_SRC emacs-lisp
>> > (shell-command-to-string "echo $PWD")
>> >
>> > #+END_SRC
>> >
>> >
>> > #+RESULTS:
>> > : /home/matt/src/org-mode
>> >
>> > Not sure what's going on here, but this value is the same in a regular 
>> > emacs and  "emacs -Q".  is this normal?
>> >
>>
>> Did this get solved? It kind of bothers me to think it hasn't. I also
>> think this is a case where erring on the side of overwhelming details
>> would help a lot. Could you start from the beginning with the exact
>> process using emacs -Q, post the full output of *Messages* and *Org
>> PDF LaTeX Output*? Like in the above, you post the output of $PWD, but
>> not what the *Messages* buffer contained from John's code. Maybe they
>> are the same, maybe they are different, but we can't tell.
>>
>> Example:
>> $ cd ~/
>> $ emacs -Q
>>
>> M-x org-version
>> Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @
>> /usr/share/emacs/26.2/lisp/org/)
>>
>> C-x C-f pdf-test.org
>>
>> File contents:
>> * foo
>> 
>>
>> C-x C-s
>> C-c C-e l p
>>
>> $ ls ~/
>> pdf-test.org
>> pdf-test.pdf
>> pdf-test.tex
>>
>> Alternatively, insert the code from John Kitchin:
>>
>> Wrote /home/jwhendy/pdf-text.org
>> org-babel-exp process emacs-lisp at position 8...
>> Saving file /home/jwhendy/pdf-text.tex...
>> Wrote /home/jwhendy/pdf-text.tex
>> Processing LaTeX file pdf-text.tex...
>> Building pdf-text.tex. Called from /home/jwhendy/
>> org-compile-file: File "/home/jwhendy/pdf-text.pdf" wasn’t produced.
>> See "*Org PDF LaTeX Output*" for details
>>
>> I still don't feel I understand the full nature of your working
>> directory, what does and doesn't get saved in that directory, etc. I'd
>> love to help, but am not able to replicate for you!
>>
>> Thanks,
>> John
>>
> John H,
> Thank you so much for the detailed instructions. I had a moment this morning 
> so I updated Emacs, rebooted my laptop, and started to follow your 
> instructions as closely as possible... and I can no longer reproduce my 
> problem. I feel like I should be happier than I am! I wonder if perhaps there 
> was some kind of strange path problem caused by a software update that I 
> didn't pay attention to.
>
> In any case, I am as always grateful for the efforts of people on this list 
> -- I learned at least a little bit about latex export and feel that I might 
> finally be getting a little closer to where I need to be.
>
> Meanwhile, if the issue shows up again I'll be sure to check back in.
>
> Thanks!
> Matt
>
>
>>
>>
>> >
>> >> John
>> >>
>> >> ---
>> >> Professor John Kitchin
>> >> Doherty Hall A207F
>> >> Department of Chemical Engineering
>> >> Carnegie Mellon University
>> >> Pittsburgh, PA 15213
>> >> 412-268-7803
>> >> @jo

Re: [O] minimal testing setup for pdf export?

2019-08-29 Thread John Hendy
On Tue, Aug 27, 2019 at 6:34 PM Matt Price  wrote:
>
>
>
> On Tue, Aug 27, 2019 at 1:33 PM John Kitchin  wrote:
>>
>> that does suggest that pdflatex is getting called somewhere else.
>>
>> Maybe you can edebug the export function and check the value of 
>> default-directory to see where it is getting called.
>>
>> You could also try this
>>
>> #+BEGIN_SRC emacs-lisp
>> (defun my-build (quoted-tex-file)
>>   (message "Building %s. Called from %s" quoted-tex-file default-directory))
>>
>> (setq org-latex-pdf-process 'my-build)
>> #+END_SRC
>>
>> It won't build the pdf, but it will tell you in the messages where it was 
>> called from. It might help figure out what is happening.
>
>
> huh.  that was kinda cool... but the value of default-directory seems to be 
> correct.  However, this helped a bit:
>
> #+BEGIN_SRC emacs-lisp
> (shell-command-to-string "echo $PWD")
>
> #+END_SRC
>
>
> #+RESULTS:
> : /home/matt/src/org-mode
>
> Not sure what's going on here, but this value is the same in a regular emacs 
> and  "emacs -Q".  is this normal?
>

Did this get solved? It kind of bothers me to think it hasn't. I also
think this is a case where erring on the side of overwhelming details
would help a lot. Could you start from the beginning with the exact
process using emacs -Q, post the full output of *Messages* and *Org
PDF LaTeX Output*? Like in the above, you post the output of $PWD, but
not what the *Messages* buffer contained from John's code. Maybe they
are the same, maybe they are different, but we can't tell.

Example:
$ cd ~/
$ emacs -Q

M-x org-version
Org mode version 9.1.9 (release_9.1.9-65-g5e4542 @
/usr/share/emacs/26.2/lisp/org/)

C-x C-f pdf-test.org

File contents:
* foo


C-x C-s
C-c C-e l p

$ ls ~/
pdf-test.org
pdf-test.pdf
pdf-test.tex

Alternatively, insert the code from John Kitchin:

Wrote /home/jwhendy/pdf-text.org
org-babel-exp process emacs-lisp at position 8...
Saving file /home/jwhendy/pdf-text.tex...
Wrote /home/jwhendy/pdf-text.tex
Processing LaTeX file pdf-text.tex...
Building pdf-text.tex. Called from /home/jwhendy/
org-compile-file: File "/home/jwhendy/pdf-text.pdf" wasn’t produced.
See "*Org PDF LaTeX Output*" for details

I still don't feel I understand the full nature of your working
directory, what does and doesn't get saved in that directory, etc. I'd
love to help, but am not able to replicate for you!

Thanks,
John




>
>> John
>>
>> ---
>> Professor John Kitchin
>> Doherty Hall A207F
>> Department of Chemical Engineering
>> Carnegie Mellon University
>> Pittsburgh, PA 15213
>> 412-268-7803
>> @johnkitchin
>> http://kitchingroup.cheme.cmu.edu
>>
>>
>>
>> On Tue, Aug 27, 2019 at 8:57 AM Matt Price  wrote:
>>>
>>>
>>>
>>> On Tue, Aug 27, 2019 at 8:27 AM John Kitchin  
>>> wrote:

 Can you manually compile the empty.tex file from the command line? eg

 pdflatex empty

>>> (reposting to group)
>>>
>>> pdflatex empty
>>>
>>> Seems to work fine. Hmmm...

 John

 ---
 Professor John Kitchin
 Doherty Hall A207F
 Department of Chemical Engineering
 Carnegie Mellon University
 Pittsburgh, PA 15213
 412-268-7803
 @johnkitchin
 http://kitchingroup.cheme.cmu.edu



 On Tue, Aug 27, 2019 at 7:57 AM Julius Dittmar  
 wrote:
>
> Am 27.08.19 um 12:34 schrieb Matt Price:
> > This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/Arch
> > Linux) (preloaded format=pdflatex)
> >  restricted \write18 enabled.
> > entering extended mode
> > ! I can't find file `empty.tex'.
>
> So pdflatex is called and found. Then pdflatex can't find empty.tex.
> That looks like pdflatex is called in another directory than where
> empty.tex resides. How that could happen, no idea.
>
> Julius
>



Re: [O] Getting feedback from a website created with OrgMode ??

2018-11-18 Thread John Hendy
On Sun, Nov 18, 2018 at 4:54 PM David Masterson  wrote:
>
> I'd like some ideas on how to create a website with OrgMode.  OrgMode is
> very good at creating static web-pages of any sort of structure.  What I
> think I'd like to do is create a more dynamic web-page.  My particular
> use-case is the following:
>
> 1. I'd like to create a website of information for my family of calendar
> information and financial information that they might need in day to day
> keeping track of family needs.
>
> 2. I'd like the family to be able to comment on the information as
> needed to let me know if something is wrong or missing.  This might be a
> comment at the bottom of the web-page or an email feedback with a tag of
> the particular web-page (so I can find it later).
>
> 3. I'd also like them to be able to fill in information that I request
> from them that I can backfill later.  Things like names of secretaries
> for new doctors or times for new appointments.
>
> What options do I have for doing this in OrgMode??

You might look into nikola:
- https://plugins.getnikola.com/v7/orgmode/

I've used it and think it's pretty awesome. I *haven't* used comments,
but they look possible:
- static: https://getnikola.com/blog/really-static-comments-with-staticman.html
- more "standard" options mentioned:
https://oliver2213.me/posts/self-hosted-comments-with-nikola/

Not sure on what you want in #3 exactly. Like fill in a form and store
the answer? Or have a blank in the exported document that you somehow
store/get/use later? It brings to mind input fields you could have
emailed to you, or piping those into a database? The main point was to
make you aware of nikola if you hadn't heard of it...


John


>
> --
> David Masterson
>



[O] Org brings people together!

2018-10-09 Thread John Hendy
Hi all,


Just wanted to celebrate the fact that 3M (where I work [1]) was able
to host Prof. John Kitchen last week to give two talks: one on his
work in catalysis, touching on modeling molecular interactions, and a
second one about reproducible research with Org-mode.

At 3M we have chapters, which I describe like college clubs, but
organized around different technology topics. These are volunteer
groups responsible for some ~450 events per year at 3M Center in St.
Paul, MN. The events are things like internal product/technology
talks, vendor presentations, poster sessions, and hosting professors.

When I saw John's mention scimax [2] maybe a year ago and realized he
works in an area where we have such a chapter (catalysis), as well as
works with Org-mode (relevant to our software chapter), I started
scheming and pitched that we invite him. Fast forward a few back and
forths about timing later, followed by a sabbatical at Google, and
revisiting the idea... and it finally happened!

Sadly, I missed the Org talk (CTO was presenting at the same time),
but I did go to the first and was able to join him for dinner. I admit
that the others at dinner were not quite as programm-y as we were, and
might have been playing along laughing we got into the inevitable vim
vs. emacs jokes. We were quite amused, though.

John will be the second person I've met on the user list. I met Erik
Iverson, a long-time user, back in 2011. Turns out he was running the
Twin Cities R User Group here and we ended up co-organizing together
for a couple years.

So far, Org-ers have been 100% awesome in person, and I look forward
to running into more down the road. Anyway, just felt like a fun bit
of news to share, and hopefully you all can nerd out about Org in
person at some point too!

It was great to meet you John, great work, great talk, and I look
forward to digging into scimax more soon!


Best regards,
John

[1] If 3M isn't immediately recognizable, you might know it for some
of it's bigger brands/products like Scotch Tape, Command Strips,
Post-It Notes, Filtrete filters, and Scotch-Brite.

[2] https://github.com/jkitchin/scimax



Re: [O] How to upgrade to make beamer export work

2018-09-24 Thread John Hendy
On Mon, Sep 24, 2018 at 10:02 PM jiewuza  wrote:
>
>
> OMG, it is my fault.
> I used `C-c C-e l p`
> My screen is too small.
> I just saw the the `p` key.
> And I thought maybe beamer and latex share the same key now in the new
> orgmode exporter. LOL

We've all been there, but I wouldn't call it a LOL. People took time
to speculate on what the issue might be, and to try to help you. Eric
specifically mentioned the upper case P and you said "Yes, that is
exactly what I did." Now you are saying you thought they might share
the same key and pressed 'p' after all.

I had just created a minimal config and tested the export myself when
this email came through. What I *would* have said was "People can't
troubleshoot what they can't see." The list gets all kinds of weird,
odd issues (including from me, and including goofs just like this).
The tried and true practice is a minimal configuration and a test file
of some sort. Pasting what you *think* is the only beamer related
config (on the heels of citing spacemacs, which could have all sorts
of stuff potentially conflicting options) doesn't count, as we can't
see for sure what is going on. Minimal config, run `emacs -Q`, then
`M-x load-file RET path/to/min-config`, then try your stuff.

Follow that practice and I assure you, the extra work on your part
will drastically cut down on the back and forth with the list,
resulting in getting to the real work/fun much faster!
- https://orgmode.org/manual/Feedback.html

Glad it worked out,
John


> Eric S Fraga  writes:
>
> > On Monday, 24 Sep 2018 at 15:49, jiewuza wrote:
> >> I used orgmode to prepare my lecture materials.
> >> Now I upgrade org to the latest version, and read the [[new
> >> exporter][https://orgmode.org/worg/exporters/ox-overview.html]].
> >>
> >> It seems the configure is much easier.
> >> But I cannot get my lectures right after all my efforts.
> >>
> >> So I start all over. I removed all my beamer configure.
> >> With the [[beamer
> >> example][https://orgmode.org/manual/A-Beamer-example.html]], I get a pdf
> >> (see attachment) like a latex article, no beamer frame.
> >
> > How did you export?  You should choose the beamer options, as in
> >
> > C-c C-e l P
> >
> > to create PDF using beamer. Note upper case P. If you want to open the file 
> > as
> > well, use O instead of P (again upper case). Lower case equivalents are for
> > normal LaTeX article class (by default).
>
>



Re: [O] org mode error "pdf wasn't produced"

2018-03-15 Thread John Hendy
On Thu, Mar 15, 2018 at 10:06 AM, R Jain  wrote:
> Hi Dereje,
>
> Two things:
> 1) Pygmentize is a python package. I hope you meant trying to install it for
> python, and not Latex or Emacs.
> http://pygments.org/docs/cmdline/
> 2) Which Tex software are you using? I recall having some compilation errors
> (last year) when I was setting this up with org-mode. Though I can't put my
> finger on what solved the problem, it was after I installed TexMaker. A
> friend suggested that it has a very decent library.
>
> So, if you have installed the vanilla Miktex, or something else, I'd
> recommend giving TexMaker a try. Don't recall ever having to open it up
> though.

I have successfully used MikTex in the past and definitely remember
having an initial setup cycle of trying to export, checking the Org
PDF Latex buffer, identifying the missing package(s), installing via
the MikTex GUI, and repeating until all the errors went away. This may
be purely because I default to a lean system and don't go for these
huge meta-packages. If one chooses to install the [La/Lua/Xe]Tex
world, this might not be the case! I have the same procedure on linux
with TexLive where I have a default starting set of pkgs and just run
tlmgr on whatever errors I encounter.

Just one other data point!

The first step is to make sure "pdflatex" is recognized, period. This
is still not answered.

John

>
> Let us know. Good luck.
>
> --Rishabh
>
>
> On Mar 14 2018, at 3:24 pm, Dereje Tefera  wrote:
>
>
> I saw that there is one error:
>
>  "! Package minted Error: You must have `pygmentize' installed to use this
> package." but   when I try to install from the package list says no match.
> and a warning:
>
> "Package inputenc Warning: inputenc package ignored with utf8 based
> engines."
>
>
>
> Do you think it would be better to reinstall emacs?
>
>
> Regards
>
> Dereje
>
>
> On Wed, Mar 14, 2018 at 12:28 PM, Eric S Fraga  wrote:
>
> On Wednesday, 14 Mar 2018 at 11:39, Dereje Tefera wrote:
>> Dear John and R Jain,
>>
>> I have done all required installation for the Latex and it worked for a
>> couple of times but it  then crashes. This is the error message I am
>> getting while trying to export to Latex PDF or Beamer. I really appreciate
>> your cooperation but I completely if you are busy.
>
> So, it looks like LaTeX is now being found but that there are errors in
> the LaTeX created by org.  Have you looked at the LaTeX output buffer,
> as the error message suggests?
>
>> Debugger entered--Lisp error: (error "File
>> \"c:/Users/deret/Desktop/examp3.pdf\" wasn’t produced.  See \"*Org PDF
>> LaTeX Output*\" for details")
>
> The error will likely be near the end of the buffer.
>
> --
> Eric S Fraga via Emacs 27.0.50, Org release_9.1.6-303-g6cf5fc.dirty



Re: [O] org mode error "pdf wasn't produced"

2018-03-13 Thread John Hendy
Oops. Sincere apologies for misspelling your name, Dereje! I misread
in my hasty skim.

John

On Tue, Mar 13, 2018 at 8:28 PM, John Hendy <jw.he...@gmail.com> wrote:
> Dejere,
>
>
> Org-mode is not able to find your latex installation. That's the
> problem, just as it says: it's trying to run the compilation command,
> `pdflatex` and it can find no such thing.
>
> Either it's not installed, or it's not in your path. The more details
> you can provide, the better. For starters 1) what latex variant is
> installed and 2) is it in your path (and how do you know)?
>
>
> Best regards,
> John



Re: [O] org mode error "pdf wasn't produced"

2018-03-13 Thread John Hendy
Dejere,


Org-mode is not able to find your latex installation. That's the
problem, just as it says: it's trying to run the compilation command,
`pdflatex` and it can find no such thing.

Either it's not installed, or it's not in your path. The more details
you can provide, the better. For starters 1) what latex variant is
installed and 2) is it in your path (and how do you know)?


Best regards,
John

On Tue, Mar 13, 2018 at 7:29 PM, Dereje Tefera  wrote:
>
> Hi Prof. Kitchin and others,
>
> I am using Emacs-org-mode on a windows machine and launch the program from 
> the desktop shortcut.
>
>
>
>
> Regards
>
> Dereje
>
>
>
> On Tue, Mar 13, 2018 at 6:05 PM, John Kitchin  wrote:
>>
>> That means emacs is not finding pdflatex on your path.
>>
>> A little more information might help.
>>
>> 1. In a terminal, if you type:
>>
>> > which pdflatex
>>
>> to you get anything?
>>
>> 2. How do you launch emacs? If you are launching it from some icon, you 
>> might not be getting the same path environment as from a shell.
>>
>> John
>>
>> ---
>> Professor John Kitchin
>> Doherty Hall A207F
>> Department of Chemical Engineering
>> Carnegie Mellon University
>> Pittsburgh, PA 15213
>> 412-268-7803
>> @johnkitchin
>> http://kitchingroup.cheme.cmu.edu
>>
>>
>> On Tue, Mar 13, 2018 at 4:37 PM, Dereje Tefera  wrote:
>>>
>>> Hi Everyone,
>>>
>>> thank you very much for the response.
>>>
>>> Rishabh, yes i have check the link you mentioned.
>>>
>>> the error  says "'pdflatex"' is not recognized as an internal or external 
>>> command,
>>> operable program or batch file." but i have that in my init.el file 
>>> configured.
>>>
>>>
>>>
>>>
>>>
>>>
>>> Regards
>>>
>>> Dereje
>>>
>>>
>>>
>>> On Tue, Mar 13, 2018 at 6:28 AM, R Jain  wrote:

 Hi Dereje,

 Have you already looked at (8) from 
 https://orgmode.org/worg/org-tutorials/org-latex-export.html?

 --Rishabh

 On Mar 12 2018, at 5:40 pm, Dereje Tefera  wrote:
>
> Dear good team of Org-mode,
>
> I am using org-mode in the Emacs, but I have a problem exporting to 
> Latex,  PDF.
>
> "I always have this message that says, PDF was not produced, when i try 
> to export to latex pdf.
>
>
> I can export to HTML or tet latex but not to pdf.
>
>
> Any help would be highly appreciated.
>
>
> Thank you for your time.
>
>
>
> Regards
>
> Dereje
>
>
>>>
>>
>



Re: [O] sideways table

2017-07-07 Thread John Hendy
On Fri, Jul 7, 2017 at 12:20 PM, Sharon Kimble
 wrote:
>
> I'm trying to use 'sideways' with an org-mode table being exported to
> latex. But its not working. This is my table header -
>
> --8<---cut here---start->8---
> #+CAPTION: Table of Parochial Fees from 1 January 2017 - Funerals, Burials 
> and Monuments (cite:0204).
> #+ATTR_LATEX: :booktabs t :environment longtable :float sideways
> --8<---cut here---end--->8---
>
> If I don't have ':environment longtable' then the pdf compiling fails saying 
> that -
>
> --8<---cut here---start->8---
> ! LaTeX Error: Environment sidewaystable undefined.
>
> See the LaTeX manual or LaTeX Companion for explanation.
> Type  H   for immediate help.
>  ...
>
> l.12122 \begin{sidewaystable}
>  [htbp]
>
> --8<---cut here---end--->8---
>
> So how can I use 'sideways' with a table please? Its not clear exactly
> what to do from the org-mode manual, and google doesn't provide any
> solutions either.
>

I've run into this question before, but am not sure this is the same
thread I resolved it:
- https://lists.gnu.org/archive/html/emacs-orgmode/2014-03/msg00373.html

Namely: #+attr_latex: :float sidewaystable

Another option I use regularly:
- https://www.mail-archive.com/emacs-orgmode@gnu.org/msg110703.html

Namely: lscape pacakge longtable


Hope that helps!
John

> 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.0, fluxbox 1.3.5-2, emacs 25.1.1, org-mode 9.0.7



Re: [O] org babel, ess, R

2017-07-05 Thread John Hendy
On Wed, Jul 5, 2017 at 4:22 PM, Nicolas Goaziou  wrote:
> Hello,
>
> Vikas Rawal  writes:
>
>> C-RET seems to be picking up the custom session name if it is already
>> there. But otherwise it generates the default *R* session there,
>
> Is there a bug to fix? If so, could start a new thread about it, ideally
> with an ECM demonstrating the issue?

I guess Vikas can speak for Vikas, but he was responding to my
observation of the same:

"... I'd like Org to pick up the fact that there's a :session
argument with a custom name and use that for C-RET in the edit buffer;
otherwise it generates the default *R* session there, but if you C-c
C-c the block later it puts it into the custom session name."

Here's an ECM:

#+begin_example

* heading

#+name: x
#+begin_src R :session r

x <- 1:10

#+end_src

#+name: y
#+begin_src R :session r

y <- x^2

#+end_src

#+end_example

So, say I start working on a document for the day and enter the
editing buffer with C-c ' on block x. I then C-RET from the edit
buffer, which evaluates x and starts a new R session, *R*. Now I'm
done and go on to block y, but don't need to edit. Maybe I just want
to update a plot or other result in the document, so I C-c C-c:

Error: object 'x' not found

This really, really common for my work. I define a setup block
somewhere in which I load libraries, read in thousands of lines of
sensor code, and process things (moving averages, summary stats, etc.)
and create my sort of "master object." From there I have sections of a
report that subset the data, plot various things, but typically have
them all set to :eval no by default. If I pick up work on a file, edit
my setup code block, but only interactively because I forget I need to
C-c C-c something first to kick off the custom session, the work was
sort of for naught as everything is in the wrong session.

In this example, I realize the error and go back to block x and C-c
C-c after failing on block y. At that point, when I go to a block
interactively to do C-RET again, I get this in the minibuffer.

Process to load into: {r | *R* | *new* }

Then I switch to *R* to quit() and end the spurious session.

Really, it was a comment about how Org behaves, not necessarily a bug.
That said, speaking for myself, I would never want a default session
in interactive mode when I've defined one in the code heading. I'd
love if Org could pick up on that setting, such that the first C-RET
of the day dropped into the session named by the block I'm editing. At
present, interactive mode appears to ignore this.


Hope that helps clarify,
John





> Regards,
>
> --
> Nicolas Goaziou



Re: [O] org babel, ess, R

2017-07-03 Thread John Hendy
On Sun, Jul 2, 2017 at 7:17 PM, Vikas Rawal
 wrote:
>>
>> Vikas Rawal  writes:
>>
>>> Isn’t is what most users need while editing the code block? The
>>> possibility of evaluating the code to test and see what happens?
>>
>>
>> Many languages do not support sessions. So, the only possibility to
>> evaluate the code is to evaluate the code block in the source buffer.
>>
>
> Yes, what I am talking about is relevant only when a session is defined. What 
> I would like is that if in a file the session is defined, C-c’ creates
> a window configuration that shows the edit buffer and the session. In other 
> cases, the two windows could show the edit buffer and the original org buffer.

As a frequent R user, I completely relate to this. As soon as one
evaluates code in the session buffer (C-c ') with C-RET, this is the
setup you get.

I'd add to your wish that upon first visiting a file, if I go into
edit mode, I'd like Org to pick up the fact that there's a :session
argument with a custom name and use that for C-RET in the edit buffer;
otherwise it generates the default *R* session there, but if you C-c
C-c the block later it puts it into the custom session name. Perhaps
out of habit, I tend to use :session r for every block that needs to
share results. I'll make some progress, close shop for the day, and to
continue where I left off I need to be sure to C-c C-c something the
next time rather than jumping right to editing. If I forget, end up
with two buffers and I get asked where I want to evaluate every
subsequent bit of code.

Anyway, it's easy enough to run one line with C-RET once editing and
get the session buffer, but just getting it right away is also what I
would prefer.

For other languages, even though one can't evaluate in the edit
buffer, I still use this view more frequently because I get
auto-indenting vs. none (e.g. with python).


John

>
>
> Vikas



Re: [O] how to replace includegraphics?

2017-05-31 Thread John Hendy
On Wed, May 31, 2017 at 5:35 PM,   wrote:
> Hello John,
>
>> instead of footnotes. Have you considered just changing the definition
>> in LaTeX instead? [1] [2]
>
> Yes, may be the redaction of my request was not very clear, I'm sorry. I did
> not want to do that, because I foresee that someone may think that my
> \includesvg is the \includesvg from the svg package. However, the two do not
> work in the same way, and may lead to problems.

I initially saw this:

(replace-regexp-in-string "\\`includegraphics.+\\({.+\.svg}\\)"
"simplesvg\1" contents))

That looked like you wanted to just swap \includegraphics with
\simplesvg. Doing that via LaTeX directly seemed like an easy way:

#+latex: \let\includegraphics\simplesvg

Now that I'm re-examining, you only want to do this for .svgs so
that's not nearly as straightforward.

> If my previous e-mail was indeed clear, may be I'm not getting what you are
> trying to say, sorry.

If the above *did* work, I don't see why you couldn't just remove the
#+latex line before publishing. Or define it in a setupfile that you
load and no one would ever know the contents to get confused. Or
perhaps it was a mandatory requirement to do zero changes to the file
you publish? The first method you showed appeared to apply elisp code
from within the file, so I'd assume an external user would see it but
have to ignore/not eval.

Filters are intimidating to me (no elisp-fu here!), but they
definitely sound like the ticket!


Good luck,
John

P.S. On a last point re. the confusion alone, I'm interpreting you to
mean users may think \simplesvg == \includesvg? Or simplesvg is your
package *name*, svg is the CTAN package, and they both provide
\includesvg? Why not rename your local version's command to a
different name? Or do \usepacakge{simplesvg} locally, and in the
published version have it commented with a note that it's special? Or
make your package available and include a link and instructions to
replicate? Just seems like an awful lot of work for a naming
convention issue!

> Thank you.
>
>
> Edgar
>
> -
>
> ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the
> NSA's hands!
> $24.95 ONETIME Lifetime accounts with Privacy Features!  15GB disk! No
> bandwidth quotas!
> Commercial and Bulk Mail Options!



Re: [O] org to static site?

2017-05-31 Thread John Hendy
On Wed, May 31, 2017 at 11:08 AM, Puneeth Chaganti  wrote:
> I really wrestled with getting it to behave initially. I hope the
> intro to the docs is a joke, as either I'm an idiot or the author
> definitely failed :)
> - https://getnikola.com/handbook.html
>
> "DON'T READ THIS MANUAL. IF YOU NEED TO READ IT I FAILED, JUST USE THE
> THING."
>
>
> To be fair to the author, org support is not built into Nikola, and is
> coming through a plugin (by yours truly). The remote calls to Emacs for
> compiling, and other ugly stuff can make it harder than necessary to deal
> with.

Understood, and I just meant in general (not org integration). This
was a bit tongue in cheek; I don't think anyone would *expect* that
something like this could be used without a manual. It's complicated
and takes a bit to parse, just like any other software! I think it's
great thus far, but can't fathom how someone could "pick it up" and
start using it from scratch with no docs.

John

> - Puneeth



Re: [O] org to static site?

2017-05-31 Thread John Hendy
On Wed, May 31, 2017 at 10:29 AM, Russell Adams
 wrote:
>
> On Wed, May 31, 2017 at 11:17:10AM -0400, Jeffrey Brent McBeth wrote:
>> Nikola supports org-mode last I checked though?
>
> I think it tries to remotely call emacs to compile the org to html, but I 
> didn't want the extra layers. Markdown is adequate.
>
>> I use Nikola, and find the documentation frustratingly incomplete, but not 
>> so frustrating as to change :)
>
> Yeah, but IRC has been good for answering questions. I was able to get a 
> minimal site with NO external links, libs, js,
> css, other crap, etc in a short time.

I'm intrigued. Do you have the sources or could you post the gist
somewhere? While the result looks more or less pretty, the bootstrap3
base was super intimidating with respect to changing anything. I
probably hunted for 30min or more just to figure out why changing the
navbar color didn't work. Turns out it was hardcoded to use the
navbar-inverse class instead of the regular navbar class!?

John

> I think my only complaint is that when I moved laptops my Python version 
> changed and now I have to fix it.
>
>
> --
> Russell Adamsrlad...@adamsinfoserv.com
>
> PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/
>
> Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
>



Re: [O] org to static site?

2017-05-31 Thread John Hendy
On Wed, May 31, 2017 at 10:17 AM, Jeffrey Brent McBeth
 wrote:
> Nikola supports org-mode last I checked though?

Make that a +1 for Nikola, and confirming it supports Org-mode. I just
started setting up an online portfolio/blog via github.io and found
these helpful:
- http://cestlaz.github.io/posts/2016-04-17-emacs-jekyll-nikola/#.WS7gV3VE5D8
- https://streakycobra.github.io/posts/blogging-in-org-mode-with-nikola/

> I use Nikola, and find the documentation frustratingly incomplete, but not so 
> frustrating as to change :)

I really wrestled with getting it to behave initially. I hope the
intro to the docs is a joke, as either I'm an idiot or the author
definitely failed :)
- https://getnikola.com/handbook.html

"DON'T READ THIS MANUAL. IF YOU NEED TO READ IT I FAILED, JUST USE THE THING."


John

> Jeff
>
> --
> "The man who does not read good books has no advantage over
>  the man who cannot read them."
>  -- not Mark Twain, maybe a southen librarian in 1910
>
>



Re: [O] how to replace includegraphics?

2017-05-31 Thread John Hendy
On Tue, May 30, 2017 at 10:37 PM,   wrote:
> Hello dear list,
>
> * Summary
> I want to know if someone could tell me how to replace (the macro, function,
> string) includegraphics for something else when exporting to LaTeX. In my
> case, simplesvg.

This made me think of the various times someone wants to use endnotes
instead of footnotes. Have you considered just changing the definition
in LaTeX instead? [1] [2]

#+LaTeX_HEADER: \usepackage{endnotes}
#+LaTeX_HEADER: \let\footnote=\endnote

In other words, utilize the fact that Org already handles images
flawlessly and then just define \includegraphics to be something else
on the LaTeX end of things.


John

[1] http://perlstalker.vuser.org/blog/2014/07/15/endnotes-org-mode/
[2] 
https://tex.stackexchange.com/questions/53895/converting-footnotemarks-to-endnotes



Re: [O] Git repository error

2017-05-27 Thread John Hendy
On Thu, May 25, 2017 at 6:10 PM, Vicente Vera  wrote:
> Hi. For a while i've been getting this error upon running 'make up0'
> from my local Org repository:
>
> fatal: read error: Connection reset by peer

I pulled just the other day and it worked, but I use http because git
doesn't work for me behind my corporate firewall.

$ git remote -v
origin http://orgmode.org/org-mode.git (fetch)
origin http://orgmode.org/org-mode.git (push)

I just cloned via http successfully, but get the "reset by peer"
message via git protocol (with or without the /w/ in the URL other's
have mentioned):

$ git clone git://orgmode.org/w/org-mode.git org-git
Cloning into 'org-git'...
fatal: read error: Connection reset by peer

$ git clone git://orgmode.org/org-mode.git org-git
Cloning into 'org-git'...
fatal: read error: Connection reset by peer

Something must be up with the main site. The mirror works:

$ git clone git://repo.or.cz/org-mode.git org-git
Cloning into 'org-git'...
remote: Counting objects: 106847, done.
remote: Total 106847 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (106847/106847), 80.33 MiB | 572.00 KiB/s, done.
Resolving deltas: 100% (83923/83923), done.



John



Re: [O] Table in org-mode not to be exported to latex

2017-05-17 Thread John Hendy
On Wed, May 17, 2017 at 7:06 AM, Sharon Kimble
 wrote:
>
> How can I have an org-mode table in an org-mode document that is
> exported to latex, but the table is *NOT* exported, please?
>
> This is the table that I'm using -

[snip]

This works for me. Duplicates what others have said, so I think
something is goofed on your end or you're not combining all of the
answers?

### begin org ###

* heading

#+begin_src org :exports none

| date   | change   | version |
|+--+-|
| 2016/11/18 | initial draft| 1.0 |
| 2017/05/04 | put in models of grief   | 1.5 |
| 2017/05/16 | removed creative commons | 1.6 |
#+end_src

### end org ###

That results in (C-e l L, as I don't actually have texlive on this system):

### begin latex ###

\begin{document}

\tableofcontents

\section{heading}
\label{sec:orge9ebafa}
\end{document}

### end latex ###

You're sure you have org for the src type *and* none for results? My
suspicion is the cause as no vs. none:
- http://orgmode.org/manual/Exporting-code-blocks.html

John

>
> Any ideas please?
>
> Thanks
> Sharon.
> --
> A taste of linux = http://www.sharons.org.uk
> TGmeds = http://www.tgmeds.org.uk
> DrugFacts = https://www.drugfacts.org.uk
> Debian 8.8, fluxbox 1.3.5-2, emacs 25.1.1.1, org-mode 9.0.7



Re: [O] evil-mode and org

2017-03-29 Thread John Hendy
On Tue, Mar 28, 2017 at 8:23 AM, Peter Neilson  wrote:
> On Tue, 28 Mar 2017 08:57:40 -0400, Matt Price  wrote:
>
>> I've never used Vim but I see a lot of people online raving about evil
>> mode
>> and how much they love it. I'm considering giving it a whirl after the
>> semester ends & I get some free time. I just wondered whether any heavy
>> org
>> users here on the list use evil, and if so, whether you see pain points
>> within org-mode -- my setup is pretty heavily customized, for instance,
>> and
>> I wonder whether that means it will be quite painful to use evil.
>
>
> You will also find people asking why anyone would ever think of using vim.
> One of those is Aaron Bieber.
> https://blog.aaronbieber.com/2016/01/30/dig-into-org-mode.html

I posted in response to John, but funny enough Aaron gives a talk on
evil-mode as well. From the talk he was a heaaavvvy vim user, so I
think it might be more accurate to say: "why would anyone use vim
*given emacs* (he came from vim, after all)?" Equally strong in his
talk (so I assume his philosophy in general) is: "why would anyone use
emacs keybindings *given vim's*?"

John

>
> I use vim only when unavoidable, and I simply pretend it is ed (of ancient
> Unix days). Or maybe I just use ed. I would not bother trying to use ed to
> access org, and thus would not be tempted to use vi, vim or evil mode for
> org, either. One fine day, long, long ago, I had to use a Vax that did not
> have emacs, vim, vi or ed. It did have whatever DEC was using for an editor,
> but I didn't know how to use it instantly. What to do? What to do? I tried
> running TECO. Yes, it had TECO! Saved! (Sort of.)
>
> Why use vim if emacs is already built into your fingertips?
>



Re: [O] evil-mode and org

2017-03-29 Thread John Hendy
On Wed, Mar 29, 2017 at 10:12 AM, John Kitchin  wrote:
> Using evil-mode is not "using vim" IMHO. I think this is a question of
> do you want modal editing or not (I suppose it could also be do you want
> emacs-lisp or vimscript, but that is not the impression I get these days
> ;). With emacs you can have either traditional emacs editing (one-mode:
> edit) or modal editing like vim (for the most part). And you can still
> use emacs-lisp to customize the environment so you can have things like
> org-mode.

Totally agreed. I possibly learned of evil-mode via Aaron as mentioned by Peter:
- https://www.youtube.com/watch?v=JWD1Fpdd4Pc

It's been on my todo list to try... I just haven't yet. I see
evil-mode as using some of the better navigation aspects of vim inside
the already awesome org-mode. Indeed, one of Aaron's main points (and
he struck me as a power user of both emacs and vim, so I think he has
the background to make the claim) is why anyone would try to replicate
all the awesomeness of emacs/org in something like vim when it already
exists.

My takeaway is that evil-mode acknowledges that folks want to be in
emacs for it's features, while also acknowledging that emacs
keybindings can be horrible (and vim's are better).


John

>
> I have seen a growing movement towards modal editing in emacs, e.g.
> evil-mode, spacemacs, hydra, avy/ivy, etc... and even do some things
> modally myself with those tools.
>
> Peter Neilson writes:
>
>> On Tue, 28 Mar 2017 08:57:40 -0400, Matt Price  wrote:
>>
>>> I've never used Vim but I see a lot of people online raving about evil
>>> mode
>>> and how much they love it. I'm considering giving it a whirl after the
>>> semester ends & I get some free time. I just wondered whether any heavy
>>> org
>>> users here on the list use evil, and if so, whether you see pain points
>>> within org-mode -- my setup is pretty heavily customized, for instance,
>>> and
>>> I wonder whether that means it will be quite painful to use evil.
>>
>> You will also find people asking why anyone would ever think of using vim.
>> One of those is Aaron Bieber.
>> https://blog.aaronbieber.com/2016/01/30/dig-into-org-mode.html
>>
>> I use vim only when unavoidable, and I simply pretend it is ed (of ancient
>> Unix days). Or maybe I just use ed. I would not bother trying to use ed to
>> access org, and thus would not be tempted to use vi, vim or evil mode for
>> org, either. One fine day, long, long ago, I had to use a Vax that did not
>> have emacs, vim, vi or ed. It did have whatever DEC was using for an
>> editor, but I didn't know how to use it instantly. What to do? What to do?
>> I tried running TECO. Yes, it had TECO! Saved! (Sort of.)
>>
>> Why use vim if emacs is already built into your fingertips?
>
>
> --
> Professor John Kitchin
> Doherty Hall A207F
> Department of Chemical Engineering
> Carnegie Mellon University
> Pittsburgh, PA 15213
> 412-268-7803
> @johnkitchin
> http://kitchingroup.cheme.cmu.edu
>



Re: [O] [babel] Working dir incorrect

2017-03-13 Thread John Hendy
On Mon, Mar 13, 2017 at 9:32 AM, Loris Bennett
 wrote:
> Hi,
>
> In a file that used to work, when I now try to run some R code which
> generates an image, I get the error:
>
>   cannot open file './usage_users_historical_facet.pdf'
>
> If I check the working directory for the R session I see
>
>   getwd()
>   [1] "/usr/share/emacs/site-lisp/ess"
>
> instead of the directory in which my org file is located.
>
> I am now running Org 9.0.5 on Emacs 25.1.1.  The last time things worked
> I was definitely using an older version of Org and possibly Emacs 24.
>
> Any thoughts?

I agree with Nick on an ECM. Just to start the ball rolling:

M-x org-version
Org mode version 9.0.5 (release_9.0.5-288-g4caad0 @
/home/jwhendy/.elisp/org/lisp/)

$ emacs --version
GNU Emacs 25.1.1

#+begin_src min-config

;; set load paths
(add-to-list 'load-path "~/.elisp/org.git/lisp/")
(add-to-list 'load-path "~/.elisp/org.git/contrib/lisp/")
(add-to-list 'load-path "~/.elisp/ess/lisp/")

(require 'ess-site)

;; setup babel languages
(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)))

#+end_src

method:
- emacs -Q
- M-x load-file /path/to/min-config
- C-c C-c on both of these blocks and get the results as shown

 file: ~/Desktop/test.org ;

* heading

#+begin_src R

getwd()

#+end_src

#+RESULTS:
: /home/jwhendy/Desktop

#+begin_src R :session r

getwd()

#+end_src

#+RESULTS:
: /home/jwhendy/Desktop

;


How does this go for you?
John

>
> Cheers,
>
> Loris
>
> --
> This signature is currently under construction.
>
>



Re: [O] Heads-up: test failures

2017-02-14 Thread John Hendy
On Mon, Feb 13, 2017 at 12:48 PM, Nick Dokos  wrote:
> I just updated to
>
> Org mode version 9.0.5 (release_9.0.5-260-geb59c7 @ 
> /home/nick/elisp/org-mode/lisp/)
>
> and `make test' gives me:

Since others are adding in to the party! I ran after a fresh pull on
my normal setup.

$ uname -a
Linux whammy 4.9.8-1-ARCH #1 SMP PREEMPT Mon Feb 6 12:59:40 CET 2017
x86_64 GNU/Linux

$ emacs --version
GNU Emacs 25.1.1

M-x org-version
Org mode version 9.0.5 (release_9.0.5-288-g4caad0 @
/home/jwhendy/.elisp/org/lisp/)

Ran 705 tests, 705 results as expected (2017-02-14 20:12:26-0600)
9 expected failures

Since there was some mention of the emacs version, I just grabbed the
Arch AUR emacs-git package and re-ran. This is with 26.0.50.1:

Ran 705 tests, 701 results as expected, 4 unexpected (2017-02-14 20:28:42-0600)
9 expected failures

4 unexpected results:
   FAILED  test-org-list/move-item-down
   FAILED  test-org-list/move-item-up
   FAILED  test-org/custom-properties
   FAILED  test-org/forward-paragraph


Looks like emacs version is involved.


John


>
> --
> Nick
>
>
>



Re: [O] Latex summary

2017-02-13 Thread John Hendy
On Mon, Feb 13, 2017 at 1:44 PM, Russell Adams
 wrote:
> On Mon, Feb 13, 2017 at 03:14:31PM +, Eric S Fraga wrote:
>> On Monday, 13 Feb 2017 at 13:06, Russell Adams wrote:
>> > On Sun, Feb 12, 2017 at 04:30:48PM +, Eric S Fraga wrote:
>>
>> [...]
>>
>> >> Maybe use #index: ?
>> >
>> > Sorry, but do you mean in Latex or Org?
>>
>> Sorry.  Not clear in my response!  The #+index: is an org directly.
>>
>> "#+index: keyword" directives are then translated to LaTeX
>> \index{keyword} when exporting to PDF (say) and which can then be used
>> to create an index of keywords and page numbers using the \printindex
>> directive in LaTeX and the makeindex command to process these.  You'll
>> have to modify org-latex-pdf-process to invoke makeindex or else do this
>> manually from the exported LaTeX file.
>>
>> See attached for a minimal example (org and resulting PDF).
>>
>> --
>> : Eric S Fraga (0xFFFCF67D), Emacs 26.0.50.1, Org release_9.0.4-242-g2c27b8
>
> Eric, thanks for that really detailed input. I'll have to consider
> it. I worry that the keywords aren't like the full sentences I'm
> using.
>
> Essentially what I'm doing is like this.
>
> * Issue A
>
> ** Details
>
> lorem ipsum.
>
> /Recommendation: I would recommend that you do X/
>
> * Issue B
>
> ** Details
>
> lorem ipsum.
>
> /Recommendation: Other customers are recommended to do Y/
>
> * Conclusion
>
> #babel to grep the file for recommendations#
>
>  - I would recommend that you do X
>  - Other customers are recommended to do Y
>

I'm dialing in super late, but seeing this format made me think of
using inline todos for this. Could that be possible? I haven't tried a
test case, but made me think:

- insert inline todos where you have your recommendations below
- maybe use special tag or todo keyword
- create agenda view via elisp src block that could spit out the
results in your conclusions section
- I'm sure someone here could get the ID/link inserted :)

Any interest in trying something like that?

Here was some discussion about inline todos and the comments package.
Looks like Eric was in on that discussion as well!
- https://lists.gnu.org/archive/html/emacs-orgmode/2011-04/msg00190.html


John

>
>
> So essentially I'm putting a summary at the end, like a list of
> conclusions. I'm not using single words. Linking back to the section
> where the recommendation came from would be ideal.
>
> I'm trying to figure out what this would be called, so I can check the
> Latex libraries. I expect it's fairly common, but that I'm using a
> poor choice of words to describe it.
>
>
>
> --
> Russell Adamsrlad...@adamsinfoserv.com
>
> PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/
>
> Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3
>



Re: [O] Org unique id behavior changed?

2017-02-03 Thread John Hendy
On Fri, Feb 3, 2017 at 4:23 PM, Nicolas Goaziou <m...@nicolasgoaziou.fr> wrote:
> Hello,
>
> John Hendy <jw.he...@gmail.com> writes:
>
>> I just tried to recreate a unique id link from the mailing list and
>> was surprised to find that =C-c l= did not create a unique id
>> automatically.
>>
>> From the manual:[1]
>>
>> C-c l (org-store-link)
>> ...
>> If the headline has a CUSTOM_ID property, a link to this custom ID
>> will be stored. In addition or alternatively (depending on the value
>> of org-id-link-to-org-use-id), a globally unique ID property will be
>> created and/or used to construct a link (jwh adding: if org-id is
>> loaded).
>>
>>
>>
>> Here's my min config:
>>
>> #+begin_example
>>
>> (add-to-list 'load-path "~/.elisp/org/lisp/")
>> (add-to-list 'load-path "~/.elisp/org/contrib/lisp")
>>
>> (require 'org-id)
>> (global-set-key "\C-cl" 'org-store-link)
>> (setq org-link-to-org-use-id 'create-if-interactive)
>>
>> #+end_example
>>
>>
>>
>> Starting emacs with =emacs -Q= and then =M-x load-file ~/path/to/min-config=
>>
>>
>> File:
>>
>> #+begin_example
>>
>> * Alcohol^
>>
>> Something
>>
>> \newpage
>>
>> * Another heading
>>
>> Blah blah blah, see
>>
>> #+end_example
>>
>>
>>
>> With cursor at ^, I do =C-c l= and get this in the mini-buffer:
>> =Stored: Alcohol=
>>
>> When trying to insert with =C-c C-l= I get this auto-completion suggestion:
>>
>> Alcohol  
>> <file:~/Desktop/test.org::*Alcohol>
>>
>> Normally that would have a unique-id, not file path/headline.
>>
>> Org mode version 9.0.2 (release_9.0.2-140-g1c8908 @
>> /home/jwhendy/.elisp/org/lisp/)
>>
>> Is this on my end (settings) or did something change? Doing this
>> definitely used to generate a unique id property drawer under the
>> linked headline and suggest it when going to insert the link
>> elsewhere.
>
> FWIW, I cannot reproduce this issue.

Wow. I just wrote a response re-replicating my behavior and then went
to check the value of the variable to be sure!

org-id-link-to-org-use-id is a variable defined in ‘org-id.el’.
Its value is nil

That's interesting. So what did I set in my config??

(setq org-link-to-org-use-id 'create-if-interactive)

I changed to the correct variable name and all is well. Sorry for the
noise; it appears this is a super old variant of the variable based on
references I find on the web:
- http://git.net/ml/emacs-orgmode-gnu/2012-04/msg01203.html
- 
http://orgmode.org/w/?p=org-mode.git;a=commitdiff_plain;h=4b4328e29b2c286505c7f0be0e54a37a8d1fbc75

I must not have caught a change at some point but I *swear* it was
working within the last year.


John

>
> Regards,
>
> --
> Nicolas Goaziou



Re: [O] linking to headings with a unique I'D exported to latex/PDF

2017-02-02 Thread John Hendy
On Thu, Feb 2, 2017 at 9:30 AM, Nicolas Goaziou  wrote:
> Hello,
>
> Sharon Kimble  writes:
>
>> I'm writing a document which is exported to latex and then built into a
>> PDF where I might have 'Alcohol', just as an example, mentioned several
>> times in different level headings. Currently I'm using org links like
>> this [[*Alcohol][Alcohol]] but that only allows me to link to one
>> heading only.
>>
>> I've tried using links like this
>> [[id:542d0880-c0fd-46d5-b75d-4cc6f5fa99cc][Alcohol]] and under the
>> heading that I'm linking to it says -
>>
>> *** Alcohol
>> :PROPERTIES:
>> :ID: 542d0880-c0fd-46d5-b75d-4cc6f5fa99cc
>> :END:
>>

This works for me:

#+begin_example

* Alcohol
  :PROPERTIES:
  :ID:   c8f90f00-4e36-41b7-b7fe-e52966e36d1d
  :END:

Something

\newpage

* Another heading

Blah blah blah, see [[id:c8f90f00-4e36-41b7-b7fe-e52966e36d1d][Alcohol]]

#+end_example

>From page 2 I jump up to the page 1 alcohol heading.

Not sure if you need it, but I'm assuming you load org-id?


John

>> But when exported it does not work.
>
> What doesn't work?
>
> Regards,
>
> --
> Nicolas Goaziou
>



Re: [O] linking to headings with a unique I'D exported to latex/PDF

2017-02-02 Thread John Hendy
On Thu, Feb 2, 2017 at 9:43 AM, Sharon Kimble
 wrote:
> Nicolas Goaziou  writes:
>
>> Hello,
>>
>> Sharon Kimble  writes:
>>
>>> I'm writing a document which is exported to latex and then built into a
>>> PDF where I might have 'Alcohol', just as an example, mentioned several
>>> times in different level headings. Currently I'm using org links like
>>> this [[*Alcohol][Alcohol]] but that only allows me to link to one
>>> heading only.
>>>
>>> I've tried using links like this
>>> [[id:542d0880-c0fd-46d5-b75d-4cc6f5fa99cc][Alcohol]] and under the
>>> heading that I'm linking to it says -
>>>
>>> *** Alcohol
>>> :PROPERTIES:
>>> :ID: 542d0880-c0fd-46d5-b75d-4cc6f5fa99cc
>>> :END:
>>>
>>> But when exported it does not work.
>>
>> What doesn't work?
>
> The example that I've just given with the ID.

Input: a reproducible example is best. With just pasting the id and
what the Alcohol heading says, it still leaves other things open to
chance... best would be a minimal config, minimal .org file contents,
and org version. Just my opinion. Otherwise a lot of emails are traded
just making sure everyone is on the same page. With the things I've
listed people can create an approximately matching setup to just try
it rather than guess at how to recreate what your'e describing.


John

>
> Thanks
> Sharon.
> --
> A taste of linux = http://www.sharons.org.uk
> TGmeds = http://www.tgmeds.org.uk
> Debian 8.6, fluxbox 1.3.5-2, emacs 25.1.1.1



[O] Org unique id behavior changed?

2017-02-02 Thread John Hendy
I just tried to recreate a unique id link from the mailing list and
was surprised to find that =C-c l= did not create a unique id
automatically.

>From the manual:[1]

C-c l (org-store-link)
...
If the headline has a CUSTOM_ID property, a link to this custom ID
will be stored. In addition or alternatively (depending on the value
of org-id-link-to-org-use-id), a globally unique ID property will be
created and/or used to construct a link (jwh adding: if org-id is
loaded).



Here's my min config:

#+begin_example

(add-to-list 'load-path "~/.elisp/org/lisp/")
(add-to-list 'load-path "~/.elisp/org/contrib/lisp")

(require 'org-id)
(global-set-key "\C-cl" 'org-store-link)
(setq org-link-to-org-use-id 'create-if-interactive)

#+end_example


Starting emacs with =emacs -Q= and then =M-x load-file ~/path/to/min-config=


File:

#+begin_example

* Alcohol^

Something

\newpage

* Another heading

Blah blah blah, see

#+end_example



With cursor at ^, I do =C-c l= and get this in the mini-buffer:
=Stored: Alcohol=

When trying to insert with =C-c C-l= I get this auto-completion suggestion:

Alcohol  

Normally that would have a unique-id, not file path/headline.

Org mode version 9.0.2 (release_9.0.2-140-g1c8908 @
/home/jwhendy/.elisp/org/lisp/)

Is this on my end (settings) or did something change? Doing this
definitely used to generate a unique id property drawer under the
linked headline and suggest it when going to insert the link
elsewhere.


Thanks,
John

[1] http://orgmode.org/manual/Handling-links.html#Handling-links



[O] src block: 'C-c C-c can do nothing useful here' if cursor on blank line

2017-01-27 Thread John Hendy
Perhaps this is the intended behavior, but I noticed that I go to
execute a code block and get the message "C-c C-c can do nothing
useful here" if I'm not on the actual src block definition or a line
of code. If I'm on a blank line inside it, it doesn't execute. Here
was my test:

#+begin min_config

(add-to-list 'load-path "~/.elisp/org/lisp/")
(add-to-list 'load-path "~/.elisp/org/contrib/lisp")

(org-babel-do-load-languages
 'org-babel-load-languages
 '((R . t)))

#+end

Start with =emacs -Q= and then =M-x load-file RET
~/path/to/min-config=, then use this test file:

* heading

#+begin_src R
^
x <- 1:10
x

#+end_src

With the cursor at ^ it won't run. I would understand if this were in
interactive mode using =C-c '=, but the behavior of C-c C-c is to run
the whole block anyway. It seems like Org doesn't know I'm in a src
block. Since blank lines are common, I'd expect not to have to make
*sure* I'm on an actual line of code and that being anywhere in a src
block should work.

Thoughts?


Thanks,
John



Re: [O] How to have a sideways longtable?

2017-01-20 Thread John Hendy
On Fri, Jan 20, 2017 at 3:56 PM, William Denton  wrote:
> I have a long and wide table of text I'd like to have sideways (landscape
> orientation) and stretch over multiple pages.  I can do either one but not
> both together.
>
> Here's a gist with a long, wide table:
>
> https://gist.github.com/wdenton/f11acf2e5257b29789f806b854d0709e
>
> If you take that and export it to LaTeX it will be long (on two pages) but
> not sideways, with some columns are cut off on the right---the float is
> being ignored, it seems.
>
> Using the float on its own does work, and this appears in the output:
>
> \begin{sidewaystable}[htbp]
>
> But when the longtable is there, it's just this without any sidewaystable:
>
> \begin{longtable}{rrll}
>
> Is this a bug?  I assumed they'd work together out of the box, but maybe I
> need to do something special.

I'm not sure what version of org I was using at the time (2014), but
knew I'd done this. This might not be exactly what you wanted, but I
just used landscape instead of sideways table and know it worked:

#+LATEX_HEADER: \usepackage{lscape}

#+latex: \begin{landscape}
#+latex: \tiny
#+attr_latex: :align |ll|lll|lll :env longtable
| table | goes | here |
#+latex: \end{landscape}

Like I said, that was old, so some of the syntax would be different
(like #+begin_export latex / #+end_export) but it's what I had on hand
to send quick!


John


>
> Bill
> --
> William Denton :: Toronto, Canada :: https://www.miskatonic.org/
> Caveat lector.
>



Re: [O] Beamer framebreak

2017-01-17 Thread John Hendy
No problem at all and hope that helped. It's definitely confusing initially!

Re. the headline thing, I just meant that this:

* something

** something

is not this:

- something
   - something

Asterisks are headlines, but I took your inquiring why the "Notes on
project" (with dashes) were not on separate slides. I might have
misunderstood, though.


Good luck!

On Tue, Jan 17, 2017 at 7:53 PM,  <ed...@openmail.cc> wrote:
>> Date: Sun, 15 Jan 2017 09:22:54 -0600
>> From: John Hendy <jw.he...@gmail.com>
>> To: ed...@openmail.cc
>> Cc: emacs-orgmode <emacs-orgmode@gnu.org>
>> Subject: Re: [O] Fwd: Beamer framebreak
>> Message-ID:
>>
>> <CA+M2ft-PhjVArRwzN9_Zkv2FhSvqdSyeJnBe-3KbZ6TG=sc...@mail.gmail.com>
>> Content-Type: text/plain; charset="utf-8"
>
>
>> My personal opinion is while it *looks* like it should work as this
>> utopian note-taking software that can also spit out presentations from
>> said content... it hasn't functioned like this in my experience.
>
> Would be nice, right? :) .
>
>> - beamer_frame_level has been replaced with H:n, I believe.
>>- old tutorial (mentioned):
>> http://orgmode.org/worg/exporters/beamer/tutorial.html
>>- new tutorial (not mentioned):
>> http://orgmode.org/worg/exporters/beamer/ox-beamer.html
>
> Thanks. I get confused between tutorials many times.
>
>> your'e asking why "Notes on project description" and "Notes on project
>> summary" are on the same slide? They are a list, not headlines, so Org
>> doesn't recognize them as having anything to do with frames. Org
>> thinks they are content (bullets).
>
> Ok. You may not believe this, but I was confused about how headlines worked,
> and an asterisk looked like a headline to me (or something). Thanks.
>
>> adding content :)
>
> "weird sounds from knee bending" is the technical term for "Oh, sh...t!"
>
>> Hope that helps some?
>
> It is _really_ great! Thank you very much for all your effort and time :) !
> I appreciate it a lot.
>
>
> Cheers!
> P.S. Sorry for the late answer. My life is a turmoil right now.
>
>
> -
>
> ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the
> NSA's hands!
> $24.95 ONETIME Lifetime accounts with Privacy Features!  15GB disk! No
> bandwidth quotas!
> Commercial and Bulk Mail Options!



Re: [O] Fwd: Beamer framebreak

2017-01-14 Thread John Hendy
On Sat, Jan 14, 2017 at 12:36 AM,   wrote:
> Hello eric,
>

[snip]

> Mmm... I think that this would mess up my outline. Is there a way to create
> an empty headline? or to hide it in the TOC?
>
>> Blocks are 3rd level headlines so put the contents within a 3rd level
>> headline.
>
> I think that I will have to work with my outline options or something too.
>
> Thanks a lot! Sorry for being so noob!
>

This list is amazing and very happy to help; that said, text/email is
clearly difficult to use when trying to "design" or communicate
graphics layout. What if you created something like 3-5 slides or
something in a different program representing quickly what you want,
or even type it out in plain text?

Slide 1: title slide

Slide 2: TOC which will contain the titles of the slides listed shown
indented under each section

Section 1: blah
Slide 3: introduction
- will contain bullets and an image

Maybe that's not much clearer, but wanted to lower the barrier in case
you don't want to make a graphical example :) I think that's best...
namely "Here's what I want, here's what I'm trying in org. I don't
understand why it isn't working." Then we can quickly compare and
point you in the right direction.


Thanks!
John


>
>
> -
>
> ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the
> NSA's hands!
> $24.95 ONETIME Lifetime accounts with Privacy Features!  15GB disk! No
> bandwidth quotas!
> Commercial and Bulk Mail Options!



Re: [O] Org Mode Research

2017-01-07 Thread John Hendy
On Sat, Jan 7, 2017 at 3:28 PM, Ted Wiles  wrote:
> Thanks all!

[snip]

> I get the concern on GPL vs. non-GPL,
> I also really like org mode as it fundamentally gives me control over my own
> data, but given where this is right now (a google forms survey) I think it's
> kind of a moot discussion.

But which is it; you get the concern but don't answer either way? I
take this to imply that if this *does* bloom into something it will be
non-GPL?


John

>
> Thanks again,
> Ted
>
>
>
> On Sat, Jan 7, 2017 at 3:43 PM, Colin Baxter  wrote:
>>
>> Hello
>>
>> On Sat, Jan 07 2017, Ted Wiles wrote:
>>
>> > Org Moders,
>> >
>> > I'm doing some research on org mode usage and would love to hear your
>> > perspective. Here's the
>> > survey link:
>> >
>> > https://goo.gl/forms/9I0uL3Er2TuEszfH3
>> >
>> > If I get enough responses, I'll be happy to post the results online for
>> > all to see!
>> >
>> > Best Regards,
>> > Ted
>>
>> I would want to see much more information about the motive and people
>> behind the Survey before I would take part. Sorry.
>
>



Re: [O] Org Mode Research

2017-01-07 Thread John Hendy
On Sat, Jan 7, 2017 at 1:39 PM, Thomas S. Dye  wrote:
> FYI, the survey appears to be market research for non-GPL vaporware.

Why the assumption of non-GPL? Just because web-based Org is hinted at
and leading/feature hunting questions are a common trait of someone
not wanting to reveal a commercial project? Theoretically it could
just be a hobby project being looked into, right? Just curious.


John

>
> Ted Wiles writes:
>
>> Org Moders,
>>
>> I'm doing some research on org mode usage and would love to hear your
>> perspective. Here's the survey link:
>>
>> https://goo.gl/forms/9I0uL3Er2TuEszfH3
>
> All the best,
> Tom
>
> --
> Thomas S. Dye
> http://www.tsdye.com
>



Re: [O] Proper git settings to stay with master?

2016-12-23 Thread John Hendy
On Fri, Dec 23, 2016 at 5:24 AM, Achim Gratz <strom...@nexgo.de> wrote:
> Am 22.12.2016 um 17:44 schrieb John Hendy:
>>
>> $ git pull
>> From http://orgmode.org/org-mode
>>13751c3249..820d1eb617  maint  -> origin/maint
>>7fd61c4f92..1c89082600  master -> origin/master
>> You are not currently on a branch.
>
>
> Well, then you want to do a
>
> git checkout master

Sure... I get that that I *can* do that. I just wondered why I
*needed* to do that.

>
> or
>
> git checkout maint
>
> depending on which branch you want to be on.
>
>> Have I botched something? If so, what would be the method to remedy?
>> If not, what should be updated in the instructions regarding sticking
>> with master? I see references on how to specify maint, but that seems
>> to imply that master is the default and action is only required to
>> override to use maint branch.
>
>
> Master _is_ the default, so you must have specifically checked out a commit
> not at the branch HEAD or left a bisect or similar command that replays
> history hanging unfinished somewhere.
>

This makes sense. I don't know why this never happened before, but
checking out a specific commit makes sense. Perhaps I was bisecting
something in the past and checking out various commits? Once you check
out *something*, do you always have to re-checkout something else to
undo this effect (and make it like the default)? As in if I check out
a commit and then =git pull=, it won't go back to master?


Thanks for clarifying/educating!
John

> --
> Achim.
>
> (on the road :-)
>
>



[O] Proper git settings to stay with master?

2016-12-22 Thread John Hendy
I've not encountered this issue before, but on a git pull last night I
was greeted with a message like this (I don't have the original which
listed several other branches):

$ git pull
>From http://orgmode.org/org-mode
   13751c3249..820d1eb617  maint  -> origin/maint
   7fd61c4f92..1c89082600  master -> origin/master
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

git pull  


I just tried =make up0= and get something similar:

$ make up0
rm -f
git checkout
git remote update
Fetching origin
git pull
You are not currently on a branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

git pull  

make: *** [mk/targets.mk:113: up0] Error 1


I don't see anything about this in the FAQ about keeping up to date,
just what I would have done ages ago with a simple =git clone=.[1]

Here's my ~/.elisp/org/.git/config:

$ cat .git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = http://orgmode.org/org-mode.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master


Have I botched something? If so, what would be the method to remedy?
If not, what should be updated in the instructions regarding sticking
with master? I see references on how to specify maint, but that seems
to imply that master is the default and action is only required to
override to use maint branch.


Thanks,
John

[1] 
http://orgmode.org/worg/org-faq.html#keeping-current-with-Org-mode-development



Re: [O] Wrong type argument on latex/pdf export after git pull (9.0.2-136)

2016-12-22 Thread John Hendy
On Thu, Dec 22, 2016 at 10:29 AM, John Hendy <jw.he...@gmail.com> wrote:
> Greetings,
>
>
> I'm finishing up a 30 page end of year work report and perhaps
> stupidly decided I'd git pull on my various emacs packages last night.
> I went to work on it today and I'm getting the following error:
>
> C-c C-e l p
> shell-quote-argument: Wrong type argument: arrayp, nil

I'd done =git pull origin master= last night and tried using a branch
specifically just now, which appears to have resolved the issue.

$ git checkout master
$ git pull

I just pulled around 10p last night and after doing the checkout step
was told I was something like 711 commits behind master! I'm not sure
what the other method of pulling did, but it appears it wasn't correct
and perhaps didn't update everything? In any case, I can successfully
export now. Sorry for the noise. I have another thread specifically
about git settings, so perhaps that was the issue and can be corrected
for the list's sake separately.


John



Re: [O] Wrong type argument on latex/pdf export after git pull (9.0.2-136)

2016-12-22 Thread John Hendy
I'd been looking into debugging in a separate tab, got distracted, and
sent this after forgetting I was going to do that. My apologies for
the second email... I followed the feedback instructions and got this
output:[1]

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  replace-regexp-in-string("[^-0-9a-zA-Z_./\n]" "\\&" nil)
  shell-quote-argument(nil)
  org-compile-file("test.tex" ("%L -interaction nonstopmode
-output-directory %o %f" "%L -interaction nonstopmode
-output-directory %o %f" "%L -interaction nonstopmode
-output-directory %o %f") "pdf" "See \"*Org PDF LaTeX Output*\" for
details" # ((66 . "bibtex") (76 .
"pdflatex")))
  org-latex-compile("test.tex")
  #[257 "\300 !\207" [org-latex-compile] 3 "\n\n(fn FILE)"]("test.tex")
  org-export-to-file(latex "test.tex" nil nil nil nil nil #[257
"\300 !\207" [org-latex-compile] 3 "\n\n(fn FILE)"])
  org-latex-export-to-pdf(nil nil nil nil)
  org-export-dispatch(nil)
  funcall-interactively(org-export-dispatch nil)
  call-interactively(org-export-dispatch nil nil)
  command-execute(org-export-dispatch)


Thanks for any suggestions,
John

[1] "Activate debugging" chunk added to top of min-config file already shared.
- http://orgmode.org/manual/Feedback.html

On Thu, Dec 22, 2016 at 10:29 AM, John Hendy <jw.he...@gmail.com> wrote:
> Greetings,
>
>
> I'm finishing up a 30 page end of year work report and perhaps
> stupidly decided I'd git pull on my various emacs packages last night.
> I went to work on it today and I'm getting the following error:
>
> C-c C-e l p
> shell-quote-argument: Wrong type argument: arrayp, nil
>
> I fiddled with tagging various headlines in my real report with
> :noexport: with no success in finding something in the file causing
> this. I then made a simple test file and min config which also creates
> the behavior (emacs -Q, M-x load min-config):
>
> #+begin_src min-config
> (add-to-list 'load-path "~/.elisp/org/lisp/")
> (add-to-list 'load-path "~/.elisp/org/contrib/lisp")
>
> (require 'ox-latex)
> #+end_src
>
> #+begin_src org
> * heading 1
>
> blah blah blah
> #+end_src
>
> M-x org-version
> Org mode version 9.0.2 (release_9.0.2-136-g7fd61c @
> /home/jwhendy/.elisp/org/lisp/)
>
> Is there a way to debug further?
>
>
> Thanks!
> John
>
> P.S. When I pulled last night using =git pull= I got a message back
> that I wasn't on a specified branch, and listed 5 if I recall. I have
> never gotten this before and just did =git pull origin master=
> afterward successfully. Could I be on the incorrect branch?



[O] Wrong type argument on latex/pdf export after git pull (9.0.2-136)

2016-12-22 Thread John Hendy
Greetings,


I'm finishing up a 30 page end of year work report and perhaps
stupidly decided I'd git pull on my various emacs packages last night.
I went to work on it today and I'm getting the following error:

C-c C-e l p
shell-quote-argument: Wrong type argument: arrayp, nil

I fiddled with tagging various headlines in my real report with
:noexport: with no success in finding something in the file causing
this. I then made a simple test file and min config which also creates
the behavior (emacs -Q, M-x load min-config):

#+begin_src min-config
(add-to-list 'load-path "~/.elisp/org/lisp/")
(add-to-list 'load-path "~/.elisp/org/contrib/lisp")

(require 'ox-latex)
#+end_src

#+begin_src org
* heading 1

blah blah blah
#+end_src

M-x org-version
Org mode version 9.0.2 (release_9.0.2-136-g7fd61c @
/home/jwhendy/.elisp/org/lisp/)

Is there a way to debug further?


Thanks!
John

P.S. When I pulled last night using =git pull= I got a message back
that I wasn't on a specified branch, and listed 5 if I recall. I have
never gotten this before and just did =git pull origin master=
afterward successfully. Could I be on the incorrect branch?



Re: [O] Mobile org on osx

2016-12-20 Thread John Hendy
Copied from my last response to a similarly vague question:

#+begin_quote
Greetings,


To help anyone with much effectiveness, background information is
critical. I'm guessing you're referring to Mobile Org (not Org Mobile)
and infer you might be using the iPhone version (since your address is
icloud).

Other than that... we're completely in the dark. What was your syncing
backend (dropbox, ssh, other)? What settings did you apply per the
instructions? [1] Did you even follow the instructions? At what stage,
specifically, did you get said message?

More details from you = better help from us.


John

[1] http://orgmode.org/manual/MobileOrg.html

#+end_quote

You're free to continue sending one line emails to the list, but I
promise we can't help you without more details. Mobile Org for iPhone
(still unclear if you're using that version or Android, though icloud
and now OSX suggest iPhone) allows for dropbox and webdav sync. So the
answer with current minimal knowledge is "maybe?" What are
installation files? *If* you select Dropbox as your sync backend then
it is used as an online repository for a local Org-mode installation
(on computer) to sync between a mobile device (such as an iPhone).
So... typically .org files would be visible in the Dropbox directory
you selected. I don't know what you did, what you think should happen,
what you actually see... so I can't help.


John

On Tue, Dec 20, 2016 at 5:25 PM, Matthew Pritchard
 wrote:
> If I have installation correct should their be installation files visible in 
> my dropbox directory?



Re: [O] Orgmode for managing OS configuration

2016-11-03 Thread John Hendy
On Thu, Nov 3, 2016 at 9:22 AM, Giacomo M  wrote:
> Dear Stefan,
>
> thanks for the hints, I wasn't aware of these projects. While they sound
> appealing, I would like to stick to my current distribution (archlinux), for
> a variety of reasons (e.g. Im updating my raspberry which seems more
> supported by arch than nixos, I'm more familiar with it, I like the vanilla
> approach and wiki). Anyway, I'll look more into these options.

Made me chuckle. I'm on Arch and have been for years after trying a
bunch of others. It's hard to explain but you just find a distro that
works and you like it... and it's hard to imagine going elsewhere! We
had the same thought when accomplishing this through another distro
was suggested (even if those other distros are amazing).

I'd love to hear where you get with this, and the idea is quite
intriguing. It's pretty rare I wipe and re-install, but I do like to
keep configuration files backed up so I don't have to re-figure-out
everything between my last install and the next. I have a cron job
that grabs config files of interest and stores them in one folder;
periodically I push to git. That's as far as I got and generally on a
new system I just pull them in one by one as I remember that I need
them.

Packages can cause this issue... after a year or two on a system,
there's packages that say they were explicitly installed, but I don't
recall why. Some way to track the evolution of a system along with
notes/links of where you found some fix or solution would be really
cool (and well suited to Org!).

I'd like to see/hear about what you end up with!


John

>
> Still, having one or few org files documenting AND implementing my setup,
> apart from being easy potential blog posts, I think would help me keeping
> things under control (especially over years-long time horizons). It is
> working well for my emacs conf  (before my .emacs was a mess), but not sure
> if it's the same scaling up to OS (e.g. chmod when tangling, root user
> privileges when executing, or other things I'm not aware of).
>
>
> Il 03 Nov 2016 2:55 PM, "Stefan Huchler"  ha
> scritto:
>>
>> Giacomo M  writes:
>>
>> > Dear all,
>> > I would like to clean up my Linux setup to be easily replicable. I am
>> > considering keeping everything in one org file, and then tangling
>> > files (e.g. exec scripts, systemd service unit files) and executing
>> > bash snippets (e.g. for installing packages and sed'ing config files).
>> > Then one would need just emacs and git (or rsync) to start with.
>> >
>> > Does anybody have experience with this? Is the experience positive or
>> > negative?
>> >
>> > Also, should I just run emacs as root? Or using somehow sudo non
>> > interactively for babel blocks execution?
>> >
>> > Thanks,
>> >
>> > Giacomo M
>>
>> Do you know about nixos and guixsd? Sounds like you want to implement
>> here something similar, except less good cause this distributions have
>> also atomic updates and features like testing a configuration and
>> rollback features and some sort of conflict management, also it can
>> switch "profiles" without reboots and stuff like that.
>>
>>
>



Re: [O] Bug: org-mode interprets * as a headline in text between #+BEGIN_.. and #+END_...

2016-10-06 Thread John Hendy
On Thu, Oct 6, 2016 at 3:28 PM, David Talmage
 wrote:
> I often paste verbatim text into the lab notebook I keep with org-mode.
> Org-mode always interprets any line that begins with an asterisk as a
> headline, even when the line is surrounded by #+BEGIN_... and #+END_...
> patterns. This breaks org-special-edit, making it complain, "No special
> environment to edit here", unless I manually insert another character at the
> beginning of every line in the block that begins with an asterisk.
>
> The behavior surprised me.  I found two ways to work around it.  First, I
> can edit the would-be verbatim text as described above. It will always look
> like the original text in org-special-edit. That's marginally acceptable
> because it alters my original text and makes me take one more step before I
> can copy and paste it elsewhere.  Second, I can put such text in a drawer.
> I discovered that org-mode does not mis-interpret my text in a drawer.
>
>

I don't have a good explanation of why, but I know you need a comma to
escape org syntax, even within src blocks:
- mention of it in the manual (footnote 4):
http://orgmode.org/manual/Literal-examples.html
- SO answer: 
http://stackoverflow.com/questions/7431167/escaping-org-mode-example-block-inside-of-an-example-block

> Here is an example.  It's markdown text.  I use #+{BEGIN,END}_EXAMPLE but
> this behavior occurs in all of the #+BEGIN_.. and #+END_... patterns.
>
> #+BEGIN_EXAMPLE
> This is the README.md for rfc-tools, a collection of programs for
> processing IETF RFCs.
>
> * fetch-rfcs-by-title.sh downloads into the current directory the RFCs
>whose titles contain the string given on the command line.  Uses an
>   rfc-index file in the current directory.  Prefers the PDF version of
>   RFCs but will obtain the text version if the PDF is not available.
>
> * fetch-sip-rfcs.sh downloads RFCs that contain "Session Initiation"
>   in their titles into the current directory.
>
> * search-rfc-index.sh searches an rfc-index file in the current
>   directory for the string given on the command line.  The string can
>   contain spaces.
>
> * join-titles.awk turns the contents of an rfc-index file into a
>   series of long lines.  Each line begins with the RFC number, then a
>   space, then the rest of the entry from the rfc-index.
> #+END_EXAMPLE
>



Re: [O] Best diagram, image software?

2016-10-06 Thread John Hendy
On Thu, Oct 6, 2016 at 2:49 PM, Peter Davis  wrote:
>
> On Thu, Oct 6, 2016, at 03:25 PM, Clément Pit--Claudel wrote:
>> On 2016-10-06 15:10, Peter Davis wrote:
>> >> > (add-to-list 'org-latex-packages-alist
>> >> >  '(("AUTO" "inputenc" t)
>> >> >("" "color" t)
>> >> >("" "minted" t)
>> >> >("" "parskip" t)
>> >> >("" "tikz" t)))
>>

Maybe I'm dense, but why is everyone recommending changing the alist?
Granted, for future proofing and convenience this is nice... but I do
a fair amount with TikZ and have never done this.

~/org/aux/setupfile.org contains:
#+latex_header: \usepackage{tikz}
#+latex_header: \usepackage[siunitx]{circuitikz}
#+latex_header: \usetikzlibrary{shapes, positioning}

any given .org file contains:
#+setupfile: "~/org/aux/setupfile.org"

I modified your original aim like so, ditching the .png output which
looks like requires imagemagick. Maybe that's in org somehow, but when
you're just starting out I'd suggest eliminating as many other
mechanisms as possible. TikZ is in LaTeX, so just stick to pdf at the
start. This works for me.

#+latex_header: \usepackage{tikz}
#+latex_header: \usetikzlibrary{shapes, positioning}

* test

#+begin_src latex :results raw
% Define block styles
\usetikzlibrary{shapes,arrows}
\tikzstyle{astate} = [circle, draw, text centered, font=\footnotesize,
fill=blue!25]
\tikzstyle{rstate} = [circle, draw, text centered, font=\footnotesize,
fill=red!25]

\begin{tikzpicture}[->,>=stealth', shorten >=1pt, auto, node
distance=2.8cm, semithick]
\node [astate] (1) at (0,0) {1};
\node [astate] (2) at (1,0) {2};
\node [rstate] (3) at (2,0) {3};
\path (1) edge [bend left] node {b} (2)
(2) edge node {b} (3)
(2) edge [bend left] node {a} (1)
(3) edge [loop above] node {(a, b)} (3);
\end{tikzpicture}

#+end_src



John

>> This looks wrong.  You're adding a single list to
>> org-latex-package-alist, instead of adding multiple elements one-by-one.
>>
>
> Ok, I tried changing it to:
>
> (add-to-list 'org-latex-packages-alist '("AUTO" "inputenc" t))
> (add-to-list 'org-latex-packages-alist '("" "color" t))
> (add-to-list 'org-latex-packages-alist '("" "minted" t))
> (add-to-list 'org-latex-packages-alist '("" "parskip" t))
> (add-to-list 'org-latex-packages-alist '("" "tikz"))
> (add-to-list 'org-latex-packages-alist '("" "listingsutf8"))
>
> so now org-latex-packages-alist has the value
>
> (("" "listingsutf8")
>  ("" "tikz")
>  ("" "parskip" t)
>  ("" "minted" t)
>  ("" "color" t)
>  ("AUTO" "inputenc" t))
>
> Still getting the failure on tikz output.
>
> Thanks!
> -pd
>
> --
>   Peter Davis
>   www.techcurmudgeon.com
>



Re: [O] Misc. questions

2016-10-04 Thread John Hendy
On Tue, Oct 4, 2016 at 2:02 PM, Peter Davis  wrote:
> I apologize in advance for the flood of questions, but I'm using org in
> new ways now for creating documentation, and running into a lot of
> issues.
>
> 1) Is there a way to automatically say "yes" to all the "Evaluate code
> block...?" questions when I export, so I don't have to keep typing "yes"
> over and over again?

I googled "stop orgmode babel having to confirm" and got these:
- 
http://emacs.stackexchange.com/questions/23946/how-can-i-stop-the-confirmation-to-evaluate-source-code-when-exporting-to-html
- 
http://stackoverflow.com/questions/29952543/how-do-i-prevent-org-mode-from-executing-all-of-the-babel-source-blocks

Both refer to babel variables you can set.[1] You can put them in a
single file (at the very top):

# -*- org-confirm-babel-evaluate: nil; -*-

Or add this to .emacs

(setq org-confirm-babel-evaluate nil)

Or use #+bind[2] within a file (similar to the first local variable example).

>
> 2) How does the export menu get set? I'm loading, for example,
> ox-texinfo, but I don't see the option to export texinfo when I type C-c
> C-e.  I'm also loading ox-pandoc, which shows me a slew of export
> formats on my Mac, but only two, file and buffer, on my Win10 machine.
>

Guessing it's something on your side? Having never used it, I just added:

(require 'ox-texinfo)

I get an [i] option after C-e with various "Export to texinfo" options.

> 3) Still trying to find a way to get to DocBook XML (4, it turns out). I
> know the export page says to output texi (see #2 above) and then convert
> with makeinfo, but I have my doubts.  Of course, once I get texi working
> I'll be able to see for myself what information, if any, is lost.
>

No experience, so can't speak to this.

> 4) Is json a valid language for #+BEGIN_SRC? I don't see any syntax
> highlighting in HTML or LaTeX/PDF output, and I'm getting errors from
> LaTeX:
>
> ! Package Listings Error: language json undefined.
>
> Come to think of it, I think the org-mode doc lists both JavaScript (js)
> and JSON (json) as supported languages for code blocks, but the Listings
> LaTeX package doesn't list either of these.
>

Not sure where that was. I use this page as my reference and don't see
it (but do see js):
- http://orgmode.org/worg/org-contrib/babel/languages.html

> Thanks!
> -pd
>


Hope that helps,
John

[1] the manual where these are mentioned:
http://orgmode.org/manual/Code-evaluation-security.html
[2] http://orgmode.org/manual/Export-settings.html

> --
>   Peter Davis
>   www.techcurmudgeon.com
>



Re: [O] Emacs movement keys

2016-08-23 Thread John Hendy
On Tue, Aug 23, 2016 at 4:01 PM, Alex Recker  wrote:
>> And did you know that even outside Emacs you can move/delete wordwise by
>> pressing ctrl togeter with the right/left arrows or delete or backspace?
>
> I'm always surprised by how often C-a/C-e and M-f/M-b work in programs
> that aren't Emacs.  Of course there is probably some historical reason
> behind this (as much as I'd like to think Google and Slack had emacs
> users in mind).

I've always envisioned a collection of "You know you're an Emacs user
when..." for instances where this *doesn't* work out so conveniently.
Like how many times I've C-y'd out of habit expecting to paste and
nothing happens!


John

>
>



Re: [O] Using org-mode as a personal help desk tool

2016-06-20 Thread John Hendy
On Mon, Jun 20, 2016 at 9:10 AM, Eric Abrahamsen
 wrote:
> Roland Everaert  writes:
>
>> Hi,
>>
>> I am working as a sysadmin, In the organization, we use 2 tools to
>> keep track of requests sent by the customers/users. As you can expect,
>> those tools are not meant to be used to track all the gritty details
>> of a sysadmin's job.

[snip]

>> 4. Being able to search for a particular aspect or getting a list of
>> them and access it.
>
> I actually don't think there's any built-in way of searching files in an
> org-attach directory.
>

I wasn't familiar with org-attach. Seeing the gist of it, and with dir
creation handled, what about updating org-agenda-files with the new
files (script or something), or just defining a top level dir to
search:
- 
http://stackoverflow.com/questions/11384516/how-to-make-all-org-files-under-a-folder-added-in-agenda-list-automatically

If this could be done, a file tag matching the directory name could
perhaps be used. Or just match the file name to something related to
the customer/user (in my standard agenda search you just see the name
of the file and the tags, not the parent dir name).

Just an idea.


John



Re: [O] BUG: in beamer export non-beamer tags exported as part of header

2016-05-31 Thread John Hendy
On Fri, May 27, 2016 at 11:15 AM, Rainer M Krug  wrote:
> Nicolas Goaziou  writes:
>
>> Hello,
>>
>> Rainer M Krug  writes:
>>
>>> When I generate a pdf, the tags are in the TOC - but tags:not-in-toc
>>> means that the tags are *not* in the toc - possibly only in the headers
>>> itself? I don't know.
>>>
>>> Just checked, the tags are also in the toc in html export.
>>>
>>> According to the documentation:
>>>
>>> ,
>>> | If this is the symbol ‘not-in-toc’, tags will be removed from
>>> | table of contents entries, but still be shown in the headlines of
>>> | the document.
>>> `
>>>
>>> This is not working anymore.
>>
>> I cannot reproduce it, at least on HTML, LaTeX, and ASCII export. Could
>> you show an ECM ?
>
> OK. Here it is:
>
> --8<---cut here---start->8---
> #+TITLE: An Example
> #+EMAIL: rai...@krugs.de
>
> #+OPTIONS:   tags:not-in-toc
>
> #+LATEX_CLASS: beamer
> #+OPTIONS:   H:2 toc:t
>
> * Level 1   :andHereIsTheTag:
> ** A Frame
> #+begin_example
> Org-mode version 8.3.4 (release_8.3.4-850-g9dbeaa @ 
> /Users/rainerkrug/.emacs.d/org-mode/lisp/)
> GNU Emacs 25.0.94.1 (x86_64-apple-darwin15.4.0, Carbon Version 157 AppKit 
> 1404.46) of 2016-05-24
> #+end_example
> --8<---cut here---end--->8---
>
>
> The problem is beamer - with the other exports it works. With beamer,
> I get the pdf at [[https://www.dropbox.com/s/fc6z9wszxl5vv9i/text.pdf?dl=0]]
>

As is, I get the tag in beamer, article, and html. You're saying you
*don't* get the tag in article/html, but you *do* in beamer? If so, I
can't reproduce. Behavior is consistent with what I'd expect, namely
that tags export, but setting tags:nil turns that off.


John

> Cheers,
>
> Rainer
>
>>
>> Regards,
>
> --
> Rainer M. Krug
> email: Rainerkrugsde
> PGP: 0x0F52F982



Re: [O] Inquiry about ical2org

2016-05-27 Thread John Hendy
On Fri, May 27, 2016 at 2:50 AM, Eric S Fraga <e.fr...@ucl.ac.uk> wrote:
> On Thursday, 26 May 2016 at 20:04, John Hendy wrote:
>
> [...]
>
>> Anyway, the point is that the repeater is built if there's any
>> repetition frequency/interval. You also capture the "until" into
>> rrend. So, the first date is going to feature a +unit, and this code
>> adds the end:
>>
>> else if (rrend != "")
>> date = date ">--<" rrend
>>
>> I just commented out both sections that add a "-- ", the other
>> checking for time2 being "". Is that the correct way to go about this?
>
> Well, I would simply not add the end information as org does not
> understand an end date for a repeating item.  In other words, for a
> repeating item I would simply have the start date including the repeat
> directive.
>

Cool. Commenting has accomplished this for me and I don't get
repeating entries anymore.

>> Out of curiosity, how *is* the rrend code supposed to be handling
>> these? Or what's the use case for building a --?
>
> I should say that the awk codes have diverged.  My own version now
> differs significantly from what is on Worg, which is where I assume you
> got your copy.  I implemented repeating entries differently, it would
> seem.

Ah, that makes more sense. I was confused about agreeing that an end
date wasn't proper but the code having it. Is your original version
anywhere handy? I tried searching but don't seem to find it.


Thanks,
John

>
> HTH,
> eric
>
> --
> : Eric S Fraga (0xFFFCF67D), Emacs 25.0.94.1, Org release_8.3.4-869-gf2c421



Re: [O] Inquiry about ical2org

2016-05-26 Thread John Hendy
On Thu, May 26, 2016 at 3:00 PM, John Hendy <jw.he...@gmail.com> wrote:
> On Thu, May 26, 2016 at 2:49 AM, Eric S Fraga <e.fr...@ucl.ac.uk> wrote:
>> On Wednesday, 25 May 2016 at 20:33, John Hendy wrote:
>>> I found ical2org, and implemented it successfully via the "Share
>>
>> Which ical2org is this?  If it's the awk script I wrote originally, the
>> repeat handling was written with the assumption that there would be no
>> end date for the repeat as org cannot handled end dates for repeated
>> items.
>
> Whoops -- yes, the awk script. Sorry, now I'm remembering there was a
> ruby version as well.
>
> Here's an example of a recurring meeting I see:
>
> RRULE:FREQ=MONTHLY;UNTIL=20161114T15Z;INTERVAL=1;BYDAY=2MO
> DTSTART;TZID=Central Standard Time:20160613T09
> DTEND;TZID=Central Standard Time:20160613T103000
> DTSTAMP:20160526T195005Z
>
> I'm no awk expert, but I think I make out what's going on... the
> #repetition rule section extracts (among others) the freq (monthly)
> and interval (1) to build a repeater (+1m), though  and rrend using
> the "until" field.

Bah... sorry about that! Accidental tab right before a space sends away!

Anyway, the point is that the repeater is built if there's any
repetition frequency/interval. You also capture the "until" into
rrend. So, the first date is going to feature a +unit, and this code
adds the end:

else if (rrend != "")
date = date ">--<" rrend

I just commented out both sections that add a "-- ", the other
checking for time2 being "". Is that the correct way to go about this?

If so, no need to update. I'll just leave those commented out.

Out of curiosity, how *is* the rrend code supposed to be handling
these? Or what's the use case for building a --?


Thanks!
John


>>
>> I can try to fix this in the awk script by simply ignoring end dates in
>> such cases.  Let me know.
>>
>> --
>> : Eric S Fraga (0xFFFCF67D), Emacs 25.0.93.1, Org release_8.3.4-775-g3308a5



Re: [O] Inquiry about ical2org

2016-05-26 Thread John Hendy
On Thu, May 26, 2016 at 2:49 AM, Eric S Fraga <e.fr...@ucl.ac.uk> wrote:
> On Wednesday, 25 May 2016 at 20:33, John Hendy wrote:
>> I found ical2org, and implemented it successfully via the "Share
>
> Which ical2org is this?  If it's the awk script I wrote originally, the
> repeat handling was written with the assumption that there would be no
> end date for the repeat as org cannot handled end dates for repeated
> items.

Whoops -- yes, the awk script. Sorry, now I'm remembering there was a
ruby version as well.

Here's an example of a recurring meeting I see:

RRULE:FREQ=MONTHLY;UNTIL=20161114T15Z;INTERVAL=1;BYDAY=2MO
DTSTART;TZID=Central Standard Time:20160613T09
DTEND;TZID=Central Standard Time:20160613T103000
DTSTAMP:20160526T195005Z

I'm no awk expert, but I think I make out what's going on... the
#repetition rule section extracts (among others) the freq (monthly)
and interval (1) to build a repeater (+1m), though  and rrend using
the "until" field.

>
> I can try to fix this in the awk script by simply ignoring end dates in
> such cases.  Let me know.
>
> --
> : Eric S Fraga (0xFFFCF67D), Emacs 25.0.93.1, Org release_8.3.4-775-g3308a5



Re: [O] Trouble evaluating R source code blocks with C-c C-c

2016-05-26 Thread John Hendy
Could you give a minimal example? The behavior does ring a bell, but I
can't recall what the solution might have been. I'd be happy to try
and reproduce if you'd like.

I think my typical go-to is to wipe ESS and re-download/make... That's
all I'm good for without more info.


Sorry!
John

On Thu, May 26, 2016 at 9:33 AM, Vikas Rawal
 wrote:
> I face a strange problem with evaluating R source code blocks. Occasionally, 
> they take much longer to produce the results when I try to evaluate them with 
> C-c C-c. On the other hand, if I do C-c ‘, go to a temporary R buffer, and 
> evaluate the code, everything works fine. In face, when I use C-c C-c, the 
> session would sometimes get stuck. Then I have to stop the process using C-g, 
> I find that the code had run in R, but the result was not being inserted in 
> Org buffer.
>
> Has anyone else faced this problem?
>
> I am on OS-X, Emacs 24, Org-mode version 8.3.4 (release_8.3.4-748-g7e320e, 
> and ess-version: 15.09-devel [elpa: 20150913.638]
>
> Vikas
>
>
>
>



[O] Restrict org-agenda to weekdays only?

2016-05-25 Thread John Hendy
I was a little surprised not to see org-mode have an option for
viewing only weekdays. Is there relatively elisp-light mechanism for
this, or some other built in method I'm not seeing to, say, calculate
the days to this past Monday and through this Fri and only show those?

Ideally I'd start from whatever workday is today and go through the
next 5-10 workdays, or at least this the view I'd like to try.


Thanks,
John



Re: [O] BUG: org-beamer-select-environment select multiple environments not working?

2016-05-25 Thread John Hendy
Just to comment on the original attempt, block and column (which is |,
not c which is columnS) are not mutually exclusive. I just did a
presentation and used both together. I'm not sure on the use-case for
columnS, but my structure was two side by side columns in a slide:

#+begin_src org
* slide
** col1  :B_block:BMCOL:
   :PROPERTIES:
   :BEAMER_env: block
   :BEAMER_col: 0.5
   :END:

- list
- of
- items

** col2  :B_block:BMCOL:
   :PROPERTIES:
   :BEAMER_env: block
   :BEAMER_col: 0.5
   :END:

[[pic]]
#+end_src

Probably not that helpful, just wanted to clarify that some
environments are still compatible (in case someone finds this and
thinks that *all* multiple combos are not possible anymore).


John


On Wed, May 25, 2016 at 3:31 PM, Nicolas Goaziou  wrote:
> Hello,
>
> Rasmus  writes:
>
>> Not necessarily.  On the top of my head, you could have a column group
>> with columns inside.  This example used to be possible.  I haven't checked
>> now.
>
> This one is not possible anymore. A column environment implies columns.
> You can also provide a columns environment explicitly, at a higher
> level, e.g., to provide specific options.
>
> Regards,
>
> --
> Nicolas Goaziou
>



[O] Inquiry about ical2org

2016-05-25 Thread John Hendy
Greetings,


I was looking to get my Outlook calendar into Orgmode to better
schedule my work (this way I can see my official meetings in Org
already where I do task management).

I found ical2org, and implemented it successfully via the "Share
calendar" .ics link that Outlook can generate. I have a question on
repeated meetings. The default appears to be this format:

<2016-05-19 Thu 08:00-09:00 +2w>--<2016-11-17 Thu>

I interpret this to be a bi-weekly meeting which runs through
2016-11-17, however agenda puts the meeting on every single day. From
reading around, this doesn't appear to be a valid format for
accomplishing period recurrences:
- 
http://stackoverflow.com/questions/2464598/org-mode-schedule-weekly-event-for-a-period

I just wanted to reach out and see if this is a setup issue or if
recursion + a range is not the right way to go about this. If not, my
quick fix would see if I can hack the awk script to not include the
end date for the range, as deleting that appears to work. That would
incorrectly show future appts that may not be real, though.


Thanks for any suggestions,
John



Re: [O] exporting documents w/ babel results w/o evaluating babel blocks

2016-05-23 Thread John Hendy
On Mon, May 23, 2016 at 1:27 PM, Nick Dokos  wrote:
> "Charles C. Berry"  writes:

[snip]

>
>> If there is a use case for a capability that is not well supported by
>> existing headers it would be good to have an example.
>>
>
> There's the use case that John describes: I've evaluated everything,
> checked everything, I'm ready for export, I don't want babel to touch
> the results - and I have a million blocks, so I'd rather have a global
> setting than go in with individual headers.
>
> If you've covered this in a previous reply, please ignore me: I've only
> paid intermittent attention to the thread, so apologies for missing a
> big chunk of what has gone on before in the thread.
>

I actually have never used o-e-b-e prior to this thread. I just dove
in as I was curious about it. My solution is using :eval yes/no as
desired. I often fiddle with blocks one by one, and when I'm done and
want to export the whole doc, my "file-wide" solution is simply:

M-x replace-string RET :eval yes RET :eval no

Works great for me. It can be a little tedious to find a mistake and
quick change no -> yes just to C-c C-c on it and then turn yes -> no,
but it works well enough. I can't see toggling a system-wide variable
related to babel execution as being any less cumbersome, actually.

After all the hoopla about o-e-b-e being a bad idea, and learning that
it doesn't just handle eval but formatting, too, I wonder what the
purpose of the variable *is* for?


John

> In any case, although I'm not happy about the state of things, I
> understand better why they are as they are.
>
> Thanks!
> --
> Nick
>
>



Re: [O] exporting documents w/ babel results w/o evaluating babel blocks

2016-05-22 Thread John Hendy
On Fri, May 20, 2016 at 4:20 PM, Charles C. Berry  wrote:
> On Fri, 20 May 2016, Nick Dokos wrote:
>
>> Ken Mankoff  writes:
>>
> [deleted discussion of  `org-export-babel-evaluate' settings]
>
>>
>> With ":exports results" and o-e-b-e set to nil, I get no evaluation on
>> export, but I get both code and results in the output.
>>
>>> There may have been a misunderstanding, but when I mentioned this in
>>> the bug report, I was told this is a "feature".
>>>
>>> http://thread.gmane.org/gmane.emacs.orgmode/107230/focus=107231
>>>
>>
>> Not sure what exactly Chuck meant is a feature, but IIUC, the fact
>> that I get both code and results even if I specify ":exports results"
>> looks like a bug to me.
>>
>
> I meant this, as of commit ec615b1..., `org-export-babel-evaluate' set to
> `nil' keeps the exporter from running this line
>
>   (org-export-execute-babel-code)
>
> during exports. So, 'no Babel code is run' in the sense that the above
> line does not execute.
>
> src-blocks and inline-src-blocks are neither run nor removed, and no
> #+results: or {{{results()}}} are added, removed, or
> modified. Babel handles all that. The exporter merely formats those
> things once Babel is done.
>
> So the bug, if any, is in the docstring in failing to mention that
> everything that babel does is switched off.

I don't entirely follow. Is there an intermediate step between a .org
src block, babel, and the exporter? If so, the behavior I see could
make sense. If not, then it doesn't.

As in, why is babel "execution" (as in o-e-b-e to non-nil) required to
*not* export this code into the resultant pdf?

#+begin_src R :exports results :results output
  dat <- 1:10
  print(dat)
#+end_src

With o-e-b-e set to nil, I get the code in the exported document,
hence my asking. If I turn o-e-b-e on, I don't (but get the results).
So perhaps the real missing bit from the documentation is something
like "all babel functionality is turned off, and babel is responsible
for executing code and generating/updating any results, as well as
controlling src block export controls (results vs. code vs. both). In
other words, without babel, src blocks in .org files are treated like
example blocks during export."

Is that accurate?

I think one of the main points of confusion in this thread still has
to do with why o-e-b-e switches what gets exported. If no code/results
are run/added/removed/modified as you mention, it doesn't speak to why
code export is always done for o-e-b-e = nil, but not otherwise. This
suggests babel is doing more than "executing code;" it's somehow
influencing what makes it into the export document. At least for me,
that was an unexpected interpretation of "everything babel does is
switched off."

In fact, I just had an idea... I have o-e-b-e set to always, but just
turned org-confirm-babel-evaluate to on (I typically have it off). If
export the above and type "no" to make sure the code block is not
executed I do *not* get the code in the document. I think this
confirms that babel's responsibilities include *what* plain text in
.org the exporter formats into the output format.

My suggestion would be to create a different variable to handle
formatting vs. execution unless things were designed this way? It
seems from all the comments that the majority of users expect the
time-heavy *code* not to be run at each export but still prefer the
blocks to behave as they intended. Theoretically, with all of my
results generated (e.g. into .pdf, .png, etc. plots; ascii tables,
whatever) shouldn't I be able to have o-e-b-e set to whatever and get
the same document? My document no longer depends on any of the code...
so I don't need it run, but the exported document will behave like
:exports both instead of :exports results just from turning babel off.


John

>
> Since the behavior that the OP wanted can be had by setting babel
> header args, I don't see this as a bug even though the behavior
> changed in a way that surprised him.
>
> Chuck
>



Re: [O] exporting documents w/ babel results w/o evaluating babel blocks

2016-05-20 Thread John Hendy
On Fri, May 20, 2016 at 11:45 AM, Ken Mankoff <mank...@gmail.com> wrote:
>
> Eric: You're running something newer (by date) than the commit which changed 
> the behavior, which was:
>
> ec615b1 - Fix `org-export-babel-evaluate' handling (2016-04-28)
>
> But with all the branches in git, I don't know if you have that commit or 
> not. Anyway, I'm not sure why it works for you. It doesn't appear to work for 
> John and I the way it used to. Do you have a global "eval: no" set somewhere?
>
> On 2016-05-20 at 12:14, John Hendy <jw.he...@gmail.com> wrote:
>> On Fri, May 20, 2016 at 10:57 AM, Ken Mankoff <mank...@gmail.com> wrote:
>>> As of an Org git commit a few weeks ago, Org exporting (and therefore
>>> Org) has become basically unusable for me. I used to be able to
>>> export code block results without evaluating the block during the
>>> export. I can no longer do this.
>>>
>>
>> Well, you're exporting them at least *once*, right? If not, where are
>> the results coming from?
>
> Yes, but only once. Or sometimes I generate the figure elsewhere (via 
> org-edit-special) and then manually put [[file:fig.pdf]] below the #+RESULTS:.
>
>> I do the same as I'm tweaking plots. Every code block I create has
>> :eval yes initially and once I'm satisfied with the results I just
>> change to :eval no and the generated results (for me, typically a
>> #+results line containing a link to a pdf plot generated by my code
>> block) are still included.
>>
>> Does this help at all? Sorry if I'm not understanding
>
> You understand, and this sort-of helps. I have never used :eval before. 
> Things just didn't evaluate by default, and I like it like that.
>
> ":eval no" fixes the problem at export, but then I can't evaluate the code 
> myself manually when not exporting.

Not in the buffer so as to replace results, but you *can* go into
interactive mode (if python has one) with =C-c '=. I use this
constantly, which allows me to ignore whatever :eval is set to, and
just putz around in the new code block buffer to my heart's content.
I'm approx. 100% R usage, so this still gives me access to the R
pop-up device to view plots or an R buffer to see results. You're
right though, there's no way to update the results block without
toggling :eval, manually running, and then resetting :eval back to no.

John

>
>> Mine is set to t. Interestingly, when I export the above after
>> deleting the results bit, no new results are generated. When I C-c
>> C-c, they are replaced. When I add :eval no, it does't appear to run
>> the code.
>
> Yes same here. This new behavior really sucks.
>
> I'm still trying to find a way where:
>   + code results do export
>   + code does not export
>   + code does not evaluate at export
>   + code can still be evaluated by me
>
> This was the behavior prior to
>
> ec615b1 - Fix `org-export-babel-evaluate' handling (2016-04-28)
>
> But not since.
>
>   -k.



Re: [O] exporting documents w/ babel results w/o evaluating babel blocks

2016-05-20 Thread John Hendy
On Fri, May 20, 2016 at 12:11 PM, Eric S Fraga  wrote:
> On Friday, 20 May 2016 at 17:06, Ken Mankoff wrote:
>
> [...]
>
>> Thanks for clarifying your workflow. That seems to work for a small
>> example. But what would you do if you had a manuscript with 100 code
>> blocks in it? And in general you're exporting it a lot without
>> changing anything in code, just editing the non-code text. But
>> occasionally you want to modify a code block (and its results) too?
>
> So, if I understand correctly, you have org-export-babel-evaluate set to
> nil?  If I set that, I no longer get asked whether I want anything
> evaluated but the (existing) results do get exported.  I just tried it
> to confirm.

Using this block,

#+begin_src R :exports results
print("hello")
#+end_src

I get the following (with *no* pre-existing #+results block manually
created with C-c C-c):

| *o-e-b-e* | *o-c-b-e* | *buffer*  | *doc*|
|---+---+---+--|
| nil   | t | nothing   | =print("hello")= |
| t | t | nothing   | =hello=  |
| t | nil   | nothing   | =hello=  |
| nil   | nil   | nothing   | =print("hello")= |
|---+---+---+--|

Variables org-export-babel-evaluate and org-confirm-babel-evaluate
abbreviated above.

I find two things bizarre:
- these options (well, just o-e-b-e it seems) would change what's exported?
- why without C-c C-c which initiates the #+results block, exporting
which causes babel to execute code doesn't insert the results block.
Is this intended or for a reason?

I've not really looked into these variables and just use :eval yes/no
to toggle things. I find it easy enough to create all my blocks with
:eval no, and do a quick change to =yes= as I'm iteratively exporting.
Finally, I can do a replace-string to catch any missed :eval yes's
before a final export.

>
>> In the above scenario, I used to edit the code, and =C-c C-c= it
>> manually to get the updates into the results. When I exported the
>> document (C-e l l), it would export in ~1 second (even a >100 page
>> document) and not prompt me about executing code blocks.
>
> Yes, I do this as well in such a case.
>
> --
> : Eric S Fraga (0xFFFCF67D), Emacs 25.0.92.1, Org release_8.3.4-775-g3308a5



Re: [O] exporting documents w/ babel results w/o evaluating babel blocks

2016-05-20 Thread John Hendy
On Fri, May 20, 2016 at 10:57 AM, Ken Mankoff  wrote:
> Hi List,
>
> I'm repeating a question here from a recent bug report because I have a 
> feeling official-looking bug reports might get read less than normal 
> questions. Sorry for the re-post.
>
> As of an Org git commit a few weeks ago, Org exporting (and therefore Org) 
> has become basically unusable for me. I used to be able to export code block 
> results without evaluating the block during the export. I can no longer do 
> this.
>
> The following headers used to support the above behavior:
>
> #+BEGIN_SRC python :exports results :results output
> #+BEGIN_SRC python :exports results :results file
>   (and possibly with ":session foo" also)

Well, you're exporting them at least *once*, right? If not, where are
the results coming from?

Perhaps my use case is similar. I often write up an org doc with a
pretty heavy setup heading containing my main data reading in,
manipulation, statistics, etc. Maybe up to 100k total rows in a data
frame in R. Once I run that block the first time I'm working on the
document I just put =:eval no= in the src block options.

I do the same as I'm tweaking plots. Every code block I create has
:eval yes initially and once I'm satisfied with the results I just
change to :eval no and the generated results (for me, typically a
#+results line containing a link to a pdf plot generated by my code
block) are still included.

Does this help at all? Sorry if I'm not understanding

>
> Is anyone running the current git head? And if so, can you export a document 
> that consists of the following, or something similar to the following (i.e. 
> do you use ":cache t" or ":cache nil")?
>
> #+BEGIN_SRC python :results output :exports results :session foo
> print("hello, world")
> #+END_SRC
> #+RESULTS:
> : hello, world
>
> If you can export this without running the code, what settings are you using? 
> In particular, what is the value of =org-export-babel-evaluate=?

Mine is set to t. Interestingly, when I export the above after
deleting the results bit, no new results are generated. When I C-c
C-c, they are replaced. When I add :eval no, it does't appear to run
the code.


Hope that helps,
John

>
> Thanks,
>
>   -k.
>



Re: [O] template for writing Emacs manuals in Org

2016-05-16 Thread John Hendy
I don't recall it, but these look along similar lines?
- 
https://www.reddit.com/r/emacs/comments/2bummt/changing_emacs_documentation_system_from_texinfo/
- https://lwn.net/Articles/625072/


John

On Sat, May 14, 2016 at 2:21 AM, Eric Abrahamsen
 wrote:
> I remember a while ago there was a discussion (on emacs.devel? I can't
> remember) about the format for Emacs manuals, and Org came into it, and
> at some point someone (Rasmus? Achim Gratz? I can't remember this
> either) posted a template for doing Emacs manuals in Org. It was
> particularly useful because it had all the macros set up to create the
> texinfo index, and it wasn't simple.
>
> I can't remember enough of the details to find the post anymore, though
> I've tried. Does anyone recall this, or know how to find it? Or does
> anyone have a good setup for exporting to Emacs manuals, plus index?
>
> Let's add it to Worg once we've got it!
>
> Thanks,
> Eric
>
>



Re: [O] Bug: org -> org export ignores latex blocks [8.3.4 (8.3.4-50-g83e373-elpaplus @ /home/andrea/.emacs.d/elpa/org-plus-contrib-20160509/)]

2016-05-12 Thread John Hendy
On Thu, May 12, 2016 at 2:24 PM, Kaushal Modi <kaushal.m...@gmail.com> wrote:
>
> On Thu, May 12, 2016 at 3:16 PM John Hendy <jw.he...@gmail.com> wrote:
>>
>> Ah. I always wondered about that since the change is reported for 9.0
>> but it's in effect for me on:
>>
>> Org-mode version 8.3.4 (release_8.3.4-753-gda4db33 @ ~/.elisp/org/lisp/)
>>
>> But I've obviously built from git. Simple case would be for Andrea to
>> just try it and let us know :) Other than that, I'd defer to Nicholas
>> to say whether or not this should be going on.
>
>
> If you just git clone, you clone the bleeding-edge master branch with awesome 
> new features :) You are on master branch built recently.
>
>
> I agree that the version number is confusing for people building from the 
> master branch. It's figuratively 9.0+, but org-version still gives 
> 8.3.4-xxx-gxxx.

Indeed, I didn't know that. I agree, if it's basically a
9.0-prerelease analog, knowing that 9.0 features are building (via the
version number) would be nice to know. Or maybe that's common
knowledge other than in my head :)

Thanks,
John

>
> It would have been nice if the master branch built version showed a different 
> numerical version number than the one on the maint branch. Or probably some 
> prefix like dev/master? Nicolas?
> --
>
> --
> Kaushal Modi



[O] No output from babel shell src block

2016-05-12 Thread John Hendy
Hello,


I've not used shell in babel much, and am confused. I was trying to
include diff output from a block in an analysis and it's not giving
any output.

As a test, I have a.txt which contains 1 and b.txt which contains 2,
with boths in ~/Desktop.

Manually:
$ cd ~/Desktop
$ diff a.txt b.txt
1c1
< 1
---
> 2

Org:
#+begin_src shell

cd ~/Desktop
diff a.txt b.txt

#+end_src

I get "Code block produced no output" with C-c C-c. If I replace the
diff line with =pwd=, it puts the current directory in the results
block (works as expected).

I've tried replace, append, output, raw, and value for :results, as
well as results and both for :exports. I've also tried using a #+name:
which gives me a results block for the output, but it's empty.

Am I missing something? Perhaps there's an analog for how some
programs need a print() of some kind for the results to show up? Then
again, I don't know why =pwd= works... There's no worg page for the
shell language (surprised me!).


Thanks,
John



  1   2   3   4   5   6   7   8   9   10   >