LaTeX-Dokumentkopf

LaTeX-Dokumentkopf

Ich versuche, diese Vorlage für ein Physik-Unterrichtsblatt zu reproduzieren, kann aber die Kopfzeile nicht einfügen, die Folgendes enthält: „Prof: ; Vecteurs et Translation ; Année“

Bildbeschreibung hier eingeben

Folgendes habe ich versucht:

\documentclass[french,10pt,a4paper,landscape]{article}
\usepackage[T1]{fontenc}
\usepackage[left=1cm, right=1cm, top=1cm, bottom=1cm]{geometry}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{xcolor}
\usepackage{nameref}
\usepackage{babel}
\usepackage{hyperref}
\usepackage{multicol}
\usepackage{tikz}
\begin{document}
\begin{multicols*}{2}
\section{Les Vecteurs}
    
\subsection{Caractéristiques d'un vecteur}
\begin{minipage}{7cm}
    
    $\overrightarrow{AB}$ \text{ est un vecteur : } 
    
    
    $
    \begin{cases}
        \star ~ \textbf{Direction : } \text{ droite } (AB) \\
        \star ~ \textbf{Sens : } \text{ sens de la droite } (AB) \text{ de } A \text{ vers } B \\
        \star ~ \textbf{Norme (module) : } \text{ longueur } AB
    \end{cases}
    $
\end{minipage}
\begin{minipage}{3cm}
    \begin{center}
        \definecolor{ududff}{rgb}{0.30196078431372547,0.30196078431372547,1}
        \begin{tikzpicture}[scale=0.5,>=stealth]
            %   \clip(-2,-1) rectangle (4,3);
            \draw [->,line width=1.5pt] (0,0) -- (3,2);
            \draw[color=red] (-1.4,0.6) node[anchor=north west,scale=0.6] {Origine};
            \draw[color=blue] (0.9,2.5) node[anchor=north west,scale=0.6] {Extrémité};
            \begin{scriptsize}
                \draw [fill=red] (0,0) circle (1.5pt);
                \draw [fill=blue] (3,2) circle (1.5pt);
                \draw[color=blue] (3.2,2.3) node {$B$};
                \draw[color=red] (0,-0.25) node {$A$};
            \end{scriptsize}
        \end{tikzpicture}
    \end{center}
\end{minipage}
\end{multicols*}
\end{document}

Dies ist das Ergebnis:

Bildbeschreibung hier eingeben

Auch die Seitennummerierung wird nicht richtig angezeigt.

Antwort1

Sie können fancyhdrdie Überschriften und Fußzeilen konfigurieren und das Paket verwenden geometry, um die Abstände zwischen Fußzeilen und Kopfzeilen richtig einzurichten

\documentclass[french,10pt,a4paper,landscape]{article}
\usepackage[T1]{fontenc}
\usepackage[left=1cm, right=1cm, top=1cm, bottom=1cm,footskip=3pt,headsep=12pt,headheight=0.7cm]{geometry}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{xcolor}
\usepackage{nameref}
\usepackage{babel}
\usepackage{hyperref}
\usepackage{multicol}
\usepackage{tikz}
\usepackage{fancyhdr}
    \fancyhf{}
    \renewcommand{\headrulewidth}{0.2pt}
    \fancyhead[L]{Prof:}
    \fancyhead[C]{Vecteurs et Translation}
    \fancyhead[R]{Année}
    \fancyfoot[R]{\thepage}
\begin{document}
    \pagestyle{fancy}
    \begin{multicols*}{2}
        \section{Les Vecteurs}
        
        \subsection{Caractéristiques d'un vecteur}
        \begin{minipage}{7cm}
            
            $\overrightarrow{AB}$ \text{ est un vecteur : } 
            
            
            $
            \begin{cases}
                \star ~ \textbf{Direction : } \text{ droite } (AB) \\
                \star ~ \textbf{Sens : } \text{ sens de la droite } (AB) \text{ de } A \text{ vers } B \\
                \star ~ \textbf{Norme (module) : } \text{ longueur } AB
            \end{cases}
            $
        \end{minipage}
        \begin{minipage}{3cm}
            \begin{center}
                \definecolor{ududff}{rgb}{0.30196078431372547,0.30196078431372547,1}
                \begin{tikzpicture}[scale=0.5,>=stealth]
                    %   \clip(-2,-1) rectangle (4,3);
                    \draw [->,line width=1.5pt] (0,0) -- (3,2);
                    \draw[color=red] (-1.4,0.6) node[anchor=north west,scale=0.6] {Origine};
                    \draw[color=blue] (0.9,2.5) node[anchor=north west,scale=0.6] {Extrémité};
                    \begin{scriptsize}
                        \draw [fill=red] (0,0) circle (1.5pt);
                        \draw [fill=blue] (3,2) circle (1.5pt);
                        \draw[color=blue] (3.2,2.3) node {$B$};
                        \draw[color=red] (0,-0.25) node {$A$};
                    \end{scriptsize}
                \end{tikzpicture}
            \end{center}
        \end{minipage}
    \end{multicols*}
\end{document}

Bildbeschreibung hier eingeben

Antwort2

Wahrscheinlich die PaketeAbonnierenUndAbonnierensind Ihre Freunde und wahrscheinlich sind Sie interessiert anTikZ'SPositionierungBibliothek:

\documentclass[french,10pt,a4paper,landscape]{article}
\usepackage[T1]{fontenc}

\usepackage{fancyhdr}
\usepackage[x11names, svgnames, dvipsnames]{xcolor}
\usepackage[many]{tcolorbox}

\newbox\scratchboxA
\newbox\scratchboxB
\setbox\scratchboxA\hbox{Prof Vecteurs et Translation Année}%
\setbox\scratchboxB\hbox{0123456789}%
\usepackage[left=1cm, right=1cm, top=1cm, bottom=1cm, 
            headheight=.5\dimexpr(1cm+\ht\scratchboxA+\dp\scratchboxA+\headrulewidth+\headruleskip)\relax, 
            headsep=.5\dimexpr(1cm-\ht\scratchboxA-\dp\scratchboxA-\headrulewidth-\headruleskip)\relax, 
            footskip=.5\dimexpr(1cm+\ht\scratchboxB+\dp\scratchboxB)\relax]{geometry}
%In case of footrules with \footskip take  \footrulewidth / \footruleskip into account.
%---------------------------
\fancyhead[L]{Prof}
\fancyhead[C]{Vecteurs et Translation}
\fancyhead[R]{Année}
\fancyfoot[C]{\thepage}
\fancyfoot[L,R]{}
% if twoside:
% \fancyhead[EL, OL]{Prof}
% \fancyhead[EC, OC]{Vecteurs et Translation}
% \fancyhead[ER, OR]{Année}
% \fancyfoot[EC, OC]{\thepage}
% \fancyfoot[EL, ER, OL, OR]{}
%---------------------------
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{xcolor}
\usepackage{nameref}
\usepackage{babel}
\usepackage{hyperref}
\usepackage{multicol}
\usepackage{tikz}
\usetikzlibrary{positioning}

\newlength\scratchlength

\pagestyle{fancy}

\usepackage{lipsum}

\begin{document}

\columnsep=1cm
\begin{multicols*}{2}
\section{Les Vecteurs}
\subsection{Caractéristiques d'un vecteur}
\noindent
\begin{tcolorbox}[%
  width=\linewidth, 
  colback=white, 
  colframe=red,
  fonttitle=\bfseries,
  enhanced,
  attach boxed title to top center={yshift=-.5\dimexpr\ht\strutbox+\dp\strutbox+2\fboxsep\relax},
  coltitle=FireBrick,
  boxed title style={colback=red!5!white, colframe=red!5!white},
  title=Définition 1,
]
\begin{minipage}[c]{\dimexpr(\tcbtextwidth -2.9cm)\relax}%
    % The \hrules make aligning minipages [t] or [b] or [c] easier.
    \hrule height 0pt
    $\overrightarrow{AB}$  est un vecteur : %
    $
    \begin{cases}
        \star ~ \textbf{Direction : } \text{ droite } (AB) \\
        \star ~ \textbf{Sens : } \vtop{\hbox{$\text{sens de la droite }(AB)\text{ de }A$\strut}\hbox{$\text{vers } B$\strut}}\\
        \star ~ \textbf{Norme (module) : } \text{ longueur } AB
    \end{cases}
    $%
    \hrule height 0pt
\end{minipage}%%%% no breapoint between minipages!
\begin{minipage}[c]{2.9cm}%
    \hrule height 0pt
    \begin{flushright}%
        \scratchlength=-2\dimexpr\pgfkeysvalueof{/pgf/inner xsep}+\pgfkeysvalueof{/pgf/outer xsep}\relax
        \edef\myleftshift{\the\numexpr\scratchlength\relax sp}%
        \begin{tikzpicture}[scale=0.5,>=stealth, node distance=0 and 0]
            % Thickness of lines with TikZ is:
            % 
            % /tikz/ultra thin   -   Sets the line width to 0.1pt = 0.03514598 mm.
            % /tikz/very thin    -   Sets the line width to 0.2pt = 0.07029196 mm.
            % /tikz/thin         -   Sets the line width to 0.4pt = 0.14058392 mm.
            % /tikz/semithick    -   Sets the line width to 0.6pt = 0.21087588 mm.
            % /tikz/thick        -   Sets the line width to 0.8pt = 0.28116784 mm.
            % /tikz/very thick   -   Sets the line width to 1.2pt = 0.42175176 mm.
            % /tikz/ultra thick  -   Sets the line width to 1.6pt = 0.56233568 mm.
            \draw [thin, fill=red] (0,0) node[anchor=north, red] (A) {$A$} circle (3.2pt);
            \draw [thin, fill=blue] (2.5,1.75) node[anchor=south, blue] (B) {$B$} circle (3.2pt);
            \draw [->,ultra thick] (A.north) -- (B.south);
            \node[left=\myleftshift of A.south west, anchor=south east, red] {\footnotesize Origine\! \null};
            \node[left=\myleftshift of B.north west, anchor=north east, blue] {\footnotesize Extrémité\! \null};
        \end{tikzpicture}%
    \end{flushright}%
    \unskip
    \hrule height 0pt
\end{minipage}
\end{tcolorbox}

\lipsum[1-10]

\end{multicols*}
\end{document}

Bildbeschreibung hier eingeben

verwandte Informationen