Re: I love Leo, but... Scrivener and Org-Mode

2018-05-15 Thread Edward K. Ream
On Mon, May 14, 2018 at 5:05 PM, Israel Hands  wrote:

>
> I got greedy though and added the line below
>
>
> ​​
> g.execute_shell_commands('"C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe"
>  latex_test.pdf')
>
> which works but hangs Leo
>

​Use a list of arguments, not a single string:

​
g.execute_shell_commands([
'"C:\Program Files (x86)\SumatraPDF\SumatraPDF.exe",
'latex_test.pdf'
])

HTH.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: I love Leo, but... Scrivener and Org-Mode

2018-05-14 Thread Israel Hands
Thanks Edward,

  g.execute_shell_commands('pdflatex latex_test.tex')

Does indeed do the business - my leo file is in the same directory as the 
latex files which maybe makes the path stuff easier. 

I got greedy though and added the line below

  g.execute_shell_commands('"C:\Program Files 
(x86)\SumatraPDF\SumatraPDF.exe"  latex_test.pdf')

which works but hangs Leo so I guess I need a Sumatra batch file.  Can I 
execute that with g.execute_shell_commands?

ta

IH



On Sunday, 13 May 2018 21:03:39 UTC+1, Edward K. Ream wrote:
>
>
>
> On Sun, May 13, 2018 at 8:59 AM, Israel Hands  > wrote:
>
>> Thanks Edward - I hadn't used @clean before and that seems to work just 
>> fine. 
>>
>
> ​Good to know.​
>  
>
> Is it possible to undertake the next step and send commands to the OS 
>> command line
>> ​.
>>
>
> ​Yes. There are many ways.  g.execute_shell_commands is a thin wrapper 
> around subprocess.Popen:
>
>g.execute_shell_commands('pdflatex currentfile.tex')
>
> ​
>> Is it possible to view a pdf from within Leo? I use Sumatra which is cool 
>> but thought I better check while on the subject?
>>
>
> ​On my machine I have a .bat file called acrobat that opens Adobe Reader.  
> ​The following opens any .pdf file without hanging Leo:​
>
>
> ​path = ''
> command = 'acrobat %s' % path
> g.execute_shell_commands(command)​
>
> ​Edward​
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: I love Leo, but... Scrivener and Org-Mode

2018-05-13 Thread Edward K. Ream
On Sun, May 13, 2018 at 8:59 AM, Israel Hands  wrote:

> Thanks Edward - I hadn't used @clean before and that seems to work just
> fine.
>

​Good to know.​


Is it possible to undertake the next step and send commands to the OS
> command line
> ​.
>

​Yes. There are many ways.  g.execute_shell_commands is a thin wrapper
around subprocess.Popen:

   g.execute_shell_commands('pdflatex currentfile.tex')

​
> Is it possible to view a pdf from within Leo? I use Sumatra which is cool
> but thought I better check while on the subject?
>

​On my machine I have a .bat file called acrobat that opens Adobe Reader.
​The following opens any .pdf file without hanging Leo:​


​path = ''
command = 'acrobat %s' % path
g.execute_shell_commands(command)​

​Edward​

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: I love Leo, but... Scrivener and Org-Mode

2018-05-13 Thread Israel Hands
Thanks Edward - I hadn't used @clean before and that seems to work just 
fine. 

Is it possible to undertake the next step and send commands to the OS 
command line - I think this is how AucTex works in Emacs - so I can send 
'pdflatex currentfile.tex' to the windows command line so that the file can 
be processed and a pdf produced?  If so this is going to be much easier 
than Scrivener compiling.

Is it possible to view a pdf from within Leo? I use Sumatra which is cool 
but thought I better check while on the subject?

Thanks again for all Leo efforts, much appreciated.

IH


On Saturday, 3 March 2018 12:50:31 UTC, Israel Hands wrote:
>
> Disclaimer - I understand that nothing breaks software like trying to 
> satisfy the demands of disparate individual users. I do realise that so 
> this is observation not really requests and certainly not criticism!
> Leo is wonderful. 
>
> When I read the group postings I often don't feel at all like the target 
> audience. Now that of course is probably because I'm not the target 
> audience, my programming skills are just no where near good enough!
> What do I use Leo for then?
>
> Content - for me content is king. Manipulate it - tag it - filter it - 
> anything you like but it's about content.
>
> So my first use of Leo is as a free form database for notes, minutes, 
> agendas,passwords, journal type stuff. Leo is a tremendously effective 
> bucket for information - and the ability to link to external files adds to 
> this capability.
> I have written simple Python scripts.  
> So I am by no means a heavy duty user in terms of features but Leo is open 
> on my computers Win10 and OSX all the time. 
>
> However there are things (and these I'm sure are very particular to me) 
> that make me look elsewhere for tools that I probably could and should use 
> Leo for that I don't.
>
> I'm a writer and generally my output is PDFs via Latex. I have looked at 
> the info on a workflow from Leo and just not found the energy to tackle it.
>
> So I use Scrivener - which is tree based - looks great and has a 
> relatively simple 'compile' mode to Latex.  Now any attempt to turn Leo 
> into Scrivener would be madness, but if someone wrote a Latex plugin that
> simple folk like me could use that would be great. However I hear the 
> argument 'there are plenty of text to Latex tools why should Leo be 
> another?' Well Leo has the tremendous advantage of not having to 'contain' 
> all the files
> within itself - it can just reference them. So in Scrivener when I output 
>  the document.tex file and then I want to make edits then I have go round 
> the whole edit in scrivener, compile, TexStudio routine. Whereas in Leo I 
> could just reference the 
> document.tex file and edit it directly from within Leo or just make the 
> final edits in TexStudio know that Leo will be able to reflect those edits 
> in the referenced file. 
>
> Secondly I use org-mode - nothing sophisticated - not even as a todo list 
> - but as my daily agenda and reminder - I need a lot of reminding.  Org's 
> capture and schedule tools are second to none. And with the addition of 
> Beorg on iOS 
> Org is surely going from strength to strength.  Seeing my Org Mode Agenda 
> in Leo would be lovely - having that agenda fire reminders from Leo would 
> be even better. 
>
> I wonder if I am alone on this island or are there other Leo users who 
> step away to do Scrivener and Org type things? 
>
> Notwithstanding these minor niggles it would be churlish not to thank 
> everyone for their efforts especially EKR so THANKS!
>
>
> IH
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: I love Leo, but... Scrivener and Org-Mode

2018-05-12 Thread Edward K. Ream
On Saturday, March 3, 2018 at 6:50:31 AM UTC-6, Israel Hands wrote:

> Content - for me content is king. Manipulate it - tag it - filter it - 
anything you like but it's about content.

Imo, this is true for programmers as well as non-programmers.  There has 
been a lot of talk about a "self-fulfilling prophesy" that Leo is only for 
programmers.  The "content is king" principle is the antidote! 

>I'm a writer and generally my output is PDFs via Latex. I have looked at 
the info on a workflow from Leo and just not found the energy to tackle it.
...
>but if someone wrote a Latex plugin that simple folk like me could use 
that would be great.
...
> Whereas in Leo I could just reference the document.tex file and edit it 
directly from within Leo or just make the final edits in TexStudio know 
that Leo will be able to reflect those edits in the referenced file. 
 
Ok. Let's discuss what would work for you. 

First, have you tried @clean with @language latex?

Here is the test I use:



*Root node*@clean c:\test\latex_test.tex (head)
@language latex
@others



*First child*Part 1 (head)
\paragraph{one}
This is paragraph 1.
With another line.



*Second child*Part 2 (head)
\paragraph{two}
This is paragraph 2.

*Work flow*

1. Create the outline just describe in Leo.
2. Save the outline, and open it in Typora. *Leave Leo open.*
3. Make changes in Typora and save the file.
4. Leo will ask whether you want to change the outline.  Say ye.

You will now see the changes in Leo that you made in Typora. Leo's @clean 
might put the changes in the "wrong" node. If so, put them in the proper 
node and save the file.  Chances are, there will be no changes, but now Leo 
will remember where you want the lines the next time you open Leo.  That's 
the magic of @clean.

If you don't mind Leo sentinels, you could use @file instead of @clean.  
This ensure that changes you make in Typora will *always* go to the right 
node.  Having said that, you will probably want to use @clean.

Let me know if you want something more than this.  If not, I'll close #774 
.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: I love Leo, but... Scrivener and Org-Mode

2018-03-04 Thread Israel Hands
Thanks Edward a simple route to Latex would be brilliant. 

Leo does indeed open org mode files. And it takes each entry in a .org file 
and turns it into a node. 
With some help from Terry I've started writing a script that sorts the 
nodes from the org-mode file by date stamp, which org uses to produce the 
agenda.  
In the source file the org agenda items are not chronological the Agenda 
view imposes the chronology.  There is a calendar framework into which the 
agenda items are filed. The calendar does not 'know' what day it is in real 
time. You have to manually sync it - which doesn't seem to be a problem for 
users. And there are commands for how much of a calendar to produce - this 
week, this month, this year. 

I suppose having sorted the agenda items in Leo and having a calendar 
framework, node per day maybe? Then we just copy the child nodes to the 
relevant day for each item.  And then some sort of manual sync process that 
takes the view to the node for 'Today'  
When I write that down it doesn't sound too complicated. I have the sorting 
bit mostly working so maybe I should have a go at the next bit. However I'm 
very conscious of how thin the ice of my competence is!

Thinking about it there must be some real time checking going on because 
org-mode is able to fire off an OS based reminder when a scheduled or 
deadlined item becomes due. 

Enough thinking out loud,  Ta like. 

IH




On Saturday, 3 March 2018 13:16:33 UTC, Edward K. Ream wrote:
>
> On Sat, Mar 3, 2018 at 6:50 AM, Israel Hands  > wrote:
>
> ​> ​
> Disclaimer
>
> ​No need for that.
>
> ​>
> ​ ​
> Scrivener
> ​.. ​
> has a relatively simple 'compile' mode to Latex.
>
> ​#774 Convert Leo trees to LaTex as in Scrivener 
>  is a new 
> enhancement request. 
>
> Googling "scrivener convert to LaTeX" yields this page 
> . 
> It doesn't look to difficult to translate this approach into Leo. I've 
> given it a 5.7.1 milestone, which means it will happen this year.
>
> ​> ​
> Seeing my Org Mode Agenda in Leo would be lovely
> ​.
>
> Leo supposedly can read .org files.  Have you tried doing so? 
>
> > Having that agenda fire reminders from Leo would be even better.
>
> #775: Support org mode agendas in Leo 
>  is another 
> enhancement request.
>
> This has a 5.8 milestone, which is no guarantee that it will be done soon.
>
> ​Edward​
>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: I love Leo, but... Scrivener and Org-Mode

2018-03-03 Thread Largo84
Wow, reading Israel's post made me me think I wrote it (except the org-mode 
part). Probably 80+% of my work in Leo is writing content w/ LaTEX output. 
Most of the rest is variations of markdown and RST. I tried moving my work 
to Scrivener and really like it a lot. However, I like Leo better (plus 
it's free and open source) and once I figured out how to link to external 
resources, I never went back to Scrivener. I don't like using LaTEX content 
auto-generated from something else. I end up spending too much time 
cleaning it up. For what it's worth, my work flow with LaTEX content is:

   1. I mostly write content directly in LaTEX syntax (it's cleaner and 
   easier to edit directly). I created many Leo abbreviations to speed up the 
   process (lists, sections, etc.)
   2. I wrote several outline-data-tree abbreviations to create 'wrapper' 
   shells for different kinds of documents (preambles, etc). Then I simply 
   input the LaTEX content files (\input{content.tex}}.
   3. Since I'm mostly on Windows, I use the excellent TeXnic Center 
    compiler to create the PDF output. (I 
   never use it to edit, only to compile.)
   4. Rarely, if I need to export to something else (xxx.docx or xxx.rtf or 
   xxx.html), I write in multi-markdown and use Pandoc to output.

Excellent post and I'd love to share ideas with other Leo/LaTEX users on 
work flow. Perhaps I can steal a few better ideas or trade for some of my 
own.

Rob...

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: I love Leo, but... Scrivener and Org-Mode

2018-03-03 Thread Edward K. Ream
On Sat, Mar 3, 2018 at 8:34 AM, David Szent-Györgyi 
wrote:

Googling "scrivener convert to LaTeX" yields this page
>> .
>> It doesn't look to difficult to translate this approach into Leo. I've
>> given it a 5.7.1 milestone, which means it will happen this year.
>>
>
> Would it make sense to make use of
> ​​
> Pandoc ?
>

​This kinda a FAQ.  The short answer is, "maybe".  I don't use pandoc in
every workflow, so I'm not really familiar with it.  I've made a note of
this suggestion in #767
.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: I love Leo, but... Scrivener and Org-Mode

2018-03-03 Thread David Szent-Györgyi


On Saturday, March 3, 2018 at 7:50:31 AM UTC-5, Israel Hands wrote:
>
> What do I use Leo for then?
>
> Content - for me content is king. Manipulate it - tag it - filter it - 
> anything you like but it's about content.
>
> So my first use of Leo is as a free form database for notes, minutes, 
> agendas,passwords, journal type stuff. Leo is a tremendously effective 
> bucket for information - and the ability to link to external files adds to 
> this capability.
> I have written simple Python scripts.  
> So I am by no means a heavy duty user in terms of features but Leo is open 
> on my computers Win10 and OSX all the time. 
>
> However there are things (and these I'm sure are very particular to me) 
> that make me look elsewhere for tools that I probably could and should use 
> Leo for that I don't.
>
> I'm a writer and generally my output is PDFs via Latex. I have looked at 
> the info on a workflow from Leo and just not found the energy to tackle it.
>
> So I use Scrivener - which is tree based - looks great and has a 
> relatively simple 'compile' mode to Latex.  Now any attempt to turn Leo 
> into Scrivener would be madness, but if someone wrote a Latex plugin that
> simple folk like me could use that would be great. However I hear the 
> argument 'there are plenty of text to Latex tools why should Leo be 
> another?' Well Leo has the tremendous advantage of not having to 'contain' 
> all the files
> within itself - it can just reference them. So in Scrivener when I output 
>  the document.tex file and then I want to make edits then I have go round 
> the whole edit in scrivener, compile, TexStudio routine. Whereas in Leo I 
> could just reference the 
> document.tex file and edit it directly from within Leo or just make the 
> final edits in TexStudio know that Leo will be able to reflect those edits 
> in the referenced file. 
>
> Secondly I use org-mode - nothing sophisticated - not even as a todo list 
> - but as my daily agenda and reminder - I need a lot of reminding.  Org's 
> capture and schedule tools are second to none. And with the addition of 
> Beorg on iOS 
> Org is surely going from strength to strength.  Seeing my Org Mode Agenda 
> in Leo would be lovely - having that agenda fire reminders from Leo would 
> be even better. 
>
> I wonder if I am alone on this island or are there other Leo users who 
> step away to do Scrivener and Org type things? 
>

You're not alone. I'm about to begin exploring Scrivener on a Mac, for 
writing technical manuals, including one that would run into the hundreds 
of pages with at least one index - grist for MultiMarkdown, I'm waiting for 
the posting of the Scrivener project for the manual for Scrivener 3. 

I've been reluctant to plunge into Org Mode since I don't necessarily want 
to live in Emacs. 

Twelve years ago or so, I used Leo under Windows to organize a software 
development effort; I loved the outliner-with-clones toolkit. I've wondered 
whether anyone uses Scrivener to track technical support work, with the 
mindset that the history of technical support for a customer is a form of 
storytelling. . . . .

Since my Leo-based project of twelve years ago, I've switched jobs and 
moved from hosting my work on a Windows computer to basing my work on a 
Mac. I haven't figured out a Mac installation of Python and Qt and 
everything else needed for Leo. I gather that work has been done on 
installing Leo via Homebrew. Past reading left me preferring MacPorts to 
Homebrew, since MacPorts addressed multiple-user Macs where Homebrew did 
not. 

But, my Mac-related struggles are grist for a separate discussion thread. . 
. .

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: I love Leo, but... Scrivener and Org-Mode

2018-03-03 Thread David Szent-Györgyi
On Saturday, March 3, 2018 at 8:16:33 AM UTC-5, Edward K. Ream wrote:

> ​#774 Convert Leo trees to LaTex as in Scrivener 
>  is a new 
> enhancement request. 
>
> Googling "scrivener convert to LaTeX" yields this page 
> . 
> It doesn't look to difficult to translate this approach into Leo. I've 
> given it a 5.7.1 milestone, which means it will happen this year.
>

Would it make sense to make use of Pandoc ? 

>

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Re: I love Leo, but... Scrivener and Org-Mode

2018-03-03 Thread Edward K. Ream
On Sat, Mar 3, 2018 at 6:50 AM, Israel Hands  wrote:

​> ​
Disclaimer

​No need for that.

​>
​ ​
Scrivener
​.. ​
has a relatively simple 'compile' mode to Latex.

​#774 Convert Leo trees to LaTex as in Scrivener
 is a new enhancement
request.

Googling "scrivener convert to LaTeX" yields this page
.
It doesn't look to difficult to translate this approach into Leo. I've
given it a 5.7.1 milestone, which means it will happen this year.

​> ​
Seeing my Org Mode Agenda in Leo would be lovely
​.

Leo supposedly can read .org files.  Have you tried doing so?

> Having that agenda fire reminders from Leo would be even better.

#775: Support org mode agendas in Leo
 is another
enhancement request.

This has a 5.8 milestone, which is no guarantee that it will be done soon.

​Edward​

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to leo-editor+unsubscr...@googlegroups.com.
To post to this group, send email to leo-editor@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.