如何让“po4a”接受 Beamer 文档?

如何让“po4a”接受 Beamer 文档?

我已经尝试过显而易见的方法,.po4a.conf如下文件:

[po4a_langs] it
[po4a_paths] l10n/$master/master.pot $lang:l10n/$master/$lang.po

[type: latex] slides.en.tex            it:slides.it.tex

但是当我运行时po4a .po4a.conf,我收到一条投诉,称“框架”是一个未知的环境:

slides.en.tex:80: (po4a::tex)
               unknown environment: 'frame'

简单的解决方法是将 LaTeX/Beamer 文档视为纯文本文件,但这意味着文档的每一行都会被推送到翻译文件中(以段落块的形式)。

答案1

这是我/usr/share/perl5/Locale/Po4a/LaTeX.pm为支持 Beamer(的一个子集)所进行的修改:

--- LaTeX.pm.bak    2013-08-21 22:54:06.000000000 +0200
+++ LaTeX.pm    2017-10-26 11:23:02.295980826 +0200
@@ -148,6 +148,7 @@
 register_generic_command("closing,{_}");
 register_generic_command("dashbox,{}");            # followed by a (w,h) argument
 register_generic_command("date,{_}");
+register_generic_command("institute,{_}");
 register_generic_command("*enlargethispage,{}");
 register_generic_command("ensuremath,{_}");
 register_generic_command("*fbox,{_}");
@@ -357,6 +358,7 @@
             eqnarray eqnarray* equation equation* flushleft flushright footnotesize itemize
             letter lrbox multline multline* proof quotation quote
             sloppypar tabbing theorem titlepage
+            frame
             trivlist verbatim verbatim* verse wrapfigure)) {
     register_generic_environment("$_,");
 }
@@ -396,6 +398,8 @@
   $env_separators{'flushright'} =
   $env_separators{'center'} =
   $env_separators{'author{#1}'} =
+  $env_separators{'institute{#1}'} =
+  $env_separators{'date{#1}'} =
   $env_separators{'title{#1}'} = "\\\\\\\\";

 # tabbing

相关内容