如何将“脆弱”文件的内容顶部对齐? LaTeX Beamer 演示文稿中的框架?
所以我对 LaTeX 完全是新手。我正在为介绍性编程讲座制作投影仪演示文稿,因此我经常在幻灯片中使用 examplebox
对象。有人告诉我,每当我有一个包含示例框的框架时,我需要使用关键字“fragile”来声明它,如下所示:
\begin{frame}[fragile]
我不太清楚这是做什么的,但我知道只有使用它我的代码才会编译。我还从互联网上了解到,如果我想在框架上顶部对齐内容,我会添加“t”关键字,如下所示:
\begin{frame}[t]
将以下两者结合起来我对 LaTeX 知之甚少,认为这些是直观的方式,但行不通。
\begin{frame}[t][fragile]
也不行
\begin{frame}[fragile][t]
,我猜有一个简单的解决方案可以使用两者同时,但我很难在网上找到直接的答案。任何人都可以透露一些信息吗?
谢谢!
So I am a total novice with LaTeX. I'm working on beamer presentations for introductory programming lectures, so I frequently use the examplebox
object in my slides. I was told that whenever I have a frame that contains an examplebox, I need to declare it with the keyword 'fragile,' as in:
\begin{frame}[fragile]
I don't know precisely what this does, but I know my code will only compile if I use it. I have also gathered from the internet that if I want to top-align content on a frame, I add the 't' keyword, as in:
\begin{frame}[t]
Combining the two of these in what I, knowing very little about LaTeX, would consider to be the intuitive way, does not work.
\begin{frame}[t][fragile]
Nor does
\begin{frame}[fragile][t]
I'm guessing there is an easy solution to using both of these at the same time, but I'm having trouble finding a straight answer on the web. Can anyone shed some light?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
即使为时已晚,无法与原始询问者相关:
可选参数通常使用逗号作为分隔符进行堆叠,即正确的形式应该是
Even if its too late to be of relevance to the original asker:
Optional arguments are usually stacked up using a comma as delimiter, i.e. the correct form should be
你试过用分号吗?
这工作正常:
\begin{frame}[脆弱,t]
did you try it with a semicolon?
this works fine:
\begin{frame}[fragile,t]
对于任何碰巧遇到同样问题的人...我没有找到如何将 [t] 和 [fragile] 标签放在框架上的直接答案。不过,我确实找到了一种将 [t] 标签应用于整个文档的方法,这实际上是解决我的问题的更好方法。
为此,请替换文档的第一行:
这样:
如果有人确实知道如何像我一样在框架上使用两个标签,我仍然会很高兴得到答案。
For anyone who happens to come across this same problem... I didn't find a direct answer to how to put both the [t] and [fragile] tags on a frame. However, I did find a way to apply the [t] tag to the entire document, which is actually a better solution to the problem in my case.
To do this, replace the first line of the document:
With this:
If anyone does know how to use two tags on a frame like I was asking though, I would still appreciate an answer.