我正在使用https://www.latextemplates.com/template/conference-booklet为研讨会制作一本小册子。
其中,他们提到\KL、\IS、\CT 和 \IT 命令分别用于主题演讲、受邀演讲者、贡献演讲和受邀演讲。
在我提到的研讨会中,我计划将上述命令更改为 \F、\PD、\PhD、\IPhD 命令,用于教职人员演讲、博士后演讲、博士生演讲、IPhD 学生演讲。因此,在我下载的 zip 文件夹中,有一个名为 conferencebooklet.cls 的文件
我在那里做了一些更改,将 \KL、\IS、\CT 和 \IT 分别替换为 \F、\PD、\PhD、\IPhD。但是,即使在进行此更改之后,当我运行时,我仍然会得到 KL、IS、CT、IT。
请参阅下面提到的 .cls 文件
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Conference Booklet
% Structural Definitions
% Version 1.0 (24/11/2019)
%
% This template originates from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Maxime Lucas ([email protected])
% Pau Clusella
% Modifications for LaTeX Templates by Vel ([email protected])
%
% License:
% GNU General Public License v3.0
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
% CLASS CONFIGURATION
%----------------------------------------------------------------------------------------
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{conferencebooklet}[2019/12/22 LaTeX Templates Conference Booklet Class v1.0]
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{scrbook}} % Pass through any options to the base class
\ProcessOptions\relax % Process given options
\LoadClass{scrbook} % Load the base class
%----------------------------------------------------------------------------------------
% REQUIRED PACKAGES AND MISC CONFIGURATIONS
%----------------------------------------------------------------------------------------
\usepackage{graphicx} % Required for including images
\setcounter{secnumdepth}{-2} % Remove all section numbering
\usepackage{multicol} % Allows table cells to span multiple columns
\usepackage{longtable} % Allows the creation of tables that automatically wrap to the next page
\pagestyle{plain} % Use the plain page style for all headers and footers (only a page number)
\usepackage{scrhack} % Fixes compatibility issues between KOMA-Script and other packages
\usepackage{lastpage} % Required to determine the total number of pages
%----------------------------------------------------------------------------------------
% MARGINS
%----------------------------------------------------------------------------------------
\usepackage[
top=2.5cm, % Top margin
bottom=2.5cm, % Bottom margin
inner=1.5cm, % Inner margin
outer=3cm, % Outer margin
footskip=1.4cm, % Space from the bottom margin to the baseline of the footer
headsep=0.8cm, % Space from the top margin to the baseline of the header
headheight=0.5cm, % Height of the header
%showframe % Uncomment to show the frames around the margins for debugging purposes
]{geometry}
%----------------------------------------------------------------------------------------
% FONTS & TYPOGRAPHY
%----------------------------------------------------------------------------------------
\usepackage[utf8]{inputenc} % Required for inputting international characters
\usepackage[T1]{fontenc} % Output font encoding for international characters
\usepackage[sfdefault, lf]{carlito} % Use the Carlito family of sans-serif fonts with lining figures
\usepackage{microtype} % Improve typography
%----------------------------------------------------------------------------------------
% COLOURS
%----------------------------------------------------------------------------------------
\usepackage[table]{xcolor} % Required for defining and using custom colours
\definecolor{myorange}{RGB}{255, 117, 40}
\definecolor{mygray}{RGB}{164, 168, 172}
\definecolor{mywhite}{RGB}{235, 238, 231}
\definecolor{myblue}{RGB}{52, 115, 116}
\newcommand{\primarycolor}{myblue}
\newcommand{\secondarycolor}{mywhite}
% Table colours
\newcommand{\tbg}{gray} % Event background
\newcommand{\tfg}{white} % Event foreground (text)
\newcommand{\tbc}{gray!25} % Break background
% Talk types colours
\newcommand{\Fcolor}{myblue!65} % Invited speaker
\newcommand{\PhDcolor}{white} % Contributed talk
\newcommand{\KLcolor}{myorange!45} % Keynote lecture
\newcommand{\ITcolor}{yellow!25} % Invited talk
%----------------------------------------------------------------------------------------
% LINKS
%----------------------------------------------------------------------------------------
\usepackage{hyperref} % Required for links
\hypersetup{
colorlinks=false,
%urlcolor=\primarycolor, % Colour for \url and \href links
%linkcolor=\primarycolor, % Colour for \nameref links
hidelinks, % Hide the default boxes around links
}
%----------------------------------------------------------------------------------------
% TABLE DEFINITIONS
%----------------------------------------------------------------------------------------
\usepackage{array} % Required for manipulating table columns
\newcommand{\tablebreak}[2]{\rowcolor{\tbc} #1 & \multicolumn{4}{c|}{\bfseries #2} \\ \hline } % Timetable conference break row
\newcommand{\eventtype}[2]{#1 & \multicolumn{4}{c|}{\cellcolor{\tbg}\color{\tfg}\bfseries #2} \\ \hline } % Timetable conference event row
\newcolumntype{L}[1]{>{\raggedright\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} % Define a new left-aligned (no justification) column type
\newcolumntype{C}[1]{>{\centering\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} % Define a new centred column type
\newcolumntype{R}[1]{>{\raggedleft\let\newline\\\arraybackslash\hspace{0pt}}m{#1}} % Define a new right-aligned column type
\newcommand{\F}[4]{#1 & \cellcolor{\Fcolor}IS & {\bfseries#2}\newline #3 & & #4 \\ \hline} % Invited speaker row
\newcommand{\PhD}[4]{#1 & \cellcolor{\PhDcolor}CT & {\bfseries#2}\newline #3 & & #4 \\ \hline} % Contributed talk row
\newcommand{\KL}[4]{#1 & \cellcolor{\KLcolor}KL & {\bfseries#2}\newline #3 & & #4 \\ \hline} % Keynote lecture row
\newcommand{\IT}[4]{#1 & \cellcolor{\ITcolor}IT & {\bfseries#2}\newline #3 & & #4 \\ \hline} % Invited talk row
\newcommand{\tutorial}[4]{#1 & & {\bfseries#2}\newline #3 & & #4 \\ \hline} % Tutorial row
%----------------------------------------------------------------------------------------
% CHAPTER STYLING
%----------------------------------------------------------------------------------------
\newdimen\mybarpadding
\mybarpadding=1.5em\relax % Horizontal padding between the coloured bar and chapter name
\RedeclareSectionCommand[% Adjust the spacing around the \chapter command
afterskip=4em plus 1pt minus 1pt,% Vertical whitespace under chapters
beforeskip=-1pt, % Vertical whitespace before chapters
level=0,% Chapters are the top level command
toclevel=0,% Chapters are the top level command
]{chapter}
\setkomafont{chapter}{\normalfont\normalsize\bfseries\Huge} % Chapter font style
\RedeclareSectionCommand[% Adjust the spacing around the \section command
afterskip=6pt,% Vertical whitespace under sections
beforeskip=3pt, % Vertical whitespace before chapters
level=1,% Sections are the second level command
toclevel=1,% Sections are the second level command
]{section}
%------------------------------------------------
\renewcommand{\chapterlinesformat}[3]{%
\ifthispageodd{% Odd pages have the coloured bar to the left of the chapter title
\hfill% Coloured bar fills available width
\raisebox{-0.2em}{\makebox[0pt][r]{\textcolor{\primarycolor}{\rule{\paperwidth}{1em}}}}% Coloured bar
\hspace{\mybarpadding}% Padding between the chapter title and colour bar
\mbox{#3}% Chapter title
}{% Even pages have the coloured bar to the right of the chapter title
\mbox{#3}% Chapter title
\hspace{\mybarpadding}% Padding between the chapter title and colour bar
\raisebox{-0.2em}{\makebox[0pt][l]{\textcolor{\primarycolor}{\rule{\paperwidth}{1em}}}}% Coloured bar
}%
}
%----------------------------------------------------------------------------------------
% ABSTRACT STYLING
%----------------------------------------------------------------------------------------
\newcommand{\abstract}[5]{
\filbreak % Avoid page breaks within abstracts
{\large \bfseries #1} % Title
{\bfseries \itshape #2} \hfill {#3} % Author(s) and abstract type
\textcolor{mygray}{#4} % Affiliation(s)
#5 % Abstract text
}
%----------------------------------------------------------------------------------------
% POSTER STYLING (SHORT)
%----------------------------------------------------------------------------------------
\newcommand{\poster}[3]{
\filbreak % Avoid page breaks within abstracts
{\large\bfseries #1}\\ % Title
\hspace*{0.75cm} #2, \textit{#3} % Author and affiliation
}
%----------------------------------------------------------------------------------------
% VERTICAL LINE IN PAGE MARGINS
%----------------------------------------------------------------------------------------
\usepackage[scale=1, angle=0, opacity=1]{background}
\backgroundsetup{contents={}}
\AddEverypageHook{%
\ifthenelse{%
\isodd{\thepage} \AND \thepage>1 \AND \NOT \thepage=\pageref{LastPage} % If odd page but not the first or last page
}{%
\backgroundsetup{
color=\secondarycolor, % Bar colour
position=current page.south east, % Position of the bar on the page
nodeanchor=south east, % Anchor location inside the bar
contents={\rule{10pt}{0.66\paperheight}} % Bar width and height
}
}{}
%
\ifthenelse{%
\NOT \isodd{\thepage} \AND \NOT \thepage=\pageref{LastPage} % If even page but not the last page
}{%
\backgroundsetup{
color=\secondarycolor, % Bar colour
position=current page.south west, % Position of the bar on the page
nodeanchor=south west, % Anchor location inside the bar
contents={\rule{10pt}{0.66\paperheight}} % Bar width and height
}
}{}
%
\BgMaterial % Output the background set up above
}
%----------------------------------------------------------------------------------------
% TALK TYPE CIRCLE DEFINITIONS
%----------------------------------------------------------------------------------------
\newcommand{\circlegeneric}[2]{\tikz[baseline={([yshift=-.8ex]current bounding box.center)}] \node[circle, inner sep=3pt, minimum size=0.5em, color=black, fill=#1]{\small \bfseries #2};} % Generic definition of a circle with a custom colour and 2 letters in it
\newcommand{\KLtag}{\circlegeneric{\KLcolor}{KL}} % Keynote lecture circle
\newcommand{\Ftag}{\circlegeneric{\Fcolor}{F}} % Invited speaker circle
\newcommand{\PhDtag}{\circlegeneric{\PhDcolor}{PhD}} % Contributed talk circle
\newcommand{\ITtag}{\circlegeneric{\ITcolor}{IT}} % Invited talk circle
%----------------------------------------------------------------------------------------
% PACKAGES THAT CLASH AND MUST BE LOADED LAST
%----------------------------------------------------------------------------------------
\usepackage{pdfpages} % Required for including a full-page image for the cover
请帮我修复这个问题。
答案1
没有必要改变conferencebooklet.cls
定义新的命令、新的标签和新的颜色。
(1)启动您的文档
% !TeX TS-program = pdflatex
\documentclass[
openany, % Allow chapters to start on odd and even pages
parskip=full, % Large space between paragraphs
12pt, % Default font size
a4paper, % Paper size, use letterpaper for US letter size
]{conferencebooklet} % Custom class defining the style and layout of the template
%***************************************************************** added <<<<<<<<<<<<<
\newcommand{\F}[4]{#1 & \cellcolor{\Fcolor}F & {\bfseries#2}\newline #3 & & #4 \\ \hline} % Faculty talk, row
\newcommand{\PD}[4]{#1 & \cellcolor{\PDcolor}PD & {\bfseries#2}\newline #3 & & #4 \\ \hline} % Postdoc talk row
\newcommand{\PhD}[4]{#1 & \cellcolor{\PhDcolor}PhD & {\bfseries#2}\newline #3 & & #4 \\ \hline} % PhD talk row
\newcommand{\IPhD}[4]{#1 & \cellcolor{\IPhDcolor}IPhD & {\bfseries#2}\newline #3 & & #4 \\ \hline} % Student talk row
\newcommand{\Ftag}{\abstractcircle{\Fcolor}{F}} % Faculty lecture circle
\newcommand{\PDtag}{\abstractcircle{\PDcolor}{PD}} % Postdoc speaker circle
\newcommand{\PhDtag}{\abstractcircle{\PhDcolor}{PhD}} % PhD talk circle
\newcommand{\IPhDtag}{\abstractcircle{\IPhDcolor}{IPhD}} % Student talk circle
\newcommand{\abstractcircle}[2]{\tikz[baseline={([yshift=-0.8ex]current bounding box.center)}]
\node[circle, minimum size=2.5em, color=black, fill=#1]{\small \bfseries #2};} % circle for abstracts with a custom colour and 3 letters in it
% Talk types colours
\newcommand{\Fcolor}{blue!35} % Faculty
\newcommand{\PDcolor}{red!40} % PostDoc
\newcommand{\PhDcolor}{orange!35} % PhD
\newcommand{\IPhDcolor}{green!25} % Student
% ***************************************************************************************************************
\begin{document}
(2)使用新定义的命令编写时间表(第二列变得更宽)
% TIMETABLE
%----------------------------------------------------------------------------------------
\chapter{Timetable}
PhD: PhD student talk, PD: Postdoc talk, F: Faculty talk, IPhD: student talk.
\section{Tuesday, 20 of March}
\begin{longtable}{|C{0.15\linewidth}| C{0.07\linewidth}| C{0.3\linewidth} C{0.0\linewidth} C{0.4\linewidth}|}% changed second column width <<<<<<<<<<<<<<<<
\hline
\tablebreak{8:30--9:00}{Registration}
\tablebreak{9:00--9:10}{Welcome remarks}
\F{9:10--10:05}{Leon Tremblay}{Montreal, Canada}{Title of a Faculty talk}
\PhD{10:05--10:30}{Marc Fournier}{Brussels, Belgium}{Title of PhD talk}
\tablebreak{10:30--11:00}{Coffee}
\PD{11:00--11:40}{Hiroya Sato}{Tokyo, Japan}{Title of Postdoc talk}
\PhD{11:40--12:45}{Marc Smith}{Brussels, Belgium}{Title of PhD talk with math and paragraphs}
\tablebreak{12:45--14:00}{Lunch}
\PhD{14:00--14:30}{Marc Rodriguez}{Barcelona, Spain}{Title of PhD talk with math and references}
\PD{14:30--15:05}{Hiroya Sato}{Tokyo, Japan}{Title of Postdoc talk}
\tablebreak{15:05--15:30}{Coffee}
\PhD{15:30-16:00}{Marc Jansen}{Amsterdam, The Netherlands}{Title of PhD talk and references and a figure}
\IPhD{16:00-17:10}{Alberto Dupont}{Madrid, Spain}{Title of student talk}
\eventtype{17:10--19:30}{Poster session with Wine \& Cheese}
\end{longtable}
\newpage
%------------------------------------------------
(3)使用新标签。标签可以是:空、\Ftag
(教师谈话)、\PDtag
(博士后谈话)、\PhDtag
(博士谈话)或\IPhDtag
(学生谈话)
\abstract\chapter{List of Abstracts -- Talks}
\section{Tuesday 20th}
\abstract
{Title of a Faculty talk} % Title
{L. Tremblay} % Author(s)
{\Ftag} % Tag, can be: empty, \Ftag (Faculty talk), \PDtag (Postdoc talk), \PhDtag (PhD talk) or \IPhDtag (student talk)
{McGill University, Montreal, Canada} % Affiliation(s)
{Let us suppose that the noumena have nothing to do
with necessity, since knowledge of the Categories is a
posteriori. } % Abstract text
\abstract
{Title of PhD s talk} % Title
{\underline{M. Fournier}$^{1}$, D. Dupont$^{1,2,3}$} % Author(s)
{\PhDtag} % Tag, can be: empty, \Ftag (Faculty talk), \PDtag (Postdoc talk), \PhDtag (PhD student talk) or \IPhDtag (student talk)
{$^1$ Physics Department, Université Libre de Bruxelles, Brussels, Belgium\\ $^2$ Physics Department, Lancaster University, Lancaster, UK\\ $^3$ CSDC, University of Florence, Florence, Italy} % Affiliation(s)
{Let us suppose that the noumena have nothing to do
with necessity, since knowledge of the Categories is a
posteriori.} % Abstract text
\abstract
{Title of Postdoc talk} % Title
{H. Sato} % Author(s)
{\PDtag} % Tag, can be: empty, \Ftag (Faculty talk), \PDtag (Postdoc talk), \PhDtag (PhD student talk) or \IPhDtag (student talk)
{Department of Physics, Tokyo Institute of Technology, Tokyo, Japan} % Affiliation(s)
{Let us suppose that the noumena have nothing to do
with necessity, since knowledge of the Categories is a
posteriori. } % Abstract text
{Title of PhD talk with math and paragraphs} % Title
{\underline{M. Smith}$^{1}$, D. Dupont$^{1,2,3}$} % Author(s)
{} % Tag, can be: empty, \Ftag (Faculty talk), \PDtag (Postdoc talk), \PhDtag (PhD student talk) or \IPhDtag (student talk)
{$^1$ Physics Department, Université Libre de Bruxelles, Brussels, Belgium\\ $^2$ Physics Department, Lancaster University, Lancaster, UK\\ $^3$ CSDC, University of Florence, Florence, Italy} % Affiliation(s)
{Let us suppose that the noumena have nothing to do
with necessity, since knowledge of the Categories is a
posteriori.} % Abstract text