0

I have the next output:

Output

And I want the text to start right after the box, even if is a chapter.

I have tried \let\cleardoublepage\clearpage command but doesn't work.

Here is the MWE:

\documentclass{tufte-book}
\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}
\usepackage[left=2.50cm, right=2.50cm, top=3.00cm, bottom=2.00cm]{geometry}
\usepackage{xcolor}

\usepackage{tocloft} % added <<<<<<<<<<<<<<<<<<<<<<

 \usepackage[mathscr]{euscript}
% matemáticas:
\usepackage{amsmath, amssymb} 
\usepackage{physics}
% idioma:
\usepackage[utf8]{inputenc}
\usepackage[spanish, es-tabla]{babel} % 'cuadro' es el título del caption de table por defecto siguiendo indicaciones de RAE; es-tabla lo cambia a 'tabla'
% gestión de párrafos (hace innecesario indicar el salto de línea con doble barra y elimina el indent de todos los párrafos):
\usepackage{parskip}

\usepackage{amssymb}
\usepackage[mathscr]{eucal} 
\usepackage{amsmath}
\usepackage[all]{xy}
\usepackage{lineno} 
\usepackage{epsfig} 
\usepackage{amscd}
\usepackage{mathrsfs}
\usepackage[thinc]{esdiff} 
  
\usepackage[colorlinks=true,linkcolor=gray,citecolor=gray,urlcolor=gray,breaklinks]{hyperref} % changed <<<<<<
\usepackage[nameinlink]{cleveref} 



%%******************************************************************** Changed 
\newcommand{\CourseName}{MT2223: Real analysis-I} % fill <<<<<<<<<<<<<<<<<<<<<<<
\newcommand{\CourseSemester}{Jan-May 2022}  % fill <<<<<<<<<<<<<<<<<<<<<<<
\newcommand{\CourseInstructor}{Praphulla Koushik}    % fill <<<<<<<<<<<<<<<<<<<<<<<

\newcommand{\listlecturename}{Clases \hfill {\footnotesize Página \par}} % title of the list <<<<<<<<<<<<<<<<
\newlistof[part]{lecture}{lec}{\listlecturename} % define list of lectures

