Hi,
I'm trying to modify the papertex class to allow titles to be spread over just 2 columns of a 3 column environment. The code I'm modifying is:
\newcommand{\magazinetex@inexpandedtitle}[1]{
\begin{minipage}{.95\textwidth}
\begin{center}
\noindent\Large\textbf{#1}
\end{center}
\end{minipage}
}
\newcommand{\expandedtitle}[2]{
\end{multicols}
\begin{center}
\setlength{\fboxsep}{5pt}
\setlength{\shadowsize}{2pt}
\ifthenelse{\equal{#1}{shadowbox}}{%
\shadowbox{%
\magazinetex@inexpandedtitle{#2}%
}%
}{}
\ifthenelse{\equal{#1}{doublebox}}{%
\doublebox{%
\magazinetex@inexpandedtitle{#2}%
}%
}{}
\ifthenelse{\equal{#1}{ovalbox}}{%
\ovalbox{%
\magazinetex@inexpandedtitle{#2}%
}%
}{}
\ifthenelse{\equal{#1}{Ovalbox}}{%
\Ovalbox{%
\magazinetex@inexpandedtitle{#2}%
}%
}{}
\ifthenelse{\equal{#1}{lines}}{
\hrule
\vspace*{8pt}
\begin{center}
\noindent\Large\textbf{#2}
\end{center}
\vspace*{8pt}
\hrule
}{}
\end{center}
\begin{multicols}{\magazinetex@ncolumns{}}
\ifnum \magazinetex@ncolumns > \minraggedcols
\raggedFormat
\fi
}
Clearly here the multicolumn environment is ended, and a minipage of width 0.95textwidth is created. What I'd like to do is get the values of \columnwidth and \columnsep from before we leave the multicolumn environment, and use them to set the width. I've tried \setlength and \let but I get the minipage being very thin. Simply putting \begin{minipage}{10cm} works, but won't adapt to different column widths.
My modification at present:
\newcommand{\papertex@inresultstable}[2]{
\begin{minipage}{\papertex@resultstablesize}
\begin{center}
\noindent\normalsize\textbf{#2}
\end{center}
\end{minipage}
}
\newcommand{\resultstable}[2]{
\setlength{\papertex@previouscolumnwidth}{\columnwidth}
\setlength{\papertex@previouscolumnsep}{\columnsep}
\setlength{\papertex@resultstablesize}{\papertex@previouscolumnwidth}
\vspace*{5pt}
\end{multicols}
\begin{center}
\setlength{\fboxsep}{5pt}
\setlength{\shadowsize}{2pt}
%\addtolength{\papertex@resultstablesize}{-1\papertex@previouscolumnsep}
%\addtolength{\papertex@resultstablesize}{-5pt}
%\addtolength{\papertex@resultstablesize}{-1\shadowsize}
\ifthenelse{\equal{#1}{shadowbox}}{%
\shadowbox{%
\papertex@inresultstable{\papertex@resultstablesize}{#2}%
}%
}{}
\ifthenelse{\equal{#1}{doublebox}}{%
\doublebox{%
\papertex@inresultstable{\papertex@resultstablesize}{#2}%
}%
}{}
\ifthenelse{\equal{#1}{ovalbox}}{%
\ovalbox{%
\papertex@inresultstable{\papertex@resultstablesize}{#2}%
}%
}{}
\ifthenelse{\equal{#1}{Ovalbox}}{%
\Ovalbox{%
\papertex@inresultstable{\papertex@resultstablesize}{#2}%
}%
}{}
\ifthenelse{\equal{#1}{lines}}{
\hrule
\vspace*{5pt}
\begin{center}
\noindent\normalsize\textbf{#2}
\end{center}
\vspace*{5pt}
\hrule
}{}
\end{center}
\begin{multicols}{\papertex@ncolumns{}}
\ifnum \papertex@ncolumns > \minraggedcols
\raggedFormat
\fi
}
I have 2 questions at the moment please. How can I grab and keep a value from before the multicolumn environment was left, and how can I display (either in log file or in LaTeX text output) the value being assigned to variables so that I can debug the class file? Thanks in advance.
Document Classes ⇒ Modifying a class
Modifying a class
The following code may help:artyb wrote: I have 2 questions at the moment please. How can I grab and keep a value from before the multicolumn environment was left, and how can I display (either in log file or in LaTeX text output) the value being assigned to variables so that I can debug the class file? Thanks in advance.
Code: Select all
\documentclass{article}
\begin{document}
\newlength{\mylength}
\setlength{\mylength}{10pt}
\the\mylength
\begingroup
\setlength{\mylength}{20pt}
\the\mylength
\endgroup
\the\mylength
\begingroup
\global\setlength{\mylength}{30pt}
\the\mylength
\endgroup
\the\mylength
\end{document}
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Re: Modifying a class
Brilliant, thank you, and such a quick response-got it working the same evening, but been too busy to thank you since.