-
Notifications
You must be signed in to change notification settings - Fork 1
/
appunti_print_a4_hor.tex
54 lines (45 loc) · 1.69 KB
/
appunti_print_a4_hor.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
%!TEX encoding = UTF-8 Unicode
\documentclass[a4paper,twocolumn,landscape,openany,twoside,fleqn]{book}
\usepackage[inner=2.5cm,textwidth=718pt,columnsep=28pt,top=2cm,bottom=1cm]{geometry}
\setlength{\headsep}{1.5em}
\usepackage[font={sf}]{caption}
\usepackage{etoolbox} % \patchcmd
\usepackage{collect}
\usepackage{ifthen} % \ifthenelse
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\let\oldmarginpar\marginpar
\renewcommand\marginpar[1]{\oldmarginpar{}}
\patchcmd{\chapter}{plain}{fancy}{}{}
\patchcmd{\tableofcontents}{onecolumn}{twocolumn}{}{}
% --- LESSON MARK ---
\newcounter{thislessonpage}
\newcounter{lastlessonpage}
\newenvironment{lesson}[4]{%
\setcounter{thislessonpage}{\value{page}}%
\DTMsavenoparsedate{thislessondate}{#1}{#2}{#3}{-1}%
\DTMmakeglobal{thislessondate}%
}
{%
\setcounter{lastlessonpage}{\value{page}}%
\DTMsavenoparsedate{lastlessondate}{\DTMfetchyear{thislessondate}}{\DTMfetchmonth{thislessondate}}{\DTMfetchday{thislessondate}}{-1}%
\DTMmakeglobal{lastlessondate}%
}
\newcommand*\headcmacro{%
\ifthenelse { \value{lastlessonpage} = \value{page} \and \value{thislessonpage} = \value{lastlessonpage}}
{Lezioni \DTMusedate{lastlessondate}, \DTMusedate{thislessondate}}
{Lezione \DTMusedate{thislessondate}}%
}
% -------------------
% --- SOLUTIONS ---
\definecollection{solfile}
\newcommand\mycollect[1]{\collect{solfile}{\subsection*{Soluzione esercizio #1}}{}}
\newenvironment{solution} % solution to be put in the "solutions" chapter
{\begingroup\edef\x{\endgroup\noexpand\mycollect{\theexercise}}\x}%
{\endcollect}
\newcommand\solutions{%
\renewcommand*\headcmacro{}
\appendix\chapter{Soluzioni degli esercizi}
\includecollection{solfile}}
% -----------------
\input{appunti_core.tex}