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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.