1

I have the following LaTeX code:

\tikzcdset{every label/.append style={font=\normalfont\scriptsize}}

$$ \begin{tikzcd} G\arrow[r, "\alpha"] \arrow[d, "{onto}"] & G'\ G/N\arrow[r, "\cong"] & I \arrow[u, "{inj.}"']\ \end{tikzcd}. $$

This gives me this:

enter image description here

All I want to do is make the labels "onto" and "inj." in text font, not math font. That is, I want the tags not italicized.

Sigur
  • 37,330

2 Answers2

1

Here there is a MWE. From by comment of the very nice user @Sigur ...using \textup{} as alternative...and never to use double dollar $$...$$ in LaTeX: Why is \[ ... \] preferable to $$ ... $$?

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage{tikz-cd}

\begin{document} \tikzcdset{every label/.append style={font=\normalfont\scriptsize}} [\begin{tikzcd} G\arrow[r, "\alpha"] \arrow[d, "\textup{onto}"] & G'\ G/N\arrow[r, "\cong"] & I \arrow[u, "\textup{inj.}"'] \end{tikzcd}.] \end{document}

enter image description here

Sebastiano
  • 54,118
1

Commutative are always in math environment, so if you like to have sin it some normal text, you should use \text command (as mentioned @Sigur in his comment) provided by amsmath package:

\documentclass[margin=3mm, varwidth]{standalone}
\usepackage{amsmath}
\usepackage{tikz-cd}

\begin{document} [ \begin{tikzcd} G\arrow[r, "\alpha"] \arrow[d, "\text{onto}"] & G'\ G/N\arrow[r, "\cong"] & I \arrow[u, "\text{inj.}"']\ \end{tikzcd} ] \end{document}

Please observe of use \[ and \] instead $$, which are TeX command, not LaTeX.

enter image description here

Zarko
  • 296,517