在 Tikz 中创建 Framedbox

在 Tikz 中创建 Framedbox

我想用 Tikz 来编写这个程序

\documentclass[oneside]{article}
\setlength{\oddsidemargin}{0.25 in}
\setlength{\evensidemargin}{-0.25 in}
\setlength{\topmargin}{-0.6 in}
\setlength{\textwidth}{6.5 in}
\setlength{\textheight}{8.5 in}
\setlength{\headsep}{0.75 in}
\setlength{\parindent}{0 in}
\setlength{\parskip}{0.1 in}

%
% ADD PACKAGES here:
%

\usepackage{amsmath}
\usepackage{tikz}
\usepackage{framed}

%
% The following commands set up the lecnum (lecture number)
% counter and make various numbering schemes work relative
% to the lecture number.
%
\newcounter{lecnum}
\newcounter{chapnum}
\renewcommand{\thepage}{\thelecnum-\arabic{page}}
\renewcommand{\thesection}{\thechapnum.\arabic{section}}
\renewcommand{\theequation}{\thelecnum.\arabic{equation}}
\renewcommand{\thetable}{\thelecnum.\arabic{table}}

%
% The following macro is used to generate the header. 
%  
  \newcommand{\lecture}[4]{
  \pagestyle{myheadings}
  \thispagestyle{plain}
  \newpage
  \setcounter{lecnum}{#1}
  \setcounter{chapnum}{1}
  \setcounter{section}{0}
  \setcounter{page}{1}
  \noindent
  \begin{center}
    \framebox{
    \vbox{\vspace{2mm}
    \hbox to 6.28in { {\bf Course : Subject
    \hfill Term Year} }
    \vspace{4mm}
    \hbox to 6.28in { {\Large \hfill Lecture #1: #2  \hfill} 
    }
    \vspace{2mm}
    \hbox to 6.28in { {\it Lecturer: #3 \hfill } } %\hbox to 6.28in { {\it Lecturer: #3 \hfill Scribes: #4} }
    \vspace{2mm}}
   }
    \end{center}
    \markboth{Lecture #1: #2}{Lecture #1: #2}

    {\bf Introduction}: 

    \vspace*{4mm}
  }
%

% **** IF YOU WANT TO DEFINE ADDITIONAL MACROS FOR YOURSELF, 
 PUT THEM HERE:

 \newcommand\E{\mathbb{E}}

\begin{document}
%FILL IN THE RIGHT INFO.
%\lecture{**LECTURE-NUMBER**}{**DATE**}{**LECTURER**} 
{**SCRIBE**}
\lecture{1}{Date}{Name}{}

% **** YOUR NOTES GO HERE:

\end{document}

在此处输入图片描述

我相信 TiKz 可以让它更有创意?

答案1

你可以使用以下代码开始发挥创意:

\documentclass[oneside]{article}
\setlength{\oddsidemargin}{0.25 in}
\setlength{\evensidemargin}{-0.25 in}
\setlength{\topmargin}{-0.6 in}
\setlength{\textwidth}{6.5 in}
\setlength{\textheight}{8.5 in}
\setlength{\headsep}{0.75 in}
\setlength{\parindent}{0 in}
\setlength{\parskip}{0.1 in}

%
% ADD PACKAGES here:
%

\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{positioning, backgrounds}

%
% The following commands set up the lecnum (lecture number)
% counter and make various numbering schemes work relative
% to the lecture number.
%
\newcounter{lecnum}
\newcounter{chapnum}
\renewcommand{\thepage}{\thelecnum-\arabic{page}}
\renewcommand{\thesection}{\thechapnum.\arabic{section}}
\renewcommand{\theequation}{\thelecnum.\arabic{equation}}
\renewcommand{\thetable}{\thelecnum.\arabic{table}}

%
% The following macro is used to generate the header. 
%  
  \newcommand{\lecture}[4]{
  \pagestyle{myheadings}
  \thispagestyle{plain}
  \newpage
  \setcounter{lecnum}{#1}
  \setcounter{chapnum}{1}
  \setcounter{section}{0}
  \setcounter{page}{1}
  \noindent
  \begin{center}
    \begin{tikzpicture}[
        background rectangle/.style={
            draw=red!50!orange, ultra thick, fill=orange!30,
        },
        tight background,
        show background rectangle]
        \node[font=\Large, anchor=center] (lecture) {Lecture #1: #2\strut};
        \node[font=\bfseries, above left=2mm and 3.24in of lecture.north, anchor=south west] (course) {Course: Subject\strut};
        \node[font=\bfseries, above right=2mm and 3.24in of lecture.north, anchor=south east] (term) {Term Year\strut}; 
        \node[font=\bfseries, below left=2mm and 3.24in of lecture.south, anchor=north west] (lecturer) {Lecturer: #3\strut};
        \node[font=\bfseries, below right=2mm and 3.24in of lecture.south, anchor=north east] (scribes) {Scribes: #4\strut}; 
    \end{tikzpicture}
    \end{center}
    \markboth{Lecture #1: #2}{Lecture #1: #2}

    {\bf Introduction}: 

    \vspace*{4mm}
  }
%

% **** IF YOU WANT TO DEFINE ADDITIONAL MACROS FOR YOURSELF,  PUT THEM HERE:

 \newcommand\E{\mathbb{E}}

\begin{document}
%FILL IN THE RIGHT INFO.
%\lecture{**LECTURE-NUMBER**}{**DATE**}{**LECTURER**}{**SCRIBE**}
\lecture{1}{Date}{Name}{}

% **** YOUR NOTES GO HERE:

\end{document}

在此处输入图片描述

相关内容