From e40b72029aba6fccad525c69e8af00c057fa5b1b Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 23 Jan 2014 09:33:24 +0100 Subject: [PATCH] =?utf8?q?KiviLatex-Plugin:=20Dokumentation=20erg=C3=A4nzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Template/Plugin/KiviLatex.pm | 95 +++++++++++++++++++++++++++++++++ 1 file changed, 95 insertions(+) diff --git a/SL/Template/Plugin/KiviLatex.pm b/SL/Template/Plugin/KiviLatex.pm index 21725cba0..6683574fe 100644 --- a/SL/Template/Plugin/KiviLatex.pm +++ b/SL/Template/Plugin/KiviLatex.pm @@ -81,3 +81,98 @@ EOLATEX } return 'SL::Template::Plugin::KiviLatex'; +__END__ + +=pod + +=encoding utf8 + +=head1 NAME + +SL::Template::Plugin::KiviLatex - Template::Toolkit plugin for +escaping text for use in LaTeX templates + +=head1 SYNOPSIS + +From within a LaTeX template. Activate both Template::Toolkit in +general and this plugin in particular; must be located before +C<\begin{document}>: + + % config: use-template-toolkit=1 + % config: tag-style=$( )$ + $( USE KiviLatex )$ + +Later escape some text: + + $( KiviLatex.format(longdescription) )$ + +=head1 FUNCTIONS + +=over 4 + +=item C + +Escapes characters in C<$text> with the appropriate LaTeX +constructs. Expects normal text without any markup (no HTML, no XML +etc). Returns the whole escaped text. + +=item C + +Converts HTML markup in C<$html> to the appropriate LaTeX +constructs. Only the following HTML elements are supported: + +=over 2 + +=item * C, C – bold text + +=item * C, C – italic text + +=item * C
    – underlined text + +=item * C – striked out text + +=item * C, C – subscripted and superscripted text + +=item * C
      , C
        , C
      1. – unordered lists (converted to an itemized +list), ordered lists (converted to enumerated lists) and their list +items + +=item * C

        , C
        – Paragraph markers and line breaks + +=back + +This function is tailored for working on the input of CKEditor, not on +arbitrary HTML content. It works nicely in tandem with the +Rose::DB::Object helper functions C<…_as_restricted_html> (see +L). + +Attributes are silently removed and ignored. All other markup and the +normal text are escaped the same as in L. + +=item C + +=item C + +Initializes the plugin. Automatically called by Template::Toolkit when +the plugin is loaded. + +=item C + +Returns LaTeX code loading packages that are required for the +formatting done with L. This function must be called and +its output inserted before the C<\begin{document}> line if that +function is used within the document. + +It is not required for normal text escaping with L. + +=back + +=head1 BUGS + +Nothing here yet. + +=head1 AUTHOR + +Moritz Bunkus Em.bunkus@linet-services.deE + +=cut -- 2.20.1