\newcounter{lecnum}
\renewcommand{\thepage}{\thelecnum-\arabic{page}}
\renewcommand{\thesection}{\thelecnum.\arabic{section}}
\renewcommand{\theequation}{\thelecnum.\arabic{equation}}
\renewcommand{\thefigure}{\thelecnum.\arabic{figure}}
\renewcommand{\thetable}{\thelecnum.\arabic{table}}
\newcommand{\lecture}[2]{% changed <<<<<<<<<<<<<<<< use as  \lecture{number}{date}
    \pagestyle{myheadings}
    \newpage
    \setcounter{lecnum}{#1}
    \setcounter{page}{1}
    \refstepcounter{lecture}
    \addcontentsline{lec}{lecture}{Clase~#1:~#2}
    \noindent
    \fbox{%
    \begin{minipage}{\dimexpr\textwidth-2\fboxsep-2\fboxrule\relax}
        \begin{fullwidth}
        \centering\vspace{2mm}
        {\bfseries\CourseName \hfill \CourseSemester
         \vspace{4mm}\\ 
         \Large \hfill  Clase #1  \hfill }
         \vspace{4mm}\\  
         {\normalfont Date: #2 \hfill  Profesor:~\CourseInstructor}
         \vspace{2mm}
         \end{fullwidth}
    \end{minipage}
    
    }



\title{Tufte book}
\author{Álvaro Méndez Rodríguez de Tembleque}

\date{\today}

\begin{document}

\maketitle
\listoflecture 
\tableofcontents
\lecture{1}{Enero 30}

\chapter{Hola}



\end{document}
6
  • 3
    Hi, sorry, but this is not a MWE: we should be able to compile it, and here there is no documentclass, no packages...
    – Rmano
    Jan 28 at 19:17
  • @Rmano Sorry, I have changed Jan 29 at 10:25
  • 1
    Still wrong, sorry. Did you test it? Why two blocks? Please change your question with a single piece of code that we can copy, paste and compile. I have a Runaway argument? {\pagestyle {myheadings} ... error; after that, all bets are off. Please dedicate a bit of your time to preparing a viable example, so we can spend a bit of our time in finding the problem. Thanks!
    – Rmano
    Jan 29 at 10:38
  • Now you have everything I hope Jan 29 at 11:08
  • 1
    @alvaritomendez There are some \newcommand and some packages that aren't used. Also your example won't give the blank page you mentioned. MWE means minimal (avoid irrelevant stuffs) and should also help to reproduce the problem.
    – gildux
    Jan 29 at 12:36

1 Answer 1

1

After:

  1. removing all the clashing packages (I did not look why and where they clashed; you should have take care of that when adding the package); they are
    • geometry
    • eucal
    • xcolor
    • hyperref The thing compiled.

Then,

  1. removing the extra spaces at the end of the line in the command \lecture
  2. adding openany option to the class

Now the extra page is gone.

Notice that I do not advise using this as-is. Remove all packages and add them only when you need them, and find why someone clashes (probably tufte-book has already loaded most of them). For example, the last time epsfig was needed I think was around 1985. A rule of thumb is that you should exactly know why you load any package.

enter image description here

Minimally patched code here:

\documentclass[openany]{tufte-book}
\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}
% \usepackage[left=2.50cm, right=2.50cm, top=3.00cm, bottom=2.00cm]{geometry}
% \usepackage{xcolor}

\usepackage{tocloft} % added <<<<<<<<<<<<<<<<<<<<<<

 \usepackage[mathscr]{euscript}
% matemáticas:
\usepackage{amsmath, amssymb}
\usepackage{physics}
% idioma:
\usepackage[utf8]{inputenc}
\usepackage[spanish, es-tabla]{babel} % 'cuadro' es el título del caption de table por defecto siguiendo indicaciones de RAE; es-tabla lo cambia a 'tabla'
% gestión de párrafos (hace innecesario indicar el salto de línea con doble barra y elimina el indent de todos los párrafos):
\usepackage{parskip}

\usepackage{amssymb}
% \usepackage[mathscr]{eucal}
\usepackage{amsmath}
\usepackage[all]{xy}
\usepackage{lineno}
\usepackage{epsfig}
\usepackage{amscd}
\usepackage{mathrsfs}
\usepackage[thinc]{esdiff}

% \usepackage[colorlinks=true,linkcolor=gray,citecolor=gray,urlcolor=gray,breaklinks]{hyperref} % changed <<<<<<
\usepackage[nameinlink]{cleveref}



%%******************************************************************** Changed
\newcommand{\CourseName}{MT2223: Real analysis-I} % fill <<<<<<<<<<<<<<<<<<<<<<<
\newcommand{\CourseSemester}{Jan-May 2022}  % fill <<<<<<<<<<<<<<<<<<<<<<<
\newcommand{\CourseInstructor}{Praphulla Koushik}    % fill <<<<<<<<<<<<<<<<<<<<<<<

\newcommand{\listlecturename}{Clases \hfill {\footnotesize Página \par}} % title of the list <<<<<<<<<<<<<<<<
\newlistof[part]{lecture}{lec}{\listlecturename} % define list of lectures

\newcounter{lecnum}
\renewcommand{\thepage}{\thelecnum-\arabic{page}}
\renewcommand{\thesection}{\thelecnum.\arabic{section}}
\renewcommand{\theequation}{\thelecnum.\arabic{equation}}
\renewcommand{\thefigure}{\thelecnum.\arabic{figure}}
\renewcommand{\thetable}{\thelecnum.\arabic{table}}
\newcommand{\lecture}[2]{% changed <<<<<<<<<<<<<<<< use as  \lecture{number}{date}
    \pagestyle{myheadings}%
    \newpage
    \setcounter{lecnum}{#1}%
    \setcounter{page}{1}%
    \refstepcounter{lecture}%
    \addcontentsline{lec}{lecture}{Clase~#1:~#2}%
    \noindent
    \fbox{%
    \begin{minipage}{\dimexpr\textwidth-2\fboxsep-2\fboxrule\relax}
        \begin{fullwidth}%
        \centering\vspace{2mm}
        {\bfseries\CourseName \hfill \CourseSemester
         \vspace{4mm}\\
         \Large \hfill  Clase #1  \hfill }
         \vspace{4mm}\\
         {\normalfont Date: #2 \hfill  Profesor:~\CourseInstructor}
         \vspace{2mm}
         \end{fullwidth}%
    \end{minipage}%
    \par
}}



\title{Tufte book}
\author{Álvaro Méndez Rodríguez de Tembleque}

\date{\today}

\begin{document}

\maketitle
\listoflecture
\tableofcontents
\lecture{1}{Enero 30}

\chapter{Hola}



\end{document}
2
  • This one is great but I want the text to start as the lecture box is finished, right under there. I will make that adjustment but thanks for the awnser Jan 30 at 6:43
  • @alvaritomendez I do not know the details of the tufte-book class. Normally any class has chapters starting a new page. Often when somebody wants chapters "inline" it means that it should not use chapters; maybe a class with just sections will do. Otherwise, you can check the titlesec package but I do not know if it's compatible with tufte or the strange mix of packages you are loading.
    – Rmano
    Jan 30 at 8:56

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.