From c7268a147471695b6ece884e607f9362aecb7baa Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Wed, 20 Jul 2016 22:40:39 +0200 Subject: [PATCH] Do no espace ~ and ^ --- .../data/templates/songs/chordpro/latex/content_word | 2 +- patacrep/songs/chordpro/__init__.py | 4 ++-- test/test_book/special.tex.control | 11 +++++++++-- test/test_book/special_datadir/songs/special.csg | 2 ++ test/test_song/special.tsg | 4 ++-- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/patacrep/data/templates/songs/chordpro/latex/content_word b/patacrep/data/templates/songs/chordpro/latex/content_word index ebe4d86f..f52978c4 100644 --- a/patacrep/data/templates/songs/chordpro/latex/content_word +++ b/patacrep/data/templates/songs/chordpro/latex/content_word @@ -1 +1 @@ -(( content.value|escape_specials('{}&#_^%~$\\') )) +(( content.value|escape_specials('{}&#_%$\\') )) diff --git a/patacrep/songs/chordpro/__init__.py b/patacrep/songs/chordpro/__init__.py index 9d10d7b4..7f3a88e1 100644 --- a/patacrep/songs/chordpro/__init__.py +++ b/patacrep/songs/chordpro/__init__.py @@ -132,8 +132,8 @@ class Chordpro2LatexSong(ChordproSong): '{': r'\{', '}': r'\}', '\\': r'\textbackslash{}', - '^': r'\textasciicircum{}', - '~': r'\textasciitilde{}', + '^': r'\textasciicircum{}', # Has special meaning in songs package (repeat chord) + '~': r'\textasciitilde{}', # Used for non-breaking space in LaTeX '#': r'\#', '&': r'\&', '$': r'\$', diff --git a/test/test_book/special.tex.control b/test/test_book/special.tex.control index e2fa50fe..74825e21 100644 --- a/test/test_book/special.tex.control +++ b/test/test_book/special.tex.control @@ -144,13 +144,20 @@ guitar, +\ifchorded +\begin{verse*} + \musicnote {\nolyrics \[A]} +\end{verse*} +\fi + + \begin{verse} - \& \$ \% \# \_ \} \{ \textasciitilde{} \textasciicircum{} \textbackslash{} + \& \$ \% \# \_ \} \{ ~ ^ \textbackslash{} \end{verse} \begin{chorus} - \& \$ \% \# \_ \} \{ \textasciitilde{} \textasciicircum{} \textbackslash{} + \& \$ \% \# \_ \} \{ ~ ^ \textbackslash{} \end{chorus} \endsong diff --git a/test/test_book/special_datadir/songs/special.csg b/test/test_book/special_datadir/songs/special.csg index f5874022..84d3f8be 100644 --- a/test/test_book/special_datadir/songs/special.csg +++ b/test/test_book/special_datadir/songs/special.csg @@ -3,6 +3,8 @@ {album: & $ % # _ \} \{ ~ ^ \\} {url: http://&$%#_~^} +[A] + & $ % \# _ \} \{ ~ ^ \\ {start_of_chorus} diff --git a/test/test_song/special.tsg b/test/test_song/special.tsg index a7b232bb..c5b82988 100644 --- a/test/test_song/special.tsg +++ b/test/test_song/special.tsg @@ -11,12 +11,12 @@ \begin{verse} - \& \$ \% \# \_ \} \{ \textasciitilde{} \textasciicircum{} \textbackslash{} + \& \$ \% \# \_ \} \{ ~ ^ \textbackslash{} \end{verse} \begin{chorus} - \& \$ \% \# \_ \} \{ \textasciitilde{} \textasciicircum{} \textbackslash{} + \& \$ \% \# \_ \} \{ ~ ^ \textbackslash{} \end{chorus} \endsong