垂直列的长度和页码的位置

垂直列的长度和页码的位置

原来的:

在此处输入图片描述

我想添加红色部分:

在此处输入图片描述

\documentclass[a4paper]{article}
\usepackage[margin=1.5cm]{geometry}
\usepackage{multicol}
\usepackage{lastpage}
\usepackage{pgfplots,relsize}
\usepackage{ragged2e}
\usepgfplotslibrary{fillbetween}
\usepackage{fancyhdr}
\usetikzlibrary{calc}
\pagestyle{fancy} 
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[C]{\thepage/\pageref{LastPage}}
\newcounter{numex}
\def\thrulefill{\leavevmode\leaders\hrule height 0.5ex depth \dimexpr2pt-0.7ex\hfill\kern0pt}

\setlength{\columnseprule}{1.7pt}
\setlength{\columnsep}{1.2cm}

\newcommand\Startex{%
    \stepcounter{numex}
    \begin{center}
    \textsc{\bfseries Example~\thenumex)}~{\thrulefill}
    \end{center}}
    
\newcommand\around{%
\begin{tikzpicture}[overlay, remember picture,line width=1.2pt]
        \draw ($(current page.north west)+(1cm,-4cm)$) rectangle ($(current page.north east)+(-1cm,-2cm)$);
        \draw ($(current page.north)+(-4cm,-2cm)$) -- ++(0,1cm) -- ($(current page.north)+(4cm,-1cm)$) -- ++(0,-1cm) -- cycle;
    \end{tikzpicture}\vspace{2.5cm}
}

\begin{document}
\around
\begin{multicols*}{2}
\Startex
\begin{justify}
$x+y=y+x$
\end{justify}
\end{multicols*}
\end{document}

答案1

下面使用以下方法将每页的矿石圆中的所有线条和框设置为\fboxes 或tabularsFGeso-pic

在此处输入图片描述

\documentclass{article}

\usepackage[margin=1in]{geometry}
\usepackage{multicol}
\usepackage{lastpage,eso-pic,array}

\AddToShipoutPictureFG{%
  \AtTextLowerLeft{%
    % Insert footer
    \raisebox{-\baselineskip}{%
      \setlength{\arrayrulewidth}{1.7pt}%
      \begin{tabular}[t]{@{} c @{}}
        \hline
        \makebox[\textwidth]{\thepage/\pageref{LastPage}} \\
        \hline
      \end{tabular}%
    }% \raisebox
  }% \AtTextLowerLeft
  \AtTextLowerLeft{%
    % Insert vertical rule
    \makebox[\textwidth]{\rule[-\baselineskip]{1.7pt}{\dimexpr\textheight+2\baselineskip}}%
  }% \AtTextLowerLeft
  \AtTextUpperLeft{%
    % Insert upper blocks
    \raisebox{1.5\baselineskip}{%
      \setlength{\fboxrule}{1.7pt}%
      \begin{tabular}[b]{ @{} c @{} }
        \fbox{\makebox[.3\textwidth]{Something}} \\[-\fboxrule]
        \fbox{\makebox[\dimexpr\textwidth-2\fboxrule-2\fboxsep]{Something else}}
      \end{tabular}
    }% \raisebox
  }% \AtTextUpperLeft
}% \AddToShipoutPictureFG

\newcounter{numex}
\def\thrulefill{\leavevmode\leaders\hrule height 0.5ex depth \dimexpr2pt-0.7ex\hfill\kern0pt}

\newcommand\Startex{%
  \stepcounter{numex}
  \begin{center}
    {\bfseries Example~\thenumex)}~{\thrulefill}
  \end{center}}

\pagestyle{empty}
\begin{document}

\begin{multicols*}{2}
  \Startex
  $x+y=y+x$
\end{multicols*}

\end{document}

相关内容