0

Using tikzcd I have the problem that, when inserting diagrams in a text part, like:

Blah Blah Blah [tikz diagram] blah 

Then it will end to be graphically shifted upon a little bit, like in these examples:

enter image description here enter image description here

Is there a way to fix centering the diagram?

Here the options that I am using for the document

\documentclass[9pt,a4paper]{article}
\usepackage[margin=1.0cm]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{setspace}
\renewcommand{\baselinestretch}{1.5} 
\usepackage{graphicx}
\usepackage{lmodern}
\usepackage{tikz-cd}
\usetikzlibrary{3d,calc}
\usetikzlibrary{calc}

And Here the code of the first diagram:

\begin{tikzcd} 
\mathcal{R} \ar[r,shift left, "s" above]
            \ar[r,shift right,"t" below]
   & X \\
\end{tikzcd}
  • Welcome to TeX.SE! Why you think that giving separate document preamble and document content is better suited than one document which we can copy and compile? Please merge them into one file ... – Zarko Apr 18 '17 at 21:59
1

Just remove the final \\ which has nothing to do here:

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

\usetikzlibrary{3d,calc}
\usetikzlibrary{calc}


\begin{document}

And Here the code of the first diagram:
\begin{tikzcd}
\mathcal{R} \ar[r,shift left, "s" above]
            \ar[r,shift right,"t" below]
   & X
\end{tikzcd}%

\end{document} 

enter image description here

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.