如何最好地管理多语言演示?

发布于 2024-08-26 00:56:24 字数 209 浏览 5 评论 0原文

我用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

墨落画卷 2024-09-02 00:56:24

我只见过一种解决方案(作为 babel 包的一部分)——将每个连续的文本单元包装在如下命令中:

\langswitcher{french text}{dutch text}

然后定义 \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:

\langswitcher{french text}{dutch text}

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.

酒儿 2024-09-02 00:56:24

我会做

\newcommand{\en}{#1}
\newcommand{\de}{}

And 在文本中使用:

\en{ my text in english }
\de{ german text }

And 之后我只需交换命令。
请注意,结果应该不同,只是因为文本应该占用更多或更少的空间。您可以使用 \phantom 命令进行一些作弊。
不过,该解决方案仅使用一个文件。

I'd do

\newcommand{\en}{#1}
\newcommand{\de}{}

And in the text use:

\en{ my text in english }
\de{ german text }

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.

初与友歌 2024-09-02 00:56:24

将每张幻灯片保存在自己的文件中...然后 \input{dutch-file} \input{french-file}

keep each slide in its own file... then \input{dutch-file} \input{french-file}

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文