--- /dev/null
+package SL::Template::Plugin::KiviLatex;
+
+use strict;
+use parent qw( Template::Plugin::Filter );
+
+my $cached_instance;
+
+sub new {
+ my $class = shift;
+
+ return $cached_instance ||= $class->SUPER::new(@_);
+}
+
+sub init {
+ my $self = shift;
+
+ $self->install_filter($self->{ _ARGS }->[0] || 'KiviLatex');
+
+ return $self;
+}
+
+sub filter {
+ my ($self, $text, $args) = @_;
+ return $::locale->quote_special_chars('Template/LaTeX', $text);
+}
+
+my %html_replace = (
+ '</p>' => "\n\n",
+ '<ul>' => "\\begin{itemize} ",
+ '</ul>' => "\\end{itemize} ",
+ '<ol>' => "\\begin{enumerate} ",
+ '</ol>' => "\\end{enumerate} ",
+ '<li>' => "\\item ",
+ '</li>' => " ",
+ '<b>' => "\\textbf{",
+ '</b>' => "}",
+ '<strong>' => "\\textbf{",
+ '</strong>' => "}",
+ '<i>' => "\\textit{",
+ '</i>' => "}",
+ '<em>' => "\\textit{",
+ '</em>' => "}",
+ '<u>' => "\\underline{",
+ '</u>' => "}",
+ '<s>' => "\\sout{",
+ '</s>' => "}",
+ '<sub>' => "\\textsubscript{",
+ '</sub>' => "}",
+ '<sup>' => "\\textsuperscript{",
+ '</sup>' => "}",
+ '<br/>' => "\\newline ",
+ '<br>' => "\\newline ",
+);
+
+sub filter_html {
+ my ($self, $text, $args) = @_;
+
+ $text =~ s{ \r+ }{}gx;
+ $text =~ s{ \n+ }{ }gx;
+ $text =~ s{ (?:\ |\s)+ }{ }gx;
+
+ my @parts = map {
+ if (substr($_, 0, 1) eq '<') {
+ s{ +}{}g;
+ $html_replace{$_} || '';
+
+ } else {
+ $::locale->quote_special_chars('Template/LaTeX', HTML::Entities::decode_entities($_));
+ }
+ } split(m{(<.*?>)}x, $text);
+
+ return join('', @parts);
+}
+
+return 'SL::Template::Plugin::KiviLatex';
+++ /dev/null
-package SL::Template::Plugin::LxLatex;
-
-use strict;
-use parent qw( Template::Plugin::Filter );
-
-my $cached_instance;
-
-sub new {
- my $class = shift;
-
- return $cached_instance ||= $class->SUPER::new(@_);
-}
-
-sub init {
- my $self = shift;
-
- $self->install_filter($self->{ _ARGS }->[0] || 'LxLatex');
-
- return $self;
-}
-
-sub filter {
- my ($self, $text, $args) = @_;
- return $::locale->quote_special_chars('Template/LaTeX', $text);
-}
-
-my %html_replace = (
- '</p>' => "\n\n",
- '<ul>' => "\\begin{itemize} ",
- '</ul>' => "\\end{itemize} ",
- '<ol>' => "\\begin{enumerate} ",
- '</ol>' => "\\end{enumerate} ",
- '<li>' => "\\item ",
- '</li>' => " ",
- '<b>' => "\\textbf{",
- '</b>' => "}",
- '<strong>' => "\\textbf{",
- '</strong>' => "}",
- '<i>' => "\\textit{",
- '</i>' => "}",
- '<em>' => "\\textit{",
- '</em>' => "}",
- '<u>' => "\\underline{",
- '</u>' => "}",
- '<s>' => "\\sout{",
- '</s>' => "}",
- '<sub>' => "\\textsubscript{",
- '</sub>' => "}",
- '<sup>' => "\\textsuperscript{",
- '</sup>' => "}",
- '<br/>' => "\\newline ",
- '<br>' => "\\newline ",
-);
-
-sub filter_html {
- my ($self, $text, $args) = @_;
-
- $text =~ s{ \r+ }{}gx;
- $text =~ s{ \n+ }{ }gx;
- $text =~ s{ (?:\ |\s)+ }{ }gx;
-
- my @parts = map {
- if (substr($_, 0, 1) eq '<') {
- s{ +}{}g;
- $html_replace{$_} || '';
-
- } else {
- $::locale->quote_special_chars('Template/LaTeX', HTML::Entities::decode_entities($_));
- }
- } split(m{(<.*?>)}x, $text);
-
- return join('', @parts);
-}
-
-return 'SL::Template::Plugin::LxLatex';
% config: use-template-toolkit=1
% config: tag-style=$( )$
-$( USE LxLatex )$
+$( USE KiviLatex )$
$( USE P )$
\documentclass{scrartcl}
\renewcommand{\kivitendosecondfoot}{%
\parbox{12cm}{%
\defaultfont\scriptsize%
- $( LxLatex.filter(rspec.displayable_name) )$\\
+ $( KiviLatex.filter(rspec.displayable_name) )$\\
$( !rspec.version ? "Arbeitskopie ohne Version" : "Version " _ rspec.version.version_number _ " vom " _ rspec.version.itime.to_kivitendo(precision='minute') )$
\vspace*{0.2cm}%
\put(3.5,-5){%
\begin{minipage}[t][6cm]{12cm}
\Large
- \textcolor{kivitendodarkred}{$( LxLatex.filter(rspec.type.description) )$}
+ \textcolor{kivitendodarkred}{$( KiviLatex.filter(rspec.type.description) )$}
\huge
- $( LxLatex.filter(rspec.customer.name) )$
+ $( KiviLatex.filter(rspec.customer.name) )$
\vspace*{0.5cm}
\Large
- $( LxLatex.filter(rspec.title) )$
+ $( KiviLatex.filter(rspec.title) )$
\normalsize
%$( IF rspec.version )$
- Version $( LxLatex.filter(rspec.version.version_number) )$
+ Version $( KiviLatex.filter(rspec.version.version_number) )$
%$( END )$
\end{minipage}%
}
\small Beschreibung\\
\hline
%$( FOREACH versioned_copy = versioned_copies )$
- \multicolumn{1}{|r}{\small $( LxLatex.filter(versioned_copy.version.version_number) )$} &
- \multicolumn{1}{|r|}{\small $( LxLatex.filter(versioned_copy.version.itime.to_kivitendo(precision='minute')) )$} &
- \small $( LxLatex.filter(versioned_copy.version.description) )$\\
+ \multicolumn{1}{|r}{\small $( KiviLatex.filter(versioned_copy.version.version_number) )$} &
+ \multicolumn{1}{|r|}{\small $( KiviLatex.filter(versioned_copy.version.itime.to_kivitendo(precision='minute')) )$} &
+ \small $( KiviLatex.filter(versioned_copy.version.description) )$\\
%$( END )$
\hline
\end{longtable}
\centering
\includegraphics[width=$( width_cm )$cm,keepaspectratio]{$( picture.print_file_name )$}
-\mbox{Abbildung $( picture.number )$: $( LxLatex.filter(picture.description ? picture.description : picture.picture_file_name) )$}
+\mbox{Abbildung $( picture.number )$: $( KiviLatex.filter(picture.description ? picture.description : picture.picture_file_name) )$}
\end{figure}
%$( END )$
% $( FOREACH text_block = text_blocks )$
- \subsection{$( LxLatex.filter(text_block.title) )$}
+ \subsection{$( KiviLatex.filter(text_block.title) )$}
-$( LxLatex.filter_html(text_block.text_as_restricted_html) )$
+$( KiviLatex.filter_html(text_block.text_as_restricted_html) )$
% $( FOREACH picture = text_block.pictures_sorted.as_list )$
$( PROCESS picture_outputter picture=picture )$
%$( FOREACH top_item = rspec.sections_sorted )$
- \subsection{Abschnitt $( LxLatex.filter(top_item.fb_number) )$: $( LxLatex.filter(top_item.title) )$}
+ \subsection{Abschnitt $( KiviLatex.filter(top_item.fb_number) )$: $( KiviLatex.filter(top_item.title) )$}
% $( IF top_item.description )$
- $( LxLatex.filter_html(top_item.description_as_restricted_html.replace('\r', '').replace('\n+\Z', '')) )$
+ $( KiviLatex.filter_html(top_item.description_as_restricted_html.replace('\r', '').replace('\n+\Z', '')) )$
\vspace{0.5cm}
% $( END )$
\parbox[t]{1.0cm}{\textcolor{kivitendodarkred}{$>>>$}}%
\parbox[t]{15.0cm}{%
\begin{longtable}{p{2.8cm}p{11.7cm}}
- Funktionsblock & $( LxLatex.filter(item.fb_number) )$\\
- Beschreibung & $( LxLatex.filter_html(item.description_as_restricted_html) )$\\
- Abhängigkeiten & $( LxLatex.filter(P.requirement_spec_item_dependency_list(item)) )$
+ Funktionsblock & $( KiviLatex.filter(item.fb_number) )$\\
+ Beschreibung & $( KiviLatex.filter_html(item.description_as_restricted_html) )$\\
+ Abhängigkeiten & $( KiviLatex.filter(P.requirement_spec_item_dependency_list(item)) )$
\end{longtable}}
% $( FOREACH sub_item = item.children_sorted )$
\hspace*{1.0cm}%
\parbox[t]{15.0cm}{%
\begin{longtable}{p{2.8cm}p{11.7cm}}
- Unterfunktionsblock & $( LxLatex.filter(sub_item.fb_number) )$\\
- Beschreibung & $( LxLatex.filter_html(sub_item.description_as_restricted_html) )$\\
- Abhängigkeiten & $( LxLatex.filter(P.requirement_spec_item_dependency_list(sub_item)) )$
+ Unterfunktionsblock & $( KiviLatex.filter(sub_item.fb_number) )$\\
+ Beschreibung & $( KiviLatex.filter_html(sub_item.description_as_restricted_html) )$\\
+ Abhängigkeiten & $( KiviLatex.filter(P.requirement_spec_item_dependency_list(sub_item)) )$
\end{longtable}}
% $( END )$