Browse Source

Correctly (?) include the datadir to allow \import

pull/165/head
Oliverpool 9 years ago
parent
commit
66e2e40901
  1. 5
      patacrep/data/templates/layout.tex
  2. 2
      patacrep/songs/latex/__init__.py

5
patacrep/data/templates/layout.tex

@ -27,9 +27,14 @@
\makeatletter \makeatletter
\def\input@path{ % \def\input@path{ %
% include .sty folders
(* for dir in datadir *) (* for dir in datadir *)
{(( path2posix(dir) ))/latex/} % {(( path2posix(dir) ))/latex/} %
(* endfor *) (* endfor *)
% include datadir folders (for \import)
(* for dir in datadir *)
{(( path2posix(dir) ))/} %
(* endfor *)
} }
\makeatother \makeatother

2
patacrep/songs/latex/__init__.py

@ -36,7 +36,7 @@ class Latex2LatexSong(Song):
raise ValueError(self.datadir) raise ValueError(self.datadir)
path = files.path2posix(files.relpath( path = files.path2posix(files.relpath(
self.fullpath, self.fullpath,
os.path.dirname(self.datadir) self.datadir
)) ))
return r'\import{{{}/}}{{{}}}'.format(os.path.dirname(path), os.path.basename(path)) return r'\import{{{}/}}{{{}}}'.format(os.path.dirname(path), os.path.basename(path))

Loading…
Cancel
Save