0
\documentclass[12pt]{report}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{amsthm}
\usepackage{mathtools}
\usepackage{hyperref}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc} 
\usepackage[french]{babel}
\usepackage[utf8]{inputenc}

\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage{enumitem}
\usepackage{csquotes}
\usepackage[x11names]{xcolor}
\usepackage{framed, etoolbox}
\colorlet{framecolor}{VioletRed4}
\colorlet{shadecolor}{LavenderBlush2!60}
\usepackage{thmtools} %
\usepackage{sectsty}
\chapterfont{\color{Firebrick2}}  % sets colour of chapters
\sectionfont{\color{Chartreuse4}}
\subsectionfont{\color{blue}}
%talwin majzo2at
%\usepackage{sectsty}%
%\chapterfont{\color{Firebrick2}}
%\usepackage{titlesec}%%%%%% <---------addendum
%\titleformat{\section}%%%%%% <---------addendum
%{\color{Chartreuse4}\normalfont\Large\bfseries}%%%%%% <---------addendum
%{\color{Chartreuse4}\thesection}{1.5em}{}%%%%%% <---------addendum


%\titleformat{\subsection}%%%%%% <---------addendum
%{\color{Firebrick3}\normalfont\Large\bfseries}%%%%%% <---------addendum
%{\color{Firebrick3}\thesection}{1.5em}{}%%%%%% <---------addendum


\makeatletter
\define@key{thmdef}{frame}[{}]{%
 \thmt@trytwice{}{%
 \RequirePackage{framed}%
 \RequirePackage{thm-patch}%
    \def\FrameCommand{\fcolorbox{framecolor}{shadecolor}}
 \addtotheorempreheadhook[\thmt@envname]{%
 \begin{framed}}%
 \addtotheorempostfoothook[\thmt@envname]{\end{framed}}%
 }%
}
\makeatother




\usepackage{thmtools}
\declaretheoremstyle[
    spaceabove=-6pt, 
    spacebelow=6pt, 
    headfont=\normalfont\bfseries, 
    bodyfont = \normalfont,
    postheadspace=1em, 
    qed=$\blacksquare$, 
    headpunct={:}]{myproofstyle} %<---- change this name
\declaretheorem[name={Proof}, style=myproofstyle, unnumbered]{Proof}

\declaretheoremstyle[
    spaceabove=6pt, 
    spacebelow=6pt, 
    headfont=\normalfont\bfseries,
    notefont=\mdseries\bfseries, 
    notebraces={(}{)}, 
    bodyfont=\normalfont\itshape,
    postheadspace=1em,
    headpunct={:}]{mystyle}

    \declaretheoremstyle[
    spaceabove=6pt, 
    spacebelow=6pt, 
    headfont=\normalfont\bfseries,
    notefont=\mdseries\bfseries, 
    notebraces={(}{)}, 
    bodyfont=\normalfont,
    postheadspace=1em,
    postheadhook = {\hspace{0mm}\newline},
    headpunct={:},]{myst}

\declaretheorem[name={Théorème}, style=mystyle,numberwithin=section]{thm}
\declaretheorem[name={Lemme}, style=mystyle,numberwithin=section]{lema}
\declaretheorem[frame,name={Définition}, style=mystyle,numberwithin=section]{defi}
\declaretheorem[frame,name={Corollaire}, style=mystyle,numberwithin=section]{coro}
\declaretheorem[frame,name={Proposition}, style=mystyle,numberwithin=section]{props}
\declaretheorem[frame,name={Vocabulaire}, style=mystyle,numberwithin=section]{voc}
\declaretheorem[name={Preuve}, style=myst,numbered=no]{preuve}
\declaretheorem[name={Remarque}, style=myst,numberwithin=section]{remark}
\declaretheorem[name={Remarques}, style=mystyle,numberwithin=section]{remarks}
\declaretheorem[name={Exemple}, style=myst,numberwithin=section]{exemple}
\declaretheorem[name={Exemples}, style=myst,numberwithin=section]{exemples}
\declaretheorem[name={Méthode}, style=mystyle,numberwithin=section]{methode}
\declaretheorem[name={Méthodes}, style=mystyle,numbered=no]{methodes}
\declaretheorem[name={Notation}, style=mystyle,numbered=no]{notation}











\AtBeginEnvironment{defi}{\colorlet{framecolor}{black}
    \colorlet{shadecolor}{orange!15}}
\newcommand{\myarrow}[1][1cm]{\mathrel{%
   \hbox{\rule[\dimexpr\fontdimen22\textfont2-.2pt\relax]{#1}{.4pt}}%
   \mkern-4mu\hbox{\usefont{U}{lasy}{m}{n}\symbol{41}}}}
   \AtBeginEnvironment{voc}{\colorlet{framecolor}{black}
    \colorlet{shadecolor}{LightSkyBlue2!25}}
    \AtBeginEnvironment{props}{\colorlet{framecolor}{black}
    \colorlet{shadecolor}{Yellow1!15}}
     \AtBeginEnvironment{coro}{\colorlet{framecolor}{black}
    \colorlet{shadecolor}{Yellow1!15}}

\makeatletter

\setbox0\hbox{$\xdef\scriptratio{\strip@pt\dimexpr
    \numexpr(\sf@size*65536)/\f@size sp}$}

\newcommand{\myscriptarrow}[1][1cm]{{%
    \hbox{\rule[\scriptratio\dimexpr\fontdimen22\textfont2-.2pt\relax]
               {\scriptratio\dimexpr#1\relax}{\scriptratio\dimexpr.4pt\relax}}%
   \mkern-4mu\hbox{\let\f@size\sf@size\usefont{U}{lasy}{m}{n}\symbol{41}}}}

\makeatother
\newcommand*{\QED}{\hfill\ensuremath{\blacksquare}}%Heron
\usepackage{tikz-cd}
\begin{document}


\center{\begin{tikzcd}[row sep=5em,column sep=5em,sep=large]

A \arrow[r, "\phi"]

C \arrow[r, red, "\eta" blue]
& D
\end{tikzcd}

\end{document}
1
  • 4
    Where's the picture?
    – Bernard
    Oct 13, 2019 at 13:35

2 Answers 2

3

I suspect, that you like to draw something like this:

enter image description here

\documentclass[12pt]{report}
\usepackage[top=2cm, bottom=2cm, left=2cm, right=2cm]{geometry}
\usepackage{tikz-cd}

\begin{document}
    \begin{center}  % <---
\begin{tikzcd}[row sep=5em,column sep=5em,sep=large]
A \arrow[r, "\phi"]
    &   C \arrow[r, red, "\eta" blue] % <---
        &   D
\end{tikzcd}
    \end{center} % <---
\end{document}

Your image code have more errors: - \center{ wasnt closed by } - `\center is also unknown command - missed was one ampersand

However, it might be that I'm wrong.

Next time in question please provide a small document (MWE) which has in preamble loaded only for your problem needed packages.

1

From this answer and for the comments at this link How to color actually labels and arrows using xy/xymatrix package it is possible to reproduce the same code of best user @Zarko using also xy package. See my MWE:

enter image description here

\documentclass[a4paper,12pt]{article} 
\usepackage{xcolor} 
\usepackage[color,cmtip,all]{xy} 
\begin{document} 
\xymatrix@R+1pc@C+1pc{ A \ar[r]^{\phi}& C \ar@[red][r]^{\color{blue}\eta} & D\\ }
\end{document} 

You must log in to answer this question.

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