Re: LaTex to PDF workflow using Leo

2017-04-11 Thread Largo84
Hmm, not sure how that would work. It might be relatively easy to invoke 
such a script when setting up the node at first, but what happens if/when 
you decide to move the node and its level changes? What would be really 
useful would be a way to traverse the hierarchy after it's written and 
ready for compiling to verify that each node is labeled correctly. I can't 
even imagine how that would be possible with a script (I do it manually 
now). But, I suppose just about anything is possible with enough ingenuity.

Rob.

>
> ​This would be an interesting enhancement.
>
> Leo's rst3 command does exactly this, but the code in leo/core/leoRst.py 
> might induce heart palpitations.  There are reasons for all that 
> complexity, and probably none of them relate to latex.
>
> In fact, it should be relatively simple to write a script or plugin to do 
> something useful.  Define the *latex level* of a node p to be p.level() - 
> root.level(), where root is the root node of your hierarchy or latex 
> markup. Use this computed level to choose the latex markup.
>
> HTH.  Feel free to ask questions or to create an enhancement request.
>
> 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: @clean nodes stopped updating

2017-04-11 Thread Edward K. Ream
On Tuesday, April 11, 2017 at 3:40:38 PM UTC-5, Edward K. Ream wrote:

> HTH.  We'll get to the bottom of this.

And be sure to verify that your tool chain is actually updating the files 
you think it is.

The symptom that you must reload Leo to see changed files is quite 
strange.  It argues that your tool chain *is* updating files, but we have 
to check everything.

We have to run Leo in a console so we can see all exceptions, especially 
uncaught exceptions.

For sure something strange is going on. A silently hidden exception, an 
invisible popup, files not actually being saved, on_idle checks not 
happening at all...

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: @clean nodes stopped updating

2017-04-11 Thread Edward K. Ream
On Tuesday, April 11, 2017 at 3:34:35 PM UTC-5, Edward K. Ream wrote:

As I noted in #472 , 
> everything works for me on Windows. So this is the typical long-distance 
> debugging mystery.  Here are my suggestions.
>

And here are a few more:

1. In efc.on_idle, try changing the "if 1:" statement to "if 0:".  This 
will revert to older code.  It's quicker and simpler if you only have a few 
files to check.

2. Enable other traces, especially in efc.has_changed.  Make sure this 
method is being called periodically, and check that it returns the proper 
value.  You might also want to enable traces in various other idle_check_* 
methods.

HTH.  We'll get to the bottom of this.

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: @clean nodes stopped updating

2017-04-11 Thread Edward K. Ream


On Tuesday, April 11, 2017 at 3:34:35 PM UTC-5, Edward K. Ream wrote:
>
> On Tuesday, April 11, 2017 at 10:36:30 AM UTC-5, Edward K. Ream wrote:
>
> > I'll attempt a fix later today.
>
> As I noted in #472 , 
> everything works for me on Windows. So this is the typical long-distance 
> debugging mystery.  Here are my suggestions.
>

One more thing.  Apparently the pop-up that says that says that a file has 
been changed may not always be visible.  I'll see what I can do to bring it 
to the front more reliably.

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: @clean nodes stopped updating

2017-04-11 Thread Edward K. Ream
On Tuesday, April 11, 2017 at 10:36:30 AM UTC-5, Edward K. Ream wrote:

> I'll attempt a fix later today.

As I noted in #472 , 
everything works for me on Windows. So this is the typical long-distance 
debugging mystery.  Here are my suggestions.

1. [Crucial]  Make sure you are running Leo from a console.  That way you 
can see messages that might not appear in Leo's log pane.

2. Pull rev b91bc76.  It contains improved traces for 
ExternalFilesController.on_idle.  This is the code that periodically checks 
for changed files.  Depending on how many files your .leo file contains, 
this may take awhile.

3. Enable tracing in efc.on_idle by setting trace = True.  You should see 
regular traces when you restart Leo.

4. Try running Leo with the --no-plugins command-line option.

