0

I would like to align everything to top, but it seems like LaTeX is automatically aligning to center in order to occupy all the column space.

\documentclass[a4paper, 8pt, landscape, parindent=0pt, parskip=0pt]{extarticle}
\usepackage[utf8]{inputenc}
\usepackage{mathptmx} % more compact font
\usepackage[framemethod=TikZ]{mdframed}
\usepackage{amsmath,amssymb,amsthm,amsfonts}
\usepackage{mathtools}
\usepackage{awesomebox}
\usepackage{subfig}
\usepackage{multicol}
\usepackage{tabularx}
\usepackage{parskip}
\usepackage{array}
\usepackage{float}
\usepackage{graphicx}
\usepackage{paralist} % for compacter lists
\usepackage{hyperref} % for Todo's and similar things
\usepackage[left=4.5mm, right=4.5mm, top=4.5mm, bottom=6mm, landscape, nohead, nofoot]{geometry}
\usepackage[small,compact]{titlesec}
\usepackage{xparse}
\usepackage[listings,breakable,skins,most]{tcolorbox}

\tcbset{before upper={\parindent0em}}
\newtcolorbox{theorem}[1]{colback=red!5!white,colframe=red!75!black,fonttitle=\bfseries,title=#1,breakable,enhanced jigsaw,before=\smallskip\noindent,after=\smallskip\noindent,top=0pt, bottom=0pt}
\newtcolorbox{criterio}[1]{colback=blue!5!white,colframe=blue!75!black,fonttitle=\bfseries,title=#1,breakable,enhanced jigsaw,before=\smallskip\noindent,after=\smallskip\noindent,top=0pt, bottom=0pt}
\newtcolorbox{practical}[1]{colback=green!5!white,colframe=green!75!black,fonttitle=\bfseries,title=#1,breakable,enhanced jigsaw,before=\smallskip\noindent,after=\smallskip\noindent,top=0pt, bottom=0pt}

\newcommand*{\defeq}{\stackrel{\text{def}}{=}}

\newtcbtheorem[number within=chapter]{Theorem}{}{
        enhanced,
        sharp corners,
        attach boxed title to top left={
            xshift=-1mm,
            yshift=-5mm,
            yshifttext=-1mm
        },
        left = 0pt,
        right = 0pt,
        top=1.5em,
        halign=center,
        valign=center,
        colback=white,
        colframe=blue!75!black,
        fonttitle=\bfseries,
        boxed title style={
            sharp corners,
            size=small,
            colback=blue!75!black,
            colframe=blue!75!black,
        } 
    }{thm}

\newenvironment{myTheorem}[2]{ \begin{Theorem}[adjusted title=#1]{}{#2} 
  \textbf{Theorem \thetcbcounter.} }{\end{Theorem}}


% compact text
\linespread{0.9}
\setlength{\parindent}{0pt}

% compact lists even more
\setdefaultleftmargin{0em}{0em}{0em}{0em}{0em}{0em}

% compact sections
\titlespacing*{\section}{0pt}{0em}{0em}
\titlespacing*{\subsection}{0pt}{0em}{0em}
\titlespacing*{\subsubsection}{0pt}{0em}{0em}

% coloured section headings for easier read
\titleformat{name=\section}[block]
  {\sffamily}
  {}
  {0pt}
  {\colorsection}
\newcommand{\colorsection}[1]{%
    \colorbox{red!10}{\parbox[t][0em]{\dimexpr\columnwidth-2\fboxsep}{\thesection\ #1}}}


\titleformat{name=\subsection}[block]
  {\sffamily}
  {}
  {0pt}
  {\subcolorsection}
\newcommand{\subcolorsection}[1]{%
    \colorbox{orange!10}{\parbox[t][0em]{\dimexpr\columnwidth-2\fboxsep}{\thesubsection\ #1}}}


\titleformat{name=\subsubsection}[block]
  {\sffamily}
  {}
  {0pt}
  {\subsubcolorsection}
\newcommand{\subsubcolorsection}[1]{%
    \colorbox{blue!10}{\parbox[t][0em]{\dimexpr\columnwidth-2\fboxsep}{\thesubsubsection\ #1}}}

% environment for multicols inside a list
\NewDocumentEnvironment{listcols}{O{2} O{0pt}}
    {%
        \bgroup %
        \setlength{\multicolsep}{#2} %
        \begin{multicols*}{#1} %
    }
    {%
        \end{multicols*} %
        \egroup %
    }

% multicols lines & spacing
\setlength{\columnsep}{0.2cm}
\setlength{\columnseprule}{0.2pt}

% No page numbers
\pagenumbering{gobble}

% math helpers
\DeclareMathOperator*{\argmin}{arg\,min}
\DeclareMathOperator*{\argmax}{arg\,max}

\begin{document}
\begin{multicols*}{3}

% Chapter 1 
\section{Basis knowledge}
\textbf{Densità}$=\frac{massa}{volume}$\\
\textbf{Nozione in relazione ad espressioni che variano in base ad un parametro:} \label{var} Se abbiamo un'espressione $A$ che varia in base ad un parametro $\delta$, e dobbiamo un'equazione $B$ in funzione di $A$, dobbiamo considerare l'elemento infinitesimo di $A$ e l'elemento infinitesimo di $B$ per poi integrare $B$ dal parametro $\delta$ di partenza al parametro $\delta '$ di arrivo. e.g. materiale non omogeneo di massa definita secondo una legge...

\begin{myTheorem}{Fermats Last Theorem}{thm:FermatsLastTheorem}
Strategia 1: II Legge di Newton = Schema delle forze. Si può uguagliare $(F=m\cdot a)=$ schema delle forze applicate su un corpo.
\end{myTheorem}

some text

% Chapter 2
\columnbreak
\section{Calcolo vettoriale ed analisi dimensionale}
\columnbreak

...


\raggedcolumns
\end{multicols*}
\end{document}
Kevin
  • 121
  • I get errors when trying to compile your document, could you make it minimal in order to simplify the indentification of the issue ? What happens when you run pdflatex yourdoc.tex in a terminal ? – BambOo Jul 31 '19 at 15:38
  • I don't get any kind of errors, it just compiles successfully. The thing that I noticed is that if I run the code above the problem mentioned earlier doesn't appear. It appears only then I add other content. I'm going to check the code once again. – Kevin Jul 31 '19 at 15:42
  • Did you try \vfill after your myTheorem environment ? – BambOo Jul 31 '19 at 15:43
  • 1
    I can not reproduce the same output here with texlive19. It works pretty good and the block is above. – Sigur Jul 31 '19 at 15:50
  • @Sigur, can you check the full code? Thanks. https://anotepad.com/notes/ti9d9p – Kevin Jul 31 '19 at 15:52
  • Off topic: $\textbf{Densità}=\frac{\text{massa}}{\text{volume}}$ – Sigur Jul 31 '19 at 15:52
  • @BambOo, can you check the full code? Thanks. http://anotepad.com/notes/ti9d9p – Kevin Jul 31 '19 at 15:55
  • That place it not good to paste code. It is difficulty to copy it with break lines. pastebin is better – Sigur Jul 31 '19 at 15:55
  • @Sigur Updated: https://pastebin.com/raw/xDzwZKRk. There might be some design flaws in the document, but that's not important for now, thanks. – Kevin Jul 31 '19 at 15:59
  • 1
    @Kevin, it is impossible to fix your code, since it contains a lot of images, which could change the output. Also, the text is very long and I almost sure that a better formatting in 3 columns would be impossible. – Sigur Jul 31 '19 at 16:05
  • if you plan to produce a poster, there are many other better methods. – Sigur Jul 31 '19 at 16:05
  • @Sigur I see, thank you anyway. Since I'm fairly new to Tex, where can I find really good quality templates apart from Overleaf? – Kevin Jul 31 '19 at 16:06
  • @Kevin, maybe here: https://tex.stackexchange.com/q/341/14757 – Sigur Jul 31 '19 at 16:09
  • Try specifying \raggedbottom. (I'm not familiar with \raggedcolumns, but I think that's what you mean.) – barbara beeton Aug 01 '19 at 00:16

0 Answers0