0

Please the below code work perfectly in article latex class, but when i try to put it in IAStheme of beamer the labels are strange.

The code

    \documentclass[11pt]{beamer}

\usepackage[english,french]{babel}
% or whatever
\usepackage[utf8]{inputenc}
% or whatever

\usepackage{graphicx}
\usepackage{pgf}
\usepackage{pifont}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{xcolor}
\usepackage{colortbl}
\usepackage{tikz}
\usepackage{tkz-graph}
\setbeamertemplate{itemize item}[triangle]
\usetikzlibrary{shapes,topaths,fit,arrows.meta,backgrounds,calc,trees,hobby}
\usetikzlibrary{graphs,graphs.standard}
%\title[Identification In Digraph] % (optional, use only with long paper titles)

\definecolor{myblue}{RGB}{122,163,204}
\begin{document}

\begin{frame}
 \frametitle{Locally transitive}

    \begin{tikzpicture}[scale=0.8]
      \SetGraphUnit{2}
      \renewcommand*{\VertexLineColor}{black}
      \renewcommand*{\VertexLightFillColor}{white}
      \renewcommand*{\VertexSmallMinSize}{6pt}
      \renewcommand*{\VertexLineWidth}{1pt}
      %\SetVertexNoLabel
      \GraphInit[vstyle=Welsh]
      \Vertices{circle}{1,2,3,4,5,6,7} % the ... syntax doesn't work here
      \AddVertexColor{myblue}{1,5}

      \SetUpEdge[style={->,thick},color=black]
      \foreach \i in {1,...,7}
      { 
        \foreach
        [evaluate=\j as \k using {ifthenelse(Mod(\i+\j,7)==0,int(\i+\j),int(Mod(\i+\j,7)))}]
        \j in {1,2,3}
        { 
        \Edge(\i)(\k)
          }
        }

    \end{tikzpicture}
\end{frame}
\end{document}

it gives me enter image description here

I don't know how to set the correcte label (ie 1 2 ... 7)

  • your MWE can not be compiled since it use specific styles. Please remove from your document all what is not necessary to show your problem and leave just one frame with your image and public available beamer styles. – Zarko May 26 '17 at 21:32
  • 1
    @HTeX Can you show an example of how this works in article class? If I remove everything beamer specific and try with article, I get exactly the same result. – user36296 May 26 '17 at 21:34
  • @samcarter the example with article class is given below: – HTeX May 26 '17 at 22:15
2

Try to compile without babel:

\documentclass[11pt]{beamer}

%\usepackage[english,french]{babel}
% or whatever
\usepackage[utf8]{inputenc}
% or whatever

%\usepackage{graphicx}
\usepackage{pgf}
\usepackage{pifont}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
%\usepackage{xcolor}
\usepackage{colortbl}
\usepackage{tikz}
\usepackage{tkz-graph}
\setbeamertemplate{itemize item}[triangle]
\usetikzlibrary{shapes,topaths,fit,arrows.meta,backgrounds,calc,trees,hobby}
\usetikzlibrary{graphs,graphs.standard}
%\title[Identification In Digraph] % (optional, use only with long paper titles)

\definecolor{myblue}{RGB}{122,163,204}
\begin{document}

\begin{frame}
 \frametitle{Locally transitive}

    \begin{tikzpicture}[scale=0.8]
      \SetGraphUnit{2}
      \renewcommand*{\VertexLineColor}{black}
      \renewcommand*{\VertexLightFillColor}{white}
      \renewcommand*{\VertexSmallMinSize}{6pt}
      \renewcommand*{\VertexLineWidth}{1pt}
      %\SetVertexNoLabel
      \GraphInit[vstyle=Welsh]
      \Vertices{circle}{1,2,3,4,5,6,7} % the ... syntax doesn't work here
      \AddVertexColor{myblue}{1,5}

      \SetUpEdge[style={->,thick},color=black]
      \foreach \i in {1,...,7}
      { 
        \foreach
        [evaluate=\j as \k using {ifthenelse(Mod(\i+\j,7)==0,int(\i+\j),int(Mod(\i+\j,7)))}]
        \j in {1,2,3}
        { 
        \Edge(\i)(\k)
          }
        }

    \end{tikzpicture}
\end{frame}
\end{document}

enter image description here

  • +1 @samcarter, it's exactly what i want. have a good night. – HTeX May 26 '17 at 23:31
  • you find the cause +1! – Zarko May 26 '17 at 23:32
2

Edit: samcarter found the cause of your problem: package babel. To be more specific, the cause is french option at its use. It overwrite some tikz code. For cure of this problem is overcome this problem (for most non-English babel options) is defined tikzlibrarybabel`. Just add it to used libraries and problem will be solved:

\documentclass{beamer}
\usepackage[english,french]{babel}% <-- this MWE also work with babel

\usepackage{tkz-graph}
\usetikzlibrary{arrows.meta, babel}% <-- added babel library

\usepackage{pifont}
\usepackage{amsmath, amssymb, amsthm}
\usepackage{caption}

\begin{document}
\begin{frame}
\small
    \begin{columns}
\begin{column}{0.45\linewidth}
    \[
\forall~v\in V(T),~deg^-(v)=deg^+(v)
\]
\end{column}
\begin{column}{0.55\linewidth}
    \begin{tikzpicture}
    \SetGraphUnit{2}
    \renewcommand*{\VertexLineColor}{white}
    \renewcommand*{\VertexLightFillColor}{red}
    \renewcommand*{\VertexLineWidth}{1pt}
    \GraphInit[vstyle=Welsh]
    \Vertices{circle}{1,2,3,4,5,6}
    \AddVertexColor{blue}{5,1}
    \SetUpEdge[style={-{Straight Barb[length=1mm,width=1.2mm]}, thick},color=red]
     \foreach \v [count=\vi from 2] in {1,...,5}{
     \foreach \vv in {\vi,...,6}{\Edge(\v)(\vv)};
     };
    \end{tikzpicture}
\end{column}
    \end{columns}
\end{frame}
\end{document}

enter image description here

Note: don't load package which are already loaded by beamer (look in beamer documentation for details). Make preamble minimalistic as possible. Use LaTeX syntax for equations.

I cant test above MWE with your preamble since specific beamer theme is not (public) available.

  • Hi @Zarko, yes in simple beamer class work perfectly, unfortunatly the wrong label appear in IAS theme. I look for how i can add manualy a label to each vertex and keeping the commande \SetVertexNoLabel to hide the wrong one. This theme is available at fransoliehoek.net/index.php?fuseaction=var.beamer – HTeX May 26 '17 at 22:10
  • @HTeX, than please make this theme somewhere available. – Zarko May 26 '17 at 22:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.