3

これはばかげているか明白かもしれませんが、私は sty ファイルを作成することを学んでおり、beamerposter プロジェクトからいくつかのコードを変更しています。とにかく、私はこれを持っています:

\def\postercolumn#1
{\begin{column}{#1\textwidth}
      \begin{beamercolorbox}[center,wd=\textwidth]{postercolumn}
        \begin{minipage}[T]{.95\textwidth}
            %\parbox[t][\columnheight]{\textwidth}
}

\def\endpostercolumn
{
        \end{minipage}
      \end{beamercolorbox}
    \end{column}
}

明らかに \parbox コマンドはコメント アウトされていますが、そこから開始し、終了ブロックで終了するようにしたいと考えています。実際には、私はこれが欲しい:

\def\postercolumn#1
{\begin{column}{#1\textwidth}
      \begin{beamercolorbox}[center,wd=\textwidth]{postercolumn}
        \begin{minipage}[T]{.95\textwidth}
            \parbox[t][\columnheight]{\textwidth}{
}

\def\endpostercolumn
{
        }
        \end{minipage}
      \end{beamercolorbox}
    \end{column}
}

しかし当然のことながら、コンパイラが混乱して \endpostercolumn セクションが閉じていると判断するため、これは機能しません。それを回避する明白な方法はありますか?

ありがとうございました。

4

2 に答える 2

2

\bgroupand\egroupの代わりに{andを試すことができます}。しかし、確かではありません。

\bgroup\lettoである{ため、暗黙的 {です。したがって、TeX の「胃」に到達するまでは、追加のグループ化コマンドと見なすべきではありません。についても同様\egroup


編集: で試してみましたが\parbox、正しく動作していないようです (\parboxトークンの展開が早すぎるため)。\vtopそれが動作します:

\documentclass{minimal}

\newlength\columnheight \columnheight=5cm % needed to define \columnheight,
                                          % don't have it here

\def\postercolumn{
    \leavevmode
    \vtop to \columnheight\bgroup
    \hsize.5\textwidth
    \noindent
    \ignorespaces
}

\def\endpostercolumn{
    \egroup
}


\begin{document}

\begin{postercolumn}
   hello world hello world hello world hello world
   hello world hello world hello world hello world
\end{postercolumn}

\end{document}

これが必要なようです。


\hsize\textwidth編集:もちろん、代わりに必要になります\hsize.5\textwidth

于 2010-02-28T01:09:04.760 に答える
0

を使用する代わりに、次の環境\parboxを使用できます。minipage

\begin{minipage}[t]{\textwidth}
  % ...
\end{minipage}

% If you want to explicitly define the height:
\begin{minipage}[t][\columnheight]{\textwidth}
  % ...
\end{minipage}

環境には、コマンドminipageと同じオプションがあります。\parbox

\begin{minipage}[pos][height][inner-pos]{width}
  % ... text ...
\end{minipage}

ここで、はpos、、、または(それぞれ中央、上、下)のいずれかです。ボックスの希​​望の高さであり、、、、、または(それぞれ中央、上、下、およびストレッチの場合)のいずれかです。ボックスの希​​望の幅です。ctbheightinner-posctbswidth

値を選択sしたinner-pos場合、テキストはボックス内の垂直方向のスペースを埋めるように引き伸ばされます(段落の間に余分なスペースが追加されます)。を指定しない場合はinner-pos、と同じに設定されposます。

私はあなたのコードでこれをテストしていませんが、動作するはずです。(以前、新しい環境を定義するときに使用しました。)

于 2010-03-01T13:59:20.513 に答える