Browse Source

First draft for pdflatex replacement by lualatex

pull/135/head
Louis 9 years ago
parent
commit
30bbf8c533
  1. 16
      patacrep/build.py
  2. 5
      patacrep/data/latex/patacrep.sty
  3. 2
      patacrep/data/templates/layout.tex
  4. 2
      test/test_compilation/subdir.tex.control
  5. 3
      test/test_compilation/unicode.tex.control

16
patacrep/build.py

@ -136,10 +136,10 @@ class SongbookBuilder(object):
# if False, do not expect anything from stdin.
interactive = False
# if True, allow unsafe option, like adding the --shell-escape to pdflatex
# if True, allow unsafe option, like adding the --shell-escape to lualatex
unsafe = False
# Options to add to pdflatex
_pdflatex_options = []
# Options to add to lualatex
_lualatex_options = []
# Dictionary of functions that have been called by self._run_once(). Keys
# are function; values are return values of functions.
_called_functions = {}
@ -165,11 +165,11 @@ class SongbookBuilder(object):
def _set_latex(self):
"""Set LaTeX options."""
if self.unsafe:
self._pdflatex_options.append("--shell-escape")
self._lualatex_options.append("--shell-escape")
if not self.interactive:
self._pdflatex_options.append("-halt-on-error")
self._lualatex_options.append("-halt-on-error")
for datadir in self.songbook.config["datadir"]:
self._pdflatex_options.append(
self._lualatex_options.append(
'--include-directory="{}"'.format(datadir)
)
@ -180,7 +180,7 @@ class SongbookBuilder(object):
- steps: list of steps to perform to compile songbook. Available steps
are:
- tex: build .tex file from templates;
- pdf: compile .tex using pdflatex;
- pdf: compile .tex using lualatex;
- sbx: compile song and author indexes;
- clean: remove temporary files,
- any string beginning with a sharp sign (#): it is interpreted as a
@ -219,7 +219,7 @@ class SongbookBuilder(object):
try:
process = Popen(
["pdflatex"] + self._pdflatex_options + [self.basename],
["lualatex"] + self._lualatex_options + [self.basename],
stdin=PIPE,
stdout=PIPE,
stderr=PIPE,

5
patacrep/data/latex/patacrep.sty

@ -75,6 +75,11 @@
\pdfobjcompresslevel=0
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Unicode characters
\RequirePackage{fontspec}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Multilanguage management

2
patacrep/data/templates/layout.tex

@ -41,8 +41,6 @@
(* endblock *)
(* block songbookpreambule *)
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
(* endblock songbookpreambule *)

2
test/test_compilation/subdir.tex.control

@ -29,8 +29,6 @@ pictures,
guitar,
]{patacrep}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

3
test/test_compilation/unicode.tex.control

@ -29,8 +29,6 @@ pictures,
guitar,
]{patacrep}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
@ -54,7 +52,6 @@ guitar,
\newcommand{\href}[2]{\expandafter\url\expandafter{#1}}
}
\makeatother
\DeclareUnicodeCharacter{00A0}{~}
\usepackage{chords}

Loading…
Cancel
Save