1

物事を適切に中心に置くための最良の方法は何ですか? テーブルをいじり始めると、物事が左右にずれ始め、バランスが崩れます。すべてが常に中心になるようにするにはどうすればよいでしょうか?

現在、これによりテーブルが台無しになり、右端が画面からはみ出します。私に何ができる?

これがほとんどのコードです。ほとんど同じなので、役に立たない関数の多くを切り取っています。1 つのプロジェクトで約 40 のユースケースを作成する必要があるため、学校向けのユースケースを作成するためのものです。

\documentclass[10pt, a4paper]{article}
\usepackage{booktabs}
\begin{document}
\newcommand{\UCStart}[2]{
    \newpage
    \subsection[UC.#1]{UC.#1}
    \begin{tabular}{|l|m{4in}|c|}
        \hline
        \textbf{UC.#1}
        & \textbf{#2} 
        & \textbf{Traceability} \\ \hline
}

\newcommand{\UCDesc}[2]{
    \textbf{Description} 
    & #1
    & #2 \\ \hline
}

\newcommand{\UCActors}[2]{
    \textbf{External Actors}
    & #1
    & #2 \\ \hline
}

% Snip... 40 odd more functions %

\newcommand{\UCEnd}{
    \end{tabular}
}

\begin{table}[!ht]
    \setlength{\extrarowheight}{2pt}
    % UC 1
    \UCStart{01}{Administrator Starts Server}
    \UCDesc{This describes the process of the administrator starting the server}{\space}
    \UCActors{Administrator}{\space}
    \UCRelated{UC.02}{\space}
    \UCPre{Server is not running}{\space}
    \UCTrigger{Administrator wants to start the server}{\space}
    \UCSeq{
        \begin{enumerate}
            \item Administrator boots up hardware
            \item Administrator starts Administrator console
            \item Administrator logins into Administrator account with the corresponding password
            \item Administrator clicks start
        \end{enumerate}
    }{\space}
    \UCPost{Conditions that must be true, in order for the use case to finish}{\space}
    \UCAltSeq{
        \textbf{Alternative Use Case 01} \newline
        \begin{itemize}
            \item UC.01.ALT.01
            \item If administrator fails authentication in step 3
            \begin{enumerate}
                \item Notify administrator of failed authentication
            \end{enumerate}
        \end{itemize}
    }{\space}
    \UCNonFunc{ ??? }{\space}
    \UCComments{ Comments Go Here }{\space}
    \UCEnd

        \end{table}
    \end{document}
4

2 に答える 2

1

いくつかのエラーのためにあなたの例をコンパイルできません.「物事を適切に中央に配置するための最良の方法」とはどういう意味ですか. 一種の水晶玉型の答えとして、これはあなたが探しているものですか?

 \documentclass[10pt,a4paper]{article}
 \usepackage{array}
 \begin{document}
 \begin{table}
 \centering
 \begin{tabular}{
     | >{\centering\arraybackslash }p{4cm} |
       >{\centering\arraybackslash }p{6cm} |
   }
   \hline
   some centred text in cells & some more centred text in cells \\
   \hline
   centred text in cells & more centred text in cells \\
   \hline
 \end{tabular}
 \end{table}
 \end{document}
于 2009-02-07T07:57:13.233 に答える
1

あなたの例をコンパイルできない場合、何が問題なのかを理解するのは困難です。

あなたが提供したコードを見ると、この状況では表は実際には適切ではないかもしれません。代わりに、次のようなことを試してください。

\documentclass[10pt,a4paper]{article}
\begin{document}

\subsection{Administrator Starts Server}
\paragraph{Description:} This describes the process of the adminsitrator starting the server.

\paragraph{Actors:} Administrator

\paragraph{Preconditions:} Server is not running.

\paragraph{Sequence:}
\begin{enumerate}
  \item Administrator boots up hardware
  \item Administrator starts Administrator console
  \item Administrator logins into Administrator account with the corresponding password
  \item Administrator clicks start
\end{enumerate}

\end{document}

あなたが提供した例では、「トレーサビリティ」列にテキストを入れたことはありません。この列を模倣するには、 を使用\marginpar{my text}して余白にテキストを配置するか、 を使用blahblah\hfill{}my textして「blahblah」と同じ行にテキストを右揃えにすることができます。トレーサビリティ テキストを右揃えで独自の行に配置する場合は、 を使用します\begin{flushright} my text \end{flushright}

これで問題が解決しない場合は、問題をコンパイルして実証する最小限の例を提供してください。

于 2009-02-10T01:21:46.267 に答える