段区切り線の高さを減らす

段区切り線の高さを減らす

私は、動的なサイズのセルを作成し、手動ではなくマクロを使用してデータを入力できるようにmulticol、 とを使用してテーブルを作成しています。rule

ほぼ正常に動作しますが、列間の線の高さを低くしたいと思います。私がこれをどのように構築しているかの例と、ドキュメント全体の結果がどのようになるかを示した画像をご覧ください。

\documentclass{article}
\usepackage[a5paper,margin=15mm, top=0.8cm, bottom=0.7cm, left=1cm, right=1cm,headsep=2pt]{geometry}
\usepackage{multicol}

\newcounter{qnumber}
\setcounter{qnumber}{0}
\newcommand{\question}[1]{%
\rule{\columnwidth}{0.01pt} \newline
\stepcounter{qnumber}
  Q\theqnumber. \textsf{#1}

  \vspace{4.5mm}
}

\begin{document}
\pagestyle{intervention}
\thispagestyle{intervention}

\setlength{\columnseprule}{0.1pt}
\section*{Week 1}
\begin{multicols}{2}

\question{Calculate the following:
    \begin{enumerate}[(a)] 
        \item $10 \times 0.5$
        \item $10 \times 0.25$
    \end{enumerate}  
}

\end{multicols}
\end{document}

次のような出力が生成されます。

ここに画像の説明を入力してください

この高さを低くするにはどうすればいいでしょうか?

答え1

ここに を使用した解決策がありますtikz

\mypagerule私は、ページの上端と下端からの距離 (cm 単位) をそれぞれ表す 2 つの引数を持つマクロを作成しました。

ページごとに設定する必要がありますが、投稿された画像から判断すると、ページは 1 つだけだと思います。

これがコードです (コンパイルできるように一部を変更しました)。

\documentclass{article}
\usepackage[a5paper,top=0.8cm, bottom=0.7cm, left=1cm, right=1cm,headsep=2pt]{geometry}
\usepackage{multicol}
\usepackage{enumitem}
\setenumerate{label={(\alph*)},leftmargin=*}

\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand{\mypagerule}[2]{%
    \begin{tikzpicture}[overlay,remember picture]
        \draw($(current page.north)-(0,#1)$)--($(current page.south)+(0,#2)$);% --
    \end{tikzpicture}
}   

\newcounter{qnumber}
\setcounter{qnumber}{0}
\newcommand{\question}[1]{%
    \noindent
    \rule{\columnwidth}{0.01pt} \newline
    \stepcounter{qnumber}
    Q\theqnumber.~\textsf{#1}
    \vspace{4.5mm}
}

\begin{document}
    \section*{Week 1}
    \begin{multicols}{2}
        \question{Calculate the following:
            \begin{enumerate}
                \item $10 \times 0.5$
                \item $10 \times 0.25$
            \end{enumerate} 
        }
        \question{Calculate the following percentage:
            \begin{enumerate}
                \item $10$\% of $500$
                \item $5$\% of $500$
            \end{enumerate} 
        }
        \question{Round the following numerbers (I don't know the rest of the question):
            \begin{enumerate}
                \item $10.456789789$
                \item $51.5454844$
            \end{enumerate} 
        }
        \question{The following question is about Standard Form:
            \begin{enumerate}
                \item Express $3600$ in standard form
                \item Write $2.1 \times {10}^{3}$ as a normal number
            \end{enumerate} 
        }
        \question{Mr Wilson and Mr Bedford have a peanlty shoot-out. The probability of Mr Wilson scoring is 0.4:
            \begin{enumerate}
                \item What is the probability he misses?
            \end{enumerate} 
        }
        \question{Ten students take ten penalties each. The number that each of them scores is below:
            \begin{enumerate}
                \item $1$
                \item $2$
                \item $3$
                \item $4$
                \item $5$
                \item $6$
                \item $7$
                \item $8$
                \item $9$
                \item $10$
            \end{enumerate} 
        }
    \mypagerule{2}{6}
    \end{multicols} 
\end{document}

出力は次のとおりです (実際の線の太さは正しいです。画像では太く見えますが、実際はそうではありません)。

ここに画像の説明を入力してください

答え2

これは洗練されていない解決策ですが、より良い解決策を待っています。\rule各セルを定義する s を単に上げるだけです。コメント アウトされた部分は、より良い解決策への潜在的な手がかりですが、私にはうまくいきません。

\documentclass{article}
\usepackage[a5paper]{geometry}
\usepackage{multicol}
\usepackage{graphicx}

\begin{document}

\setlength{\columnseprule}{0.1pt}

%\def\columnseprulecolor{%
%\rotatebox{90}{\makebox[0.4\textheight][c]{\rule{0.4\textheight}{0.1pt}}}
%    }%

\section*{Section Title}

\begin{multicols}{2}

\noindent\raisebox{2.25ex}{\rule{\columnwidth}{0.01pt}}
Here is some content, in its own cell defined by the column separator rule and the rules above and below it.\vspace{5ex}
\raisebox{2.25ex}{\rule{\columnwidth}{0.01pt}}
Here is some content, in its own cell defined by the column separator rule and the rules above and below it.\vspace{5ex}
\raisebox{2.25ex}{\rule{\columnwidth}{0.01pt}}
Here is some content, in its own cell defined by the column separator rule and the rules above and below it.\vspace{5ex}
\raisebox{2.25ex}{\rule{\columnwidth}{0.01pt}}
Here is some content, in its own cell defined by the column separator rule and the rules above and below it.\vspace{5ex}
\raisebox{2.25ex}{\rule{\columnwidth}{0.01pt}}
Here is some content, in its own cell defined by the column separator rule and the rules above and below it.\vspace{5ex}
\raisebox{2.25ex}{\rule{\columnwidth}{0.01pt}}
Here is some content, in its own cell defined by the column separator rule and the rules above and below it.\vspace{5ex}

\end{multicols}
\end{document}

関連情報