HarisIqbal88 / PlotNeuralNet

Latex code for making neural networks diagrams
MIT License
21.74k stars 2.84k forks source link

Importing layers in a latex project will affect captions on all figure boxes #53

Open rdednl opened 5 years ago

rdednl commented 5 years ago

Importing the 'layers' folder in a latex project will affect captions in every figure and table boxes. Basically, every caption will not have anymore the text "Figure X"/"Table X" where X is a index as soon as you add the lines \subimport{layers/}{init} .

Minimum example (correct):

\documentclass{article}

\usepackage{graphicx}
% \usepackage{tikz}
% \usepackage{import}
% \subimport{layers/}{init}
% \usetikzlibrary{positioning}

\begin{document}

\begin{figure}
    \centering
    \includegraphics[height=5cm]{cats.jpg}
    \caption{This is a caption.}
    \label{test2}
\end{figure}

\end{document}

This produces: image

Importing layers:

\documentclass{article}

\usepackage{graphicx}
\usepackage{tikz}
\usepackage{import}
\subimport{layers/}{init}
\usetikzlibrary{positioning}

\begin{document}

\begin{figure}
    \centering
    \includegraphics[height=5cm]{cats.jpg}
    \caption{This is a caption.}
    \label{test2}
\end{figure}

\end{document}

Produces: image

Issues so are: not displaying anymore the count of captions and not keeping the correct alignment.

Dev-XYS commented 3 years ago

Searching in layers/*.sty for \caption and replacing all occurrences with another name fix the problem. \caption defined in *.sty clashes with the figure caption command.

Zeta611 commented 1 year ago

This issue should be made more visible imo