5

The termcal package works fine for two or more \calday entries. However, if there are six \skipday entries, than the calculated days on the table border. Here is a snapshot of the problem:

enter image description here

This example was produced with the following code:

\documentclass[a4]{article}
\usepackage{termcal}

\newcommand{\TRClass}{%
\skipday % Tuesday
\skipday % Tuesday
\skipday % Wednesday (no class)
\calday[Thursday]{\classday} % Thursday
\skipday % Friday 
\skipday\skipday % weekend (no class)
}

\newcommand{\Holiday}[2]{%
\options{#1}{\noclassday}
\caltext{#1}{#2}
}

\begin{document}
\paragraph*{Lab Tentative Schedule for Electric Circuit Analysis:}
\begin{center}
\begin{calendar}{8/18/2014}{2} % Semester starts on 1/11/2010 and last for 16
                    % weeks, including finals week
\setlength{\calboxdepth}{.3in}
\TRClass
% schedule
\caltexton{1}{Lab briefing}
\caltextnext{2.2 Charge, Current, Voltage, and Power\\
2.3 Voltage and Current Sources\\
2.4 Ohm's Law}

\end{calendar}
\end{center}
\end{document}

Any help on this problem is more than welcome.

Oliver Faust

  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format. – karlkoeller Feb 22 '14 at 7:18
4

There is a spurious space in the definition of \ca@doaday in the file termcal.sty. You have to put a % like

\renewcommand\ca@doaday[1]{% %%<--- spurious space

Full code:

\documentclass[a4paper]{article}    %% a4 doesn't work here
\usepackage{termcal}

\makeatletter
\renewcommand\ca@doaday[1]{% %%<--- spurious space
   \hspace*{-1em}\hbox{\vrule depth \calboxdepth height 0pt width 0pt\vtop{%  note \hspace* in the begining
                                           %% Adjust as needed.
   #1%                                 %options specified by |\calday|
   \csname\curdate options\endcsname%  % options specified by date
   \ifclassday\csname C\theclassnum options\endcsname\fi%   by classnumber
   \hbox to \hsize{\calprintdate\hfill\ifclassday\calprintclass\fi}%
   \vspace{2pt}
      \begingroup
        \let\\=\ca@normbs
        \raggedright
        \sloppy
        \the\weeklytext\par
        \csname\curdate text\endcsname
        \ifclassday\csname C\theclassnum text\endcsname
                   \stepcounter{classnum}\fi
      \endgroup
   }}%
    \global\newmonthfalse
    \advancedate%
}%
\makeatother

\newcommand{\TRClass}{%
\skipday % Tuesday
\skipday % Tuesday
\skipday % Wednesday (no class)
\calday[Thursday]{\classday} % Thursday
\skipday % Friday
\skipday\skipday % weekend (no class)
}

\newcommand{\Holiday}[2]{%
\options{#1}{\noclassday}%
\caltext{#1}{#2}%
}%

\begin{document}
\paragraph*{Lab Tentative Schedule for Electric Circuit Analysis:}
\begin{center}
\begin{calendar}{8/18/2014}{2} % Semester starts on 1/11/2010 and last for 16
                    % weeks, including finals week
\setlength{\calboxdepth}{0.3in}
\TRClass
% schedule
\caltexton{1}{Lab briefing}%
\caltextnext{2.2 Charge, Current, Voltage, and Power\\
2.3 Voltage and Current Sources\\
2.4 Ohm's Law}
\end{calendar}
\end{center}
\end{document}

enter image description here

  • Dear Harish, thank you. Your answer has solved my problem. – Oliver Faust Feb 23 '14 at 6:16
  • @OliverFaust Glad it helped. On this site, best way of saying thanks is to upvote and accept the answers that helped you. See tex.stackexchange.com/help/someone-answers for details. :) – user11232 Feb 23 '14 at 8:11
  • To Harish Kumar there is a problem with your solution: \noclassday does not increment the date counter: In your example, if you replace \skipday\skipday' with \noclassday\noclassday' the second lab will be on the 19th of august. This problem was pointed out by one of colleagues: Hey your lab ends in October and not in December ... – Oliver Faust Feb 27 '14 at 9:24
  • @OliverFaust: Answer updated. :) – user11232 Feb 27 '14 at 13:31
  • 1
    @OliverFaust Thank you for the great words. Up voting the answer and accepting it are the conventional ways to convey thanks in this site. For clarity please refer to How do you accept an answer? :) – user11232 Mar 3 '14 at 7:51
1

There are three places where spurious spaces can be found in the code. Removing them solves the problem, and the negative \hspace in the accepted answer is not required. Here's a solution without that. (I've also adjusted the size of \calboxdepth to fit your three lines.

\makeatletter
\renewcommand\ca@doaday[1]{% <--- Spurious space removed here
\hbox{\vrule depth \calboxdepth height 0pt width 0pt\vtop{%  
   #1%                                 %options specified by |\calday|
   \csname\curdate options\endcsname%  % options specified by date
   \ifclassday\csname C\theclassnum options\endcsname\fi%   by classnumber
   \hbox to \hsize{\calprintdate\hfill\ifclassday\calprintclass\fi}%
   \vspace{2pt}
      \begingroup
        \let\\=\ca@normbs
        \raggedright
        \sloppy
        \the\weeklytext\par
        \csname\curdate text\endcsname%
        \ifclassday\csname C\theclassnum text\endcsname
                   \stepcounter{classnum}\fi
      \endgroup
   }}%
    \global\newmonthfalse
    \advancedate%
}%
\renewcommand\advancedate{\stepcounter{date}% <--- Spurious space removed here
    \ifnum\thedate>\monthlength\relax
       \addtocounter{date}{-\monthlength}\advancemonth\fi}

\renewcommand\advancemonth{%
   \global\newmonthtrue\stepcounter{month}% <-- another spurious space
   \ifnum\c@month>12
      \stepcounter{year}\setleap\setcounter{month}1\fi}
\makeatother%


\newcommand{\TRClass}{%
\skipday % Tuesday
\skipday % Tuesday
\skipday % Wednesday (no class)
\calday[Thursday]{\classday} % Thursday
\skipday % Friday 
\skipday\skipday % weekend (no class)
}

\newcommand{\Holiday}[2]{%
\options{#1}{\noclassday}
\caltext{#1}{#2}
}

\begin{document}
\paragraph*{Lab Tentative Schedule for Electric Circuit Analysis:}
\begin{center}
\begin{calendar}{8/18/2014}{2} % Semester starts on 1/11/2010 and last for 16
                    % weeks, including finals week
\setlength{\calboxdepth}{.6in}
\TRClass
% schedule
\caltexton{1}{Lab briefing}
\caltextnext{2.2 Charge, Current, Voltage, and Power\\
2.3 Voltage and Current Sources\\
2.4 Ohm's Law}

\end{calendar}
\end{center}
\end{document}

output of code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.