2

I have a problem with tikz and springer template. Even with a simple code, rectangles and lines do not appear on pdf document. I can see that the node is on pdf but without rounding rectangle only the text. I don't know what's happening. I put the code part that I think is important here.

\RequirePackage{fix-cm}
\let\accentvec\vec

\documentclass[twocolumn]{svjour3}          % twocolumn

\smartqed  % flush right qed marks, e.g. at end of proof

\usepackage[utf8]{inputenc}     % para acentuação em Português UTF-8
\let\spvec\vec
\let\vec\accentvec
\usepackage{amsmath}
\usepackage{accents}

\usepackage{amsfonts, amssymb, dsfont}      % fontes e símbolos matemáticos
\usepackage{multirow, array}    % Permite tabelas com múltiplas linhas e colunas
\usepackage[dvips]{graphics}
\usepackage{subfigure}
\usepackage{graphicx}
\usepackage{epsfig}
\usepackage{hyperref}
\usepackage{framed}
\usepackage{psfrag}
\usepackage{tikz} 
\usetikzlibrary{shapes, arrows, positioning,snakes}
\tikzset{
    box/.style={rectangle, text centered, minimum height=3em},
    narrowbox/.style={box,text width=4cm,draw,thick},
    line/.style={draw, thick, -Stealth}
}
\usepackage{enumitem}
\usepackage{algorithm2e}
\usepackage{breakcites}
\usepackage[numbers]{natbib}

\setlist[enumerate]{itemsep=0mm}

\numberwithin{theorem}{subsection} 

\newtheorem{thm}{Teorema}[subsection] % reset theorem numbering for each chapter


\newtheorem{defn}{Definition}
\numberwithin{defn}{subsection}
\newcommand{\defnautorefname}{Definition}
\newtheorem{exmp}{Example} % same for example numbers


\begin{document}
    \tikzstyle{block} = [draw, rectangle]
    \begin{figure}[t!]
        \centering
            \begin{tikzpicture}[node distance = 5cm]
        % Place nodes
            \node [block, 
text width=10em] (plimgInts) {Points on image plane $\Ivec{x}$};
            \node [box, 
text width=8em, right of = plimgInts] (plimgInts) {teste};
           \end{tikzpicture}
        \caption{figure}
    \end{figure}
\end{document}
Torbjørn T.
  • 206,688

1 Answers1

4

svjour is irrelevant here I think. It is because you're compiling with (probably) pdflatex while you're using the dvips option to graphics.

So just remove \usepackage[dvips]{graphics} (and \usepackage{epsfig}). You're also loading graphicx, which loads graphics, and you don't need both. And graphicx can usually figure out the correct driver (the dvips specifies a driver) by itself, so in general don't do that manually. As for epsfig, that is just a wrapper around graphicx I think, so might as well just use graphicx, and the \includegraphics command.

(And for that matter, tikz loads graphicx, so you don't need to explicitly have \usepackage{graphicx}.)

This is enough to demonstrate the problem:

\documentclass{article}
\usepackage[utf8]{inputenc} 
%\usepackage[dvips]{graphics}
\usepackage{tikz} 
\usetikzlibrary{shapes, arrows, positioning,snakes}
\tikzset{
    box/.style={rectangle, text centered, minimum height=3em},
    narrowbox/.style={box,text width=4cm,draw,thick},
    line/.style={draw, thick, -Stealth},
    block/.style={draw,rectangle}
}
\begin{document}
    \begin{figure}[t!]
        \centering
            \begin{tikzpicture}[node distance = 2cm]
        % Place nodes
            \node [block, 
text width=10em] (plimgInts) {Points on image plane $\vec{x}$};
            \node [box, 
text width=8em, right=of plimgInts] (plimgInts) {teste};
           \end{tikzpicture}
        \caption{figure}
    \end{figure}
\end{document}

This gives

enter image description here

but if you uncomment \usepackage[dvips]{graphics} you get

enter image description here

(I also moved the block style to the preamble, and used the =of syntax of the positioning library, cf. Difference between "right of=" and "right=of" in PGF/TikZ.)

Torbjørn T.
  • 206,688