Here are my files reduces for the MWE :
file 1 :
\documentclass[a4paper,12pt]{article}
\usepackage{tikz}
\begin{document}
\input{Chaine_Fonctionnelle}
\end{document}
file 2 :
\documentclass[border=2pt]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{tikz}
\begin{document}
\input{Chaine_Fonctionnelle}
\end{document}
Chaine_Fonctionnelle.tex :
% \tikzset{font=\fontsize{12pt}{14pt}\selectfont}
\begin{tikzpicture}[scale=.8]
\node[line width=2pt, minimum width=5cm, text width=3.8cm,minimum height=5cm, rectangle] (Ali) at (0,0) {};
\draw[line width=2pt] (Ali.east)--(Ali.west);
\node[font=\large\bfseries, anchor=south, above = 1cm,align=center,inner sep=-18pt] at (Ali.south) {Redresseur \\ (pont de diodes)\\ + filtre \\ (Condensateur)};
\end{tikzpicture}
here is the version from the article :
here is the version from the standalone :
I've tried a few things that showed me what causes the differences. For example I can remove the 12 points from the first line of the article, then the two images look the same, but I would like a solution that doesn't imply a change at this top line.
I've tried local changes like the commented line, but to no avail.
I thought the hierarchy was putting local indication above global indication, but I can't seem to overrule that 12 point from the documentclass command.
Can you help me ?
First Edition ---------------- :
Thank you for your answers and comments, I'll try make a few changes try and avoid some problems : avoiding negative value for inner sep
, for that I'll anchor the text to the middle of the line, but the problem doesn't go away :
New file Chaine_Fonctionnelle.tex :
% \tikzset{font=\fontsize{12pt}{14pt}\selectfont}
\begin{tikzpicture}
\node[draw,line width=2pt, minimum width=5cm, minimum height=4.2cm, rectangle] (Ali) at (0,0) {};
\draw[line width=2pt] (Ali.east)--(Ali.west) node[midway] (MidAli) {};
\node[font=\large\bfseries, anchor=north, align=center] at (MidAli) {Redresseur \\ (pont de diodes)\\ + filtre \\ (Condensateur)};
\end{tikzpicture}
Here are the result, first from the standalone then from the article compilation :
You can see the two compilations still give different results.
inner sep=-18pt
that is always liable to cause the text to overprint the surrounding material depending on the spacing where it is included.inner sep
, but there is still a difference between the standalone compilation and the article one.