
답변1
연한 파란색 면(어쩌면 진한 파란색 면)에 쓰여진 모든 것에는 섹션 또는 이와 유사한 기능이 있는 것 같습니다. 그래서 그것은 마치 그것이 변하지 않는 끊임없는 텍스트인 것처럼 보입니다.
공백 안의 텍스트는 가변 텍스트인 것 같습니다.
내 가정이 정확하다면 물론 다양한 텍스트 부분으로 채워지도록 일부 LaTeX 변수를 정의할 수 있습니다. 테이블을 생성하고 이전에 정의된 변수의 내용을 채우는 명령이나 환경을 정의해야 합니다.
그것은 쉬워야합니다.
그 동안에는 여기 내 MWE가 있습니다.
일반적으로 정의는 자체 스타일 파일에 넣습니다. 이 경우에는 \makeatletter
및 가 필요하지 않습니다 \makeatother
.
예를 들어 일부 내부 변수를 정의했습니다 \course@title
. @
일반 문서에서는 사용할 수 없습니다 . @
파일 이름에 the를 사용하면 변수 이름이 안전해집니다. 우연히 문서에 두 번째 변수를 정의하지는 않습니다.
또한 변수의 내용을 조작하기 위해 사용자 공간 명령을 정의했습니다.
또한 변경되지 않는 텍스트 부분의 이름에 대한 변수를 정의했습니다. 즉, 섹션 이름으로 사용되는 상수 텍스트입니다. 이 섹션 이름을 변경할 필요가 없다고 확신하는 경우 변수에서 해당 이름을 정의할 필요가 없습니다. 명령에서 섹션 이름을 직접 사용하면 됩니다. 그러나 이러한 섹션 이름 중 일부 또는 전부가 변경될 가능성이 약간 있는 경우에는 안전합니다.
마지막으로, 나는 우리를 위해 조판을 할 명령을 정의했습니다 \coursetable
(그래서 이것이 매크로에 대한 좋은 이름이라고 확신하지 못합니다. 경고를 받았습니다.).
모든 내용을 하나의 매크로에 넣으면 원하는 순서대로 변수를 자유롭게 채울 수 있습니다. 그것은 중요하지 않습니다.
\documentclass{article}
\usepackage{graphicx}
\usepackage{tabularx}
%% Some new column declarations
\newcolumntype{C}{>{\centering\arraybackslash}X}
\newcolumntype{L}{>{\raggedright\arraybackslash}X}
%% Dont use indent here!
\setlength{\parindent}{0pt}
%% maybe we need a uniqe skip:
\newlength{\myskip}\setlength{\myskip}{4ex}
%% Define some variables
\makeatletter
\def\course@title{}
\def\course@institute{Institute for Typography}
\def\course@teacher{}
%% This time with a default
\def\course@term{Summer2017}
\def\course@content{The course will explain the content of the course}
%% Define also the section names
\def\course@institutename{Institute}
\def\course@titlename{Course}
\def\course@teachername{Professor}
\def\course@termname{Semester}
\def\course@contentname{Contents}
%% Define the command, which will create the table right now.
\newcommand{\coursetable}{%
% start a new page
\clearpage%
\thispagestyle{empty}%
% Put in the Logos
\includegraphics[width=2cm]{example-image-a}%
\hfill%
\includegraphics[width=2cm]{example-image-b}%
\vspace{\myskip}
\begin{tabularx}{\linewidth}{|C|C|}
\hline
\textbf{\course@titlename} & \textbf{\course@termname} \\
\hline
\course@title & \course@term \\
\hline
\textbf{\course@teachername} & \textbf{\course@institutename} \\
\hline
\course@teacher & \course@institute\\
\hline
\end{tabularx}
\vspace*{\myskip}
\begin{tabularx}{\linewidth}{|L|}
\hline
\multicolumn{1}{|C|}{\textbf{\course@contentname}}\\
\hline
\course@content\\
\hline
\end{tabularx}
\vfill
Signature: \hrulefill
}
%% Define user space commands to manipulate the internal variables
\newcommand{\courseterm}[1]{\def\course@term{#1}}%
\newcommand{\coursetitle}[1]{\def\course@title{#1}}%
\newcommand{\courseinstitute}[1]{\def\course@institute{#1}}
\newcommand{\courseteacher}[1]{\def\course@teacher{#1}}
\newcommand{\coursecontent}[1]{\def\course@content{#1}}
%% Reserve the @-sign.
\makeatother
\begin{document}
%% The order, in which you define the variables, does not matter.
\coursetitle{Beautiful Concepts}
\courseteacher{Prof. Dr. Drofnats}
\coursecontent{We will discuss in deep, if good typography will enhace
every document of the world. Therefore we will study two or three
examples}
%% Now, build this table.
\coursetable
\end{document}
이것이 결과입니다. 물론 귀하의 예와는 다르지만 귀하의 문서가 가야 할 길을 보여주기를 바랍니다.
xcolor
편집: 내가 언급하는 것을 잊은 점: 파란색 테이블 행을 얻으려면 -package를 살펴보십시오 .