Re: [问题] (更新)scientific workplace 输出问题 beamer

楼主: tonygump (阿尼)   2017-04-17 20:39:25
sorry之前说的好像有错,这边整理一下我所看到的,希望能跟板上前辈讨论一下。
1. 关于你所说SW(与SWP这里统称SW)的图形预览,以及图形缩放很方便这点,我非常同意
阿。而且,由于我后来没有用这个功能,我都忘记这点了!SW的图片安插与处理算是他的
一个非常大的优点。它应该(?)是唯一一个软件可以让使用者直接拉图进去SW视窗里来插
入图形的。还不只如此,它也会自动判断图片大小并且依照目前图片与视窗的相对大小自
动调整输出的PDF图片大小!还不只如此,使用者还可以直接用拉图的方式将图片放大缩
小。而且他还可以预览!这些都是SW相当便利的地方,这比LYX或其他所见近乎所得的软
体还来的方便多了阿。由于你的当头棒喝,我之后也想再来改良我的方法,没错,还是会
希望能看到图,而且若能以拉图的方式放大缩小,就更好了!
2. 有一类型的环境是特别的,包括beamer使用的frame,常见的listing,还有minted,
等等。这些指令通常是这样\begin{frame}...\end{frame},或\begin{listing}...
\end{listing}此类型环境叫做脆弱环境(fragile environment),稍后会讨论。脆
弱环境的\begin{...}及\end{...}指令在档案中必须单独存在一行,前后不能有任何
文字,前面也不能缩排,但可以接%。请见连结
[http://www.tug.org/pipermail/pstricks/2010/008307.html],[(d)
https://books.google.com.tw/books?id=xgbapN_8aTwC&pg=PA226&lpg=PA226&dq=%5Cend%7Bframe%7D%25+on+its+own+line&source=bl&ots=PRVzCpsOrN&sig=9c0O2RoMiCRaQ1gNHF8iJ2cBrAQ&hl=zh-CN&sa=X&ved=0ahUKEwiU0urs_vbSAhXHEbwKHcNAD28Q6AEINDAD#v=onepage&q=%5Cend%7Bframe%7D%25%20on%20its%20own%20line&f=false||
连结二]。
Beamer must collect the contents of a frame before it will be typeset. And
the end of the contents is reached if the current line is \end{frame},
without additional characters before and after – Herbert Nov 11 '15 at 21:22
One warning: be very careful to put the end tag for the fragile environment
(listings, minted, etc) on its own line. In particular, the closing brace of
the macro being defined to hold the fragile content should come on a separate
line from the end of the environment. The terrifying things LaTeX does to
construct some of these pieces of fragile content seems to depend on the end
of the environment being on its own line. The error messages that it produces
when this is not the case are, as always in LaTeX, completely useless.
因此这里我之前所说的\end{...}后面不能接%是错误的。抱歉。是可以接%,但不能加其
他东西。而且蛮多人会加%,以避免后面接了双元空白而不知道(?),并且SW也会在这些环
境指令后自动加%。
但为何我们error会停在这行呢?这是下面要讨论的。
1. 在这类型脆弱环境中出错,若是fragile选项设false(这是默认值),则error会停在
\end{环境}那行。我们就是遇到这情况,停在\end{frame}那行。只有fragile=True,
error才会停在正确的行数。好像是因为,此类型环境,比如frame,会先把start以及end
中间的东西先全部读下来,读完后再来排,这与一般TeX模式边读边排是不一样的。因此
我以为错误停在\end{frame},但其实不是,若fragile设false,则看不出错在哪行,只
知道这个frame环境出错。请参考
[https://tex.stackexchange.com/questions/136240/drawbacks-of-using-fragile-frames-in-beamer||
连结]及
[http://tex.stackexchange.com/questions/116940/undefined-control-sequence-endframe||
连结二]。
2. 接着就来解释脆弱环境(fragile environment)可能会出错的状况。此类型环境中,若
用上一些指令是在不同页面间挪用变量,如\sectiontitle{这是第一节},则这一行的内
容会自动拿到目录页。在这类型挪用变量的指令里,若有其他运算,如\sectitle{这是第
\variable节},则有时候必须要加上\protect这指令。好像是因为脆弱环境中的变量挪用
以及运算在不同系统有不同的做法。这也正是脆弱环境称为脆弱的原因。请参考
[http://tex.stackexchange.com/questions/4736/what-is-the-difference-between-fragile-and-robust-commands||
连结]。如同回文者所说,同事的档案拿来自己的电脑就编译不了,然后才看到有行注解
说,若编译不了,这边要加\protect。所以有可能是你用了这类型指令,可能要加
\protect指令?当然只是猜测。

Links booklink

Contact Us: admin [ a t ] ucptt.com