如何最好地管理多语言演示?
我用 Latex+Beamer 完成了一个演示,目前是法语。我还需要用荷兰语进行相同的演示,具有相同的结构。我想将演示文稿保留在一个文件中,这样如果我想更改它的结构,我只需在一处进行即可。将翻译放在演示文稿文件之外的最佳方法是什么?
我考虑为幻灯片中出现的每个文本元素定义一个命令,并为每种语言定义不同的命令。但它看起来很重......
提前感谢
RAph
I have a presentation done in Latex+Beamer, currently in french. I also need to make the same presentation, with the same structure, in dutch. I'd like to maintain the presentation in one file, so that if I want to change the structure of it, I only have to do it in one place. What's the best way to put the translations outside of the presentation file?
I thought of defining a command for each text element to be present in the slides, and having a different command definition for each language. But it seems quite heavy....
Thanks in advance
RAph
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我只见过一种解决方案(作为 babel 包的一部分)——将每个连续的文本单元包装在如下命令中:
然后定义
\langswitcher 在序言中输出第一个或第二个参数。
我知道这不会将翻译放入单独的文件中,但这很简单,快速,肯定有效,并且可能解决您的问题。
要将翻译放入单独的文件中,至少您必须识别每段文本。
I've seen only one solution to this (as part of the
babel
package) — you wrap each contiguous unit of text in a command that looks like this:and then define
\langswitcher
in the preamble to output either the first or the second argument.I know this does not put the translation into a separate file, but this is simple, fast, works for sure, and probably solves your problem.
To put a translation in a separate file, at the very least you'll have to identify each piece of text anyway.
我会做
And 在文本中使用:
And 之后我只需交换命令。
请注意,结果应该不同,只是因为文本应该占用更多或更少的空间。您可以使用 \phantom 命令进行一些作弊。
不过,该解决方案仅使用一个文件。
I'd do
And in the text use:
And after I'd simply swap the commands.
Be aware that result should be different only because the text should take more or less space. You can cheat a bit using \phantom command.
This solution use only one file though.
将每张幻灯片保存在自己的文件中...然后 \input{dutch-file} \input{french-file}
keep each slide in its own file... then \input{dutch-file} \input{french-file}