From c647b5a00ced7d8f791705f2ad756335c4d7f739 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 15 Jan 2015 14:34:26 +0100 Subject: Fix revert to also filter frontmatter. --- pandoc-memoir | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'pandoc-memoir') diff --git a/pandoc-memoir b/pandoc-memoir index 8cf44a4..e28e16a 100755 --- a/pandoc-memoir +++ b/pandoc-memoir @@ -23,15 +23,23 @@ sub header { sub frontmatter { my $self = shift; - return [ RawBlock( 'latex', '\\frontmatter' ), header('About'), ] - if ( $self->name eq 'Header' and $self->level >= 1 - and stringify($self) eq 'About' ); + return [ +# RawBlock( 'latex', '\\frontmatter' ), + RawBlock( 'latex', + '{\\hypersetup{linkcolor=black}\\setcounter{tocdepth}{3}\\cleartorecto\\tableofcontents}' + ), + ] + if ( $self->name eq 'Header' and $self->level == 1 + and stringify($self) =~ /^Table/ ); return; } sub mainmatter { my $self = shift; - return [ RawBlock( 'latex', '\\mainmatter' ), header(stringify($self)), ] + return [ + RawBlock( 'latex', '\\mainmatter' ), + header(stringify($self)), + ] if ( $self->name eq 'Header' and $self->level == 1 and stringify($self) =~ /^Scope/ ); return; @@ -39,7 +47,10 @@ sub mainmatter { sub backmatter { my $self = shift; - return [ RawBlock( 'latex', '\\backmatter' ), header('References'), ] + return [ + RawBlock( 'latex', '\\backmatter' ), + header('References'), + ] if ( $self->name eq 'Header' and $self->level == 1 and stringify($self) =~ /^Notes/ ); return; @@ -47,11 +58,6 @@ sub backmatter { sub toc { my $self = shift; - return RawBlock( 'latex', - '{\\hypersetup{linkcolor=black}\\setcounter{tocdepth}{3}\\clearpage\\tableofcontents}' - ) - if ( $self->name eq 'Header' and $self->level == 1 - and stringify($self) =~ /^Table/ ); return [] if ( $self->name eq 'Para' and stringify($self) =~ /__TOC__/ ); return; -- cgit v1.2.3