如何减少表(CO映射表)与/fbox环境之间的差距(请给出说明)?

如何减少表(CO映射表)与/fbox环境之间的差距(请给出说明)?

表格和说明之间的差距太大。我想大大减少它。请帮忙。

\documentclass[12pt,a4paper,addpoints,answers]{exam}

% import  packages
\usepackage[utf8]{inputenc} % special characters
\usepackage{geometry} % paper size
\usepackage{graphicx} % insert figures
\usepackage{lipsum,tikz} % insert style
\usepackage{helvet} % load helvetica font
\usepackage{amssymb,amsmath} % mathematical symbols
\usepackage{diagbox} % diagonal line in a table cell

% typesetting the paper size
\geometry{paperheight=29.7cm,paperwidth=21cm,textheight=25cm,textwidth=19cm,top=2cm,footskip=1cm} % headheight 10pt

% header and footer
\pagestyle{headandfoot} % declare the pagestyle with header and footer
\firstpageheader{\sffamily \footnotesize LNMIIT/B. Tech./CSE/Core/2019-20/ODD/CSE0326/ET}                            % left  header
{}                                                               % middle header
{\includegraphics[width=1.2in]{logo.eps}}                        % right header
\runningheader{\sffamily \footnotesize LNMIIT/B. Tech./CSE/Core/2019-20/ODD/CSE0326/ET}{}{\includegraphics[width=1.2in]{logo.eps}}
\headrule
\firstpagefooter{\sffamily SWE}{\sffamily Page~\thepage\ of~\numpages\ }{\iflastpage{\sffamily End of Exam}{\sffamily Next page, Please\ldots}}
\runningfooter{\sffamily SWE}{\sffamily Page \thepage\ of \numpages}{\iflastpage{\sffamily End of Exam}{Next page, Please\ldots}} % left, middle and right footer

% Placement of marks 
\bracketedpoints 
\pointsinrightmargin
\setlength{\rightpointsmargin}{20.0mm}
\extrawidth{-15.0mm}

% main document content
\begin{document}
    % Institute and Exam Details
    \begin{center}
        \Large \textbf{The LNM Institute of Information Technology}\\
        \large \textbf{Department: XXX}\\
        \textbf{Course Name (Course Code)}\\
        \textbf{Mid/End Term Examination}
    \end{center}
\textbf{Time: XXX Hours} \hfill \textbf{Date: XXX} \hfill \textbf{Max. Marks: XXX}\\

% table template for time, date and maximum marks for the examination
%   \begin{center} 
%       \begin{tabular}{ c c c }
%           \textbf{Time: 3 Hours} & \textbf{Date: 07.12.2019} & \textbf{Max. Marks: 100}
%       \end{tabular}
%   \end{center}

%Table of CO-Question mapping
\begin{table}[h]
    \begin{center}
        \begin{tabular}{|c|c|c|c|c|c|c|}
            \hline
            \multicolumn{1}{|l|}{\diagbox[width=12.5em]{\textbf{Component}}{\textbf{Course Outcome}}}        & \textbf{CO1} & \textbf{CO2} & \textbf{CO3} & \textbf{CO4} & \textbf{CO5} & \textbf{CO6} \\ \hline
            \textbf{Questions}            & 1            & 2            & 3            & 4            & 5            & 6            \\ \hline
            \textbf{Marks}                & 7            & 8            & 8            & 7            & 15           & 25           \\ \hline
            \textbf{Marks/Max Marks (\%)} & 10           & 11.4         & 11.4         & 10           & 21.4         & 35.8         \\ \hline
        \end{tabular}
    \end{center}
\end{table}

    %Exam Instruction
    \begin{center}
        \fbox{\fbox{\parbox{6.0in}{
                    \begin{flushleft}
                        \textbf{Instructions:}\\
                        1. XXX\\
                        2. XXX\\
                    \end{flushleft}
        }}}
    \end{center}
%\begin{flushleft}
%   \textbf{Instructions:}\\
%   1. 
%\end{flushleft}
    \hrulefill\\
    % start of the questions
    \begin{questions}
        \question % question number
        \begin{parts} % question parts
            \part XXX?
            \begin{subparts}% question subparts
                \subpart XXX?
                \subpart XXX?
            \end{subparts}
            \part XXX?
            \part XXX?
        \end{parts}
    \end{questions}
    
\end{document}

答案1

像这样吗?

