4

I would like to include a pentagon symbol with the letter "S" inside the Leftrightarrow between the two mappings in line 1 and 2 - means as a description in tikzcd.

enter image description here

I have included

\documentclass [a4paper,german,twoside,openright,11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage[ngerman]{babel}
\usepackage{hyphenat}
\hyphenation{Mathe-matik wieder-gewinnen}
%----------------------------------------------------------------
\usepackage{lipsum}
\usepackage[pdftex]{graphicx} % Einbindung von Grafiken (pdf, png, jpg)
\usepackage{float}            % bietet Option [H] für bombenfestes Verankern
\usepackage[ngerman]{babel}   % Silbentrennung nach der neuen deutschen Rechtschreibung, z.B.: Sys-tem
\usepackage{amstext}          % für Klartext via \text{} in Formeln
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{csquotes}         % für komplexere Formeln (Mengensymbole ...)
\usepackage{amssymb}          % für komplexere Formeln (Mengensymbole ...)
\usepackage{pifont}% http://ctan.org/pkg/pifont
\usepackage{bm}               % bold math, für \bm{}
\usepackage{enumerate}        % verbessert Aufzählungen
\usepackage[bottom]{footmisc} % Fussnoten am Seitenende
\usepackage{array}            % für Tabellen: bindet tabular-Umgebung ein
\usepackage{algorithm}        % für Algorithmen
\usepackage{algorithmic}      % für Algorithmen
\usepackage{pdfpages}         % für die Einbindung kompletter pdf-*Seiten*
\usepackage[right]{eurosym}   % Eurosymbol          % farbiger Text
\usepackage[hyphens]{url}     % für \url{http://www}, Option hyp erlaubt auch Umbruch nach "-"
\usepackage{makeidx}          % Package zur Indexerstellung
\usepackage{multicol}         % zur Indexerstellung in zwei Spalten
\usepackage{wasysym}
\usepackage{fancyhdr}
\usepackage[style=authoryear-icomp, mergedate=basic]{biblatex}  \ExecuteBibliographyOptions{firstinits=true,maxnames=2}

\setlength{\bibitemsep}{10pt}
\setlength{\bibhang}{1.2cm}

\DeclareNameAlias{sortname}{last-first}

\AtBeginBibliography{%
  \renewcommand*{\multinamedelim}{\addsemicolon\space}%
  \renewcommand*{\finalnamedelim}{\addsemicolon\space}%
}

\DefineBibliographyStrings{ngerman}{%
  andothers = {et\addspace al\adddotspace},%
  andmore = {et\addspace al\adddotspace},%
}

\usepackage{xpatch}
\xpretobibmacro{author}{\mkbibbold\bgroup}{}{}
\xapptobibmacro{author}{\egroup}{}{}
\xpretobibmacro{bbx:editor}{\mkbibbold\bgroup}{}{}
\xapptobibmacro{bbx:editor}{\egroup}{}{}

\renewcommand*{\labelnamepunct}{\mkbibbold{\addcolon\space}}

\addbibresource{Dissertation.bib}  
\usepackage{nomencl}
\usepackage{longtable}
\usepackage{bussproofs}
\usepackage{stackrel}
\usepackage{wasysym}
\usepackage{epigraph}
\usepackage[linktocpage ]{hyperref}
\pagestyle{fancy}
\usepackage[toc,page]{appendix}

\usepackage{tikz}
\usepackage{tkz-euclide}
\usepackage{amsthm}
\usepackage{wrapfig}
\theoremstyle{definition}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{definition}{Definition}[section]

\renewcommand{\headrulewidth}{0.4pt} % Headerlinie setzen
\renewcommand{\footrulewidth}{0.4pt} % Footerlinie setzen
\fancyhf{}
\fancyhead[RO]{\scshape \nouppercase \rightmark}
\fancyhead[LE]{\scshape \nouppercase \leftmark}
\fancyfoot[RO,LE]{\thepage} 

\usetikzlibrary{cd, shapes.geometric}

\newcommand*\pent[1]{\tikz[baseline=(char.base)]{
            \node[shape=regular polygon,draw,inner sep=1pt] (char) {#1};}}

\setlength{\epigraphwidth}{.8\textwidth}
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{53}}%

\renewcommand{\indexname}{Personen- und Sachverzeichnis}

The code is

\begin{tikzcd}
X \arrow{r}[name=A, description]{\pi} & X/_{\sim}  \\
V \arrow{r}[name=B, description]{\pi} & V/_{\sim} \arrow[Leftrightarrow,to path=(A) -- (B)]{}
\end{tikzcd}

Any ideas?

3 Answers 3

6

As egreg noted, the problem seems to be how to draw the "S" inside a pentagon. Another solution, that is easily generalizable to other shapes is with tikz library shapes.geometric as in the following example

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{cd, shapes.geometric}

\newcommand*\pent[1]{\tikz[baseline=(char.base)]{
            \node[shape=regular polygon,draw,inner sep=1pt] (char) {#1};}}

\begin{document}

\begin{tikzcd}
X \arrow{r}[name=A, description]{\pi} & X/_{\sim}  \\
V \arrow{r}[name=B, description]{\pi} & V/_{\sim} 
\arrow[Leftrightarrow,from=A,to=B,"\pent{S}"description]
\end{tikzcd}
\end{document}
9

Similar to Luis Turcio's answer but avoiding to nest tikzpictures. You can just pass a list of options, such as the shape and so on, to the edge label.

\arrow[Leftrightarrow,from=A,to=B,
    "S"{description,regular polygon,draw=white,double=black,double distance=0.4pt,inner sep=1pt}]

enter image description here

\documentclass{article}

\usepackage{tikz}
\usetikzlibrary{cd, shapes.geometric}

\begin{document}

\begin{tikzcd}
X \arrow{r}[name=A, description]{\pi} & X/_{\sim}  \\
V \arrow{r}[name=B, description]{\pi} & V/_{\sim} 
\arrow[Leftrightarrow,from=A,to=B,
    "S"{description,regular polygon,draw=white,double=black,double distance=0.4pt,inner sep=1pt}]
\end{tikzcd}
\end{document}
5

The only problem seems to draw the pentagon with the inscribed letter.

\documentclass{article}
\usepackage{tikz-cd}
\usepackage{wasysym}

\newcommand{\Penta}[1]{%
  \mbox{%
    \vphantom{\large\pentagon}%
    \ooalign{%
      \large\pentagon\cr
      \hidewidth\raisebox{0.3ex}{$\scriptscriptstyle #1$}\hidewidth\cr}%
  }%
}

\begin{document}

\[
\begin{tikzcd}
X\arrow[r, "\pi" description, ""{name=top, below}] & X/{\sim}\\
V\arrow[r, "\pi" description, ""{name=bottom, above}] & V/{\sim}\\
\arrow[Leftrightarrow, from=top, to=bottom, "\Penta{S}" description]
\end{tikzcd}
\]

\end{document}

enter image description here

Code for the vertical arrow taken from the now deleted answer by Sandy G

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.