Browse Source

LaTeX uses '/' for paths, even on windows

pull/142/head
Oliverpool 9 years ago
parent
commit
6276cf1ecd
  1. 4
      patacrep/latex/__init__.py
  2. 3
      patacrep/songs/chordpro/__init__.py
  3. 2
      patacrep/songs/chordpro/data/latex/content_image
  4. 2
      patacrep/songs/chordpro/data/latex/content_partition

4
patacrep/latex/__init__.py

@ -29,3 +29,7 @@ def lang2babel(lang):
available = ", ".join(BABEL_LANGUAGES.keys()) available = ", ".join(BABEL_LANGUAGES.keys())
LOGGER.error('Unknown lang code: ' + lang + '. Supported: ' + available) LOGGER.error('Unknown lang code: ' + lang + '. Supported: ' + available)
return 'english' return 'english'
def latexpath(path):
"""In LaTeX paths use '/' even on windows"""
return path.replace('\\', '/')

3
patacrep/songs/chordpro/__init__.py

@ -10,7 +10,7 @@ from patacrep import encoding, files
from patacrep.songs import Song from patacrep.songs import Song
from patacrep.songs.chordpro.syntax import parse_song from patacrep.songs.chordpro.syntax import parse_song
from patacrep.templates import Renderer from patacrep.templates import Renderer
from patacrep.latex import lang2babel from patacrep.latex import lang2babel, latexpath
LOGGER = logging.getLogger(__name__) LOGGER = logging.getLogger(__name__)
@ -54,6 +54,7 @@ class ChordproSong(Song):
jinjaenv.filters['search_image'] = self.search_image jinjaenv.filters['search_image'] = self.search_image
jinjaenv.filters['search_partition'] = self.search_partition jinjaenv.filters['search_partition'] = self.search_partition
jinjaenv.filters['lang2babel'] = lang2babel jinjaenv.filters['lang2babel'] = lang2babel
jinjaenv.filters['latexpath'] = latexpath
try: try:
return Renderer( return Renderer(

2
patacrep/songs/chordpro/data/latex/content_image

@ -1,5 +1,5 @@
(* block image *) (* block image *)
(* set image = content.argument|search_image *) (* set image = content.argument|search_image|latexpath *)
(* if image *) (* if image *)
\image{(( image ))} \image{(( image ))}
(*- endif *) (*- endif *)

2
patacrep/songs/chordpro/data/latex/content_partition

@ -1,6 +1,6 @@
(* block partition *) (* block partition *)
(* set partition = content.argument|search_partition *) (* set partition = content.argument|search_partition *)
(* if partition *) (* if partition *)
\lilypond{ ((- content.argument|search_partition -)) } \lilypond{ ((- content.argument|search_partition|latexpath -)) }
(*- endif -*) (*- endif -*)
(*- endblock -*) (*- endblock -*)

Loading…
Cancel
Save