在此处输入图片描述

  • 浮点数table被移除。
  • 表格和说明合并在一个center环境中。
  • 它们之间插入了\medskip指令。
  • 我擅自重新设计了您的桌子。在此我使用tabularray包。但是,您可以保留原始的桌子设计,它不会改变桌子和说明之间的垂直距离。
  • 我不会干涉你的页面布局设置,只用 LaTeX 提供的示例图像替换图像
\documentclass[12pt,a4paper,addpoints,answers]{exam}

% import  packages
%\usepackage[utf8]{inputenc} % special characters
\usepackage[a4paper,
            textheight=25cm,textwidth=19cm,
            top=2cm,footskip=1cm]{geometry} % page layout
\usepackage{graphicx} % insert figures
\usepackage{helvet} % load helvetica font
\usepackage{amssymb,amsmath} % mathematical symbols
\usepackage{tabularray}
\usepackage{diagbox} % diagonal line in a table cell
\usepackage{lipsum,tikz} % insert style

% typesetting the paper size
\geometry{} % headheight 10pt

% header and footer
\pagestyle{headandfoot} % declare the pagestyle with header and footer
\firstpageheader{\sffamily \footnotesize LNMIIT/B. Tech./CSE/Core/2019-20/ODD/CSE0326/ET}                            % left  header
{}                                                      % middle header
{\includegraphics[width=1.2in]{example-image-duck}}     % logo.eps, right header
\runningheader{\sffamily \footnotesize LNMIIT/B. Tech./CSE/Core/2019-20/ODD/CSE0326/ET}{}{\includegraphics[width=1.2in]{example-image}}
\headrule
\firstpagefooter{\sffamily SWE}{\sffamily Page~\thepage\ of~\numpages\ }{\iflastpage{\sffamily End of Exam}{\sffamily Next page, Please\ldots}}
\runningfooter{\sffamily SWE}{\sffamily Page \thepage\ of \numpages}{\iflastpage{\sffamily End of Exam}{Next page, Please\ldots}} % left, middle and right footer

% Placement of marks
\bracketedpoints
\pointsinrightmargin
\setlength{\rightpointsmargin}{20.0mm}
\extrawidth{-15.0mm}

% main document content
\begin{document}
    % Institute and Exam Details
    \begin{center}
        \Large \textbf{The LNM Institute of Information Technology}\\
        \large \textbf{Department: XXX}\\
        \textbf{Course Name (Course Code)}\\
        \textbf{Mid/End Term Examination}
    \end{center}
\textbf{Time: XXX Hours} \hfill \textbf{Date: XXX} \hfill \textbf{Max. Marks: XXX}\\

% table template for time, date and maximum marks for the examination
%   \begin{center}
%       \begin{tabular}{ c c c }
%           \textbf{Time: 3 Hours} & \textbf{Date: 07.12.2019} & \textbf{Max. Marks: 100}
%       \end{tabular}
%   \end{center}

%Table of CO-Question mapping
    \begin{center}  % <---
        \begin{tblr}{hline{1}={2-7}{solid}, hline{2-Z} ={solid},
                     vline{1}={2-Z}{solid}, vline{2-Z}={solid}, 
                     colspec={Q[c, font=\bfseries] *{6}{c}},
                     row{1,2} ={font=\bfseries}
                     }
            &   \SetCell[c=6]{c}    Course Outcome          
                    &       &       &       &       &       \\ 
        Component     
            & CO1   & CO2   & CO3   & CO4   & CO5   & CO6   \\
        Questions 
            & 1     & 2     & 3     & 4     & 5     & 6     \\ 
        Marks 
            & 7     & 8     & 8     & 7     & 15    & 25    \\
        Marks/Max Marks (\%)  
            & 10    & 11.4  & 11.4  & 10    & 21.4  & 35.8  \\
        \end{tblr}

    \medskip    % <---
    %Exam Instruction
        \fbox{\fbox{\parbox{6.0in}{
                    \begin{flushleft}
                        \textbf{Instructions:}\\
                        1. XXX\\
                        2. XXX\\
                    \end{flushleft}
        }}}
    \end{center}

    \hrulefill\\
    % start of the questions
    \begin{questions}
        \question % question number
        \begin{parts} % question parts
            \part XXX?
            \begin{subparts}% question subparts
                \subpart XXX?
                \subpart XXX?
            \end{subparts}
            \part XXX?
            \part XXX?
        \end{parts}
    \end{questions}

\end{document}

相关内容