5. If none of this works there is not much option but to use git bisect 
.  Go back as far as you need to until you 
find a version that works.

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: LaTex to PDF workflow using Leo

2017-04-11 Thread Edward K. Ream
On Tue, Apr 11, 2017 at 8:46 AM, Arjan  wrote:

>
> I'm using Leo to organize sections like \chapter, \section and
> \subsection. Since I'm just writing latex in Leo, I need to keep track of
> the right hierarchies, so I can't freely move nodes around in the hierarchy
> or I end up with \subsection at the same level as \section, etc. It would
> be great to be able to let Leo handle this.
>

​This would be an interesting enhancement.

Leo's rst3 command does exactly this, but the code in leo/core/leoRst.py
might induce heart palpitations.  There are reasons for all that
complexity, and probably none of them relate to latex.

In fact, it should be relatively simple to write a script or plugin to do
something useful.  Define the *latex level* of a node p to be p.level() -
root.level(), where root is the root node of your hierarchy or latex
markup. Use this computed level to choose the latex markup.

HTH.  Feel free to ask questions or to create an enhancement request.

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: @clean nodes stopped updating

2017-04-11 Thread Edward K. Ream
On Tuesday, April 11, 2017 at 5:08:58 AM UTC-5, Edward K. Ream wrote:

> Please file a bug report here 


Never mind.  I just created #472 
. I'll attempt a fix 
later today.

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: ENB: 20 years of lint removed from leoAtFile.py

2017-04-11 Thread Kent Tenney
Looking forward to it!

On Mon, Apr 10, 2017 at 4:04 PM, Edward K. Ream  wrote:

>
> On Mon, Apr 10, 2017 at 12:38 PM, Edward K. Ream 
> wrote:
>
> *tl;dr:* Many switches in methods of the AtFile class were confusing or
>> unnecessary.  The new code is now as simple as I can make it.  Afaik, there
>> are no more "huh?"s left.
>>
>
> ​To repeat something I've said several times recently, this work required
> all the major tools available to me:
> clone-find commands, git, pylint and pyflakes:
>
> - git makes everything safe.
> - pyflakes catches almost errors immediately.
> - pylint catches more subtle errors that sometimes escape unit tests.
> - Leo's clone-find commands revealed global patterns quickly.
>
> I would not have attempted this work without git and the clone-find
> commands. The latter allow me to answer complex questions about code
> quickly. I can then reorganize the searches for even greater clarity.
>
> I'm hoping to convince Terry and Kent at our upcoming meeting that the
> clone-find commands are worth using.
>
> 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.
>

-- 
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: LaTex to PDF workflow using Leo

2017-04-11 Thread Largo84
Thanks, Arjan for the compile code, will have to try it out on my system.

I had a similar experience, sometimes finding that I had Leo's node 
structure out of sync with LaTex structure tags. I sort of solved that by 
putting all content in separate input files (I use .txi as an extension to 
avoid confusion) and only using LaTex structure elements in the final 
output shell. Since I mix and match content a lot, this makes it a lot 
easier for me. It's still possible to have the structure not match up, but 
it's easier to fix now. If you look at the example Leo file I posted 
yesterday you will see how I implement that strategy.

HTH

Rob...

>
> I'm using Leo to organize sections like \chapter, \section and 
> \subsection. Since I'm just writing latex in Leo, I need to keep track of 
> the right hierarchies, so I can't freely move nodes around in the hierarchy 
> or I end up with \subsection at the same level as \section, etc. It would 
> be great to be able to let Leo handle this.
> Arjan
>
>

-- 
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: LaTex to PDF workflow using Leo

2017-04-11 Thread Arjan
Thanks, interesting to see what people are using for LaTeX. I'll describe 
my process, I'd be happy to hear about improvements. This is all just 
hardcoded and hacked together, as I currently work on just one LaTeX 
project.
I believe there are older threads which discuss more elaborate processing 
schemes, but I wasn't sure how to use those.

