2

I found this great template for Cornell styled note-taking: https://tex.stackexchange.com/a/273223

Sadly, when I compile this document the left and right boxes are not top-aligned:

This shows the issue

I have looked through the documentation and mucked about in the code but I cannot find the reason why the boxes are not aligned. Can someone help me with this?

1
  • Welcome to TeX-SX! As a new member, it is recommended to visit the Welcome and the Tour pages to be informed about our format and also to know about Minimal Example. Otherwise, more specifically about your question: A MWE, showing what you have so far, will give a starting point to the other members willing to help you.
    – R. N
    Jan 26, 2021 at 14:35

1 Answer 1

0

Apparently the package tcolorbox has changed. In the answer https://tex.stackexchange.com/a/273223, add the option box align=top to the tcolorboxes containing #1 and #2, i.e., replace

\DeclareDocumentCommand\topic{ m m g g g g g}
{
\begin{tcolorbox}[sidebyside,sidebyside align=top,opacityframe=0,opacityback=0,opacitybacktitle=0, opacitytext=1,lefthand width=.3\textwidth]
\begin{tcolorbox}[colback=red!05,colframe=red!25,sidebyside align=top,width=\textwidth,before skip=0pt]
#1.\end{tcolorbox}%
\tcblower
\begin{tcolorbox}[colback=blue!05,colframe=blue!10,width=\textwidth,before skip=0pt]
#2
\end{tcolorbox}

by

\DeclareDocumentCommand\topic{ m m g g g g g}
{
\begin{tcolorbox}[sidebyside,sidebyside align=top,opacityframe=0,opacityback=0,opacitybacktitle=0, opacitytext=1,lefthand width=.3\textwidth]
\begin{tcolorbox}[colback=red!05,colframe=red!25,sidebyside align=top,width=\textwidth,box align=top,before skip=0pt]% <<< HERE
#1.\end{tcolorbox}%
\tcblower
\begin{tcolorbox}[colback=blue!05,colframe=blue!10,width=\textwidth,box align=top,before skip=0pt]% <<< HERE
#2
\end{tcolorbox}

enter image description here

\documentclass[a4paper]{article} 
\usepackage{tcolorbox}
\tcbuselibrary{skins}

\title{
\vspace{-3em}
\begin{tcolorbox}[colframe=white,opacityback=0]
\begin{tcolorbox}
\Huge\sffamily Cornell Notes on Something   
\end{tcolorbox}
\end{tcolorbox}
\vspace{-3em}
}

\date{}

\usepackage{background}
\SetBgScale{1}
\SetBgAngle{0}
\SetBgColor{red}
\SetBgContents{\rule[0em]{4pt}{\textheight}}
\SetBgHshift{-2.3cm}
\SetBgVshift{0cm}

\usepackage{lipsum}% just to generate filler text for the example
\usepackage[margin=2cm]{geometry}

\usepackage{tikzpagenodes}

\parindent=0pt

\DeclareDocumentCommand\topic{ m m g g g g g}
{
\begin{tcolorbox}[sidebyside,sidebyside align=top,opacityframe=0,opacityback=0,opacitybacktitle=0, opacitytext=1,lefthand width=.3\textwidth]
\begin{tcolorbox}[colback=red!05,colframe=red!25,sidebyside align=top,width=\textwidth,box align=top,before skip=0pt]
#1.\end{tcolorbox}%
\tcblower
\begin{tcolorbox}[colback=blue!05,colframe=blue!10,width=\textwidth,box align=top,before skip=0pt]
#2
\end{tcolorbox}
\IfNoValueF {#3}{
\begin{tcolorbox}[colback=blue!05,colframe=blue!10,width=\textwidth]
#3
\end{tcolorbox}
}
\IfNoValueF {#4}{
\begin{tcolorbox}[colback=blue!05,colframe=blue!10,width=\textwidth]
#4
\end{tcolorbox}
}
\IfNoValueF {#5}{
\begin{tcolorbox}[colback=blue!05,colframe=blue!10,width=\textwidth]
#5
\end{tcolorbox}
}
\IfNoValueF {#6}{
\begin{tcolorbox}[colback=blue!05,colframe=blue!10,width=\textwidth]
#6
\end{tcolorbox}
}
\IfNoValueF {#7}{
\begin{tcolorbox}[colback=blue!05,colframe=blue!10,width=\textwidth]
#7
\end{tcolorbox}
}
\end{tcolorbox}
}

\def\summary#1{
\begin{tikzpicture}[overlay,remember picture,inner sep=0pt, outer sep=0pt]
\node[anchor=south,yshift=-1ex] at (current page text area.south) {% 
\begin{minipage}{\textwidth}%%%%
\begin{tcolorbox}[colframe=white,opacityback=0]
\begin{tcolorbox}[enhanced,colframe=black,fonttitle=\large\bfseries\sffamily,sidebyside=true, nobeforeafter,before=\vfil,after=\vfil,colupper=black,sidebyside align=top, lefthand width=.95\textwidth,opacitybacktitle=1, opacitytext=1,
segmentation style={black!55,solid,opacity=0,line width=3pt},
title=Summary
]
#1
\end{tcolorbox}
\end{tcolorbox}
\end{minipage}
};
\end{tikzpicture}
}

\begin{document} 
\maketitle

\topic{This is a question}%
{The first piece of evidence is mandatory}%
{Now add up to five\ldots}%
{\ldots additional pieces of evidence.}

\topic{Here's another question.}{\lipsum[1]}%
{\lipsum[2]}%

\summary{This is a longer box that floats to the bottom of the page.}

\topic{Here's another question to begin the new page.}{\lipsum[3]}%
{\lipsum[4]}%
{\lipsum[5]}%

\summary{And another summary that will float to the bottom of the next page.}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .