2009-02-07 4 views
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} 

답변

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} 
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}을 사용하십시오.

그래도 문제가 해결되지 않는 경우 문제를 컴파일하고 보여주는 예제를 제공하십시오.

관련 문제