I'm using Leo to organize sections like \chapter, \section and \subsection. 
Since I'm just writing latex in Leo, I need to keep track of the right 
hierarchies, so I can't freely move nodes around in the hierarchy or I end 
up with \subsection at the same level as \section, etc. It would be great 
to be able to let Leo handle this.

MyProject
  - @clean myproject/myproject.tex
  - @clean myproject/references.bib
  - Compile myproject.tex

The compile node has something like this:
@language python

import os
import subprocess
import sys

repository_dir = os.path.abspath(os.curdir)

# The system commands should be run from the folder containing the 
tex/cls/clo/bib files.
working_dir = os.path.join(repository_dir, 'myproject')
os.chdir(working_dir)

# The commands to run.
run_xelatex = 'xelatex ' + working_dir + os.sep + 'myproject.tex'
run_bibtex =  'bibtex ' + working_dir + os.sep + 'myproject'

g.es('Running XeLaTeX and BibTeX')
# os.system starts a new subshell
# @todo: is it possible to run the below commands in one subshell 
consecutively?
os.system(run_xelatex)
os.system(run_bibtex)
os.system(run_xelatex)

# Platform-independent file opening
def open_file(filename):
if sys.platform == "win32":
os.startfile(filename)
else:
opener ="xdg-open"
subprocess.call([opener, filename])

open_file('myproject.pdf')

Arjan

-- 
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: #385: problems when switching git branches

2017-04-11 Thread Edward K. Ream
On Tuesday, April 11, 2017 at 5:57:04 AM UTC-5, Edward K. Ream wrote:

> There is a better workaround, namely, use a separate local leoPy.leo for 
each branch:
 
[big snip]

> I'll be using (testing) this today.

All went very well, without any surprises at all.  This workaround is 
probably good enough for the foreseeable future.  This is a good thing, 
because fixing #385  
could be tricky.

My master-leoPy.leo will never contain clones. This *might* sidestep #385 
issues completely. It will certainly minimize those issues.

Edward

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.


Important: c9a2db7 merges the js branch. It contains new read/write code

2017-04-11 Thread Edward K. Ream
Leo's master branch now contains the new, simpler, code that reads and 
writes external files. This code appears safe and solid.  It passes all 
tests, including new ones.

This is a major change in Leo.  Please report any problem immediately.

Imo, these changes had to be made.  Some were needed to fixing javascript 
importer problems. But most changes cleared up serious confusions in the 
code.  Any problems will be temporary.  The benefits will be forever.

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: #385: problems when switching git branches

2017-04-11 Thread Edward K. Ream
On Tuesday, April 11, 2017 at 5:57:04 AM UTC-5, Edward K. Ream wrote:
>
>
> There is a better workaround, namely, use a separate local leoPy.leo for 
> each branch:
>
> - Create a directory, *not tracked by git*, to hold the copies, say 
> ~/LeoPy-Copies. This is the *copies folder*.
>

The data in this folder is valuable and not tracked, so perhaps it should 
be in your DropBox folder.

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: #385: problems when switching git branches

2017-04-11 Thread Edward K. Ream
On Saturday, April 8, 2017 at 11:29:37 PM UTC-5, Edward K. Ream wrote:

..it is difficult to switch between branches in such a way that 
> Ctrl+Shift+W, write-at-file-nodes, doesn't change files when the branch 
> changes outline structure.
>

There is a better workaround, namely, use a separate local leoPy.leo for 
each branch:

- Create a directory, *not tracked by git*, to hold the copies, say 
~/LeoPy-Copies. This is the *copies folder*.

- When switching *out of* branch x, copy leoPy.leo from leo/core *to* the 
copies folder as* x-*leoPy.leo.

- When switching *into* branch y, copy *y*-leoPy.leo *from *the copies 
folder to leo/core, renamed as leoPy.leo.

- In the copies folder, master-leoPy.leo is the copy of leoPy.leo from 
master.

As a result:

- leo/core/leoPy.leo should always be in sync with the code in the present 
branch.

- All files in the copies folder clearly indicate to which branch they 
belong.

I'll be using (testing) this today.

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: leo-editor-contrib on GitHub

2017-04-11 Thread Edward K. Ream
On Mon, Apr 10, 2017 at 10:25 AM, Terry Brown  wrote:

I've been using this repo. https://github.com/leo-editor/snippets
>
> which (I think) I created because GitHub Organizations (like
> ​ ​
> leo-editor) can't have GitHub Gists.


​The "Code Snippets" link​

​at the left of Leo's home page goes to the snippets page.

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: @clean nodes stopped updating

2017-04-11 Thread Edward K. Ream
On Tue, Apr 11, 2017 at 4:59 AM, Joe Orr  wrote:

> I tried rolling back to the commit before b7638799d6, no luck.
>
> In fact, now it is worse, when I make a change in Webstorm and then go to
> Leo, not only is there no warning, any changes I then make via Leo clobber
> the Webstorm file with no warning.
>

​Please file a bug report here
so I can track this
issue.  I'll attempt a fix today.

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: @clean nodes stopped updating

2017-04-11 Thread Joe Orr
I tried rolling back to the commit before b7638799d6, no luck.

In fact, now it is worse, when I make a change in Webstorm and then go to 
Leo, not only is there no warning, any changes I then make via Leo clobber 
the Webstorm file with no warning.

And it is still doing this after I reset to the current version.

I'm not sure what to do with git bisect, I don't have any version (on Mac, 
OS 10.12.4) for which this isn't happening. It started happening for no 
reason that I can tell while I was still on version 5.3.

I think this needs to get sorted out before I tell people about the HTML5 
viewer because I want to publicize this feature in particular.

I don't know Python but I could maybe try to step through debug it if 
someone could point me to the code lines that are involved here. 

Anyone else using Mac and not having problems? If so, what version are you 
using?

I'm not having this problem on Windows (version 5.3b) but having other 
problems with Windows version, will send separate email after this is 
sorted out. (For one thing, unable to install latest on Windows).

Joe

On Sunday, April 9, 2017 at 9:17:50 AM UTC-4, Edward K. Ream wrote:
>
>
>
> On Sat, Apr 8, 2017 at 9:58 AM, vitalije  
> wrote:
>
>>
>> The change was introduced in b7638799d6 commit.
>> HTH Vitalije
>>
>
> ​If that doesn't work, please use git bisect to isolate the offending 
> commits.  I have done considerable hacking recently in this area.
>
> 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: LaTex to PDF workflow using Leo

2017-04-11 Thread Israel Hands
Thanks Rob - I've had a quick look and there's a lot there to get my head 
round - thanks for sharing it. The manual processing is the same in 
Scrivener which will compile to a Latex file but then I load that into 
TexStudio for processing and previewing.  I haven't used @outline-data 
tree-abbreviations  - so I'm going to start there, I'm sure there will be 
questions to follow!  Ta IH

On Tuesday, April 11, 2017 at 3:38:25 AM UTC+1, Largo84 wrote:
>
> No, I run processing (typesetting) in TeXNicCenter manually. Typically, I 
> create a blank project file and open however many files required for that 
> project. That way it's easier to clean up the extra files created during 
> the process steps. HTH. There might be a way to invoke the LaTex commands 
> through Leo, but that's way above my pay grade.
>
> Rob...
>
> On Monday, April 10, 2017 at 5:32:49 PM UTC-4, Israel Hands wrote:
>>
>> Thanks Rob - will have a look at the example tomorrow. Can you control 
>> TexNicCenter from Leo - or do you process the file and preview process 
>> manually? Ta
>>
>> IH
>>
>>
>>
>> On Monday, April 10, 2017 at 6:29:26 PM UTC+1, Largo84 wrote:
>>>
>>> Just posted a Leo file with examples on GitHub here 
>>> 
>>> .
>>>
>>>
>>> Regards,
 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.