You did not change the float specifier, LaTeX did that for you and informed you. The reason is, that you provided just the optional placement argument h
or !h
for a float (figure or table), but the float didn't fit on the current page. It had to be put on top of the next page, corresponding to a placement argument t
.
I recommend to use at least ht
as positioning argument. If you mean "exactly here", then use the argument H
of the float
package or one of the possibilities listed here: Prevent floating of figures or tables.
Often it's satisfying to specify all possible placement options !htbp
, so still letting the figures and tables float.
h
means here allowed, t
means top, b
means bottom, p
means on a float-page, !
means try harder! to place it earlier.
For more information about the algorithm for placing floats, see How to influence the position of float environments like figure and table in LaTeX?
added:
If a previous compilation using the [h]
option worked with no error reported, the addition of text before the float may decrease the amount of space available for placing the float as specified, triggering a new error. This may not be obvious to an inexperienced user. (See `h' float specifier changed to `ht', where the OP associated the error with the content of the added text, not with the float.)
I began by turning the code into a more minimal example to narrow down the problem.
I then determined that the primary problem was that the francais
option to babel
conflicts with the use of \pgfornamenthline
etc. Based on Gonzalo Medina's advice responding to my comment on his answer here, adding the babel
tikz library resolves the problem:
\documentclass[12pt,francais]{standalone}
\PassOptionsToPackage{dvipsnames,svgnames}{xcolor}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage[object=vectorian]{pgfornament}
\usepackage{tikz}
\usetikzlibrary{calc,babel}
\tikzset{pgfornamentstyle/.style={draw=NavyBlue, fill = blue}}
\begin{document}
\fontfamily{pzc} \selectfont
\begin{tikzpicture}
[every node/.style={inner sep=0pt}]
\node[text width= \linewidth-1cm, anchor=center](Text){% ~ \centerline{\LARGE \normalfont Université Paris Sud }
\bigskip
{\LARGE Département de Mathématiques} \hfill {\large Première année Master} \\ {\LARGE Module: Probabilité approfondie}
\hfill {\large 2013-2014 } ~ \bigskip \\ \centerline{\LARGE \normalfont TD: Chaînes de Markov } } ;
\node[shift={(-1cm,0.2cm)},anchor=north west](CNW) at (Text.north west) {\pgfornament[width=1cm]{61}};
\node[shift={(1cm,0.2cm)},anchor=north east](CNE) at (Text.north east) {\pgfornament[width=1cm,symmetry=v]{61}};
\node[shift={(-1cm,-0.5cm)},anchor=south west](CSW) at (Text.south west) {\pgfornament[width=1cm,symmetry=h]{61}};
\node[shift={(1cm,-0.5cm)},anchor=south east](CSE) at (Text.south east) {\pgfornament[width=1cm,symmetry=c]{61}}; \node[shift={(0cm,0cm)}](CS) at (Text.south) {\pgfornament[width=4.5cm,ydelta=+3cm]{75}};
\pgfornamenthline{CNW}{CNE}{north}{89}
\pgfornamentvline{CNW}{CSW}{west}{87}
\pgfornamentvline{CNE}{CSE}{east}{87}
\end{tikzpicture}
\end{document}
As Gonzalo Medina explains, this solution is only available with tikz 3. If you have an older version, you need to turn the relevant shorthand characters off when necessary. For example:
\documentclass[12pt,francais]{standalone}
\PassOptionsToPackage{dvipsnames,svgnames}{xcolor}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage[object=vectorian]{pgfornament}
\usepackage{tikz}
\usetikzlibrary{calc}%,babel}
\tikzset{pgfornamentstyle/.style={draw=NavyBlue, fill = blue}}
\begin{document}
\fontfamily{pzc} \selectfont
\shorthandoff{!}
\begin{tikzpicture}
[every node/.style={inner sep=0pt}]
\node[text width= \linewidth-1cm, anchor=center](Text){% ~ \centerline{\LARGE \normalfont Université Paris Sud }
\bigskip
{\LARGE Département de Mathématiques} \hfill {\large Première année Master} \\ {\LARGE Module: Probabilité approfondie}
\hfill {\large 2013-2014 } ~ \bigskip \\ \centerline{\LARGE \normalfont TD: Chaînes de Markov } } ;
\node[shift={(-1cm,0.2cm)},anchor=north west](CNW) at (Text.north west) {\pgfornament[width=1cm]{61}};
\node[shift={(1cm,0.2cm)},anchor=north east](CNE) at (Text.north east) {\pgfornament[width=1cm,symmetry=v]{61}};
\node[shift={(-1cm,-0.5cm)},anchor=south west](CSW) at (Text.south west) {\pgfornament[width=1cm,symmetry=h]{61}};
\node[shift={(1cm,-0.5cm)},anchor=south east](CSE) at (Text.south east) {\pgfornament[width=1cm,symmetry=c]{61}}; \node[shift={(0cm,0cm)}](CS) at (Text.south) {\pgfornament[width=4.5cm,ydelta=+3cm]{75}};
\pgfornamenthline{CNW}{CNE}{north}{89}
\pgfornamentvline{CNW}{CSW}{west}{87}
\pgfornamentvline{CNE}{CSE}{east}{87}
\end{tikzpicture}
\shorthandon{!}
\end{document}
Alternatively, disable the shorthand globally for all tikz environments:
\documentclass[12pt,francais]{standalone}
\PassOptionsToPackage{dvipsnames,svgnames}{xcolor}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage[object=vectorian]{pgfornament}
\usepackage{tikz}
\usetikzlibrary{calc}%,babel}
\tikzset{pgfornamentstyle/.style={draw=NavyBlue, fill = blue},
every picture/.prefix style={execute at begin picture=\shorthandoff{!}}}
\begin{document}
\fontfamily{pzc} \selectfont
\begin{tikzpicture}
[every node/.style={inner sep=0pt}]
\node[text width= \linewidth-1cm, anchor=center](Text){% ~ \centerline{\LARGE \normalfont Université Paris Sud }
\bigskip
{\LARGE Département de Mathématiques} \hfill {\large Première année Master} \\ {\LARGE Module: Probabilité approfondie}
\hfill {\large 2013-2014 } ~ \bigskip \\ \centerline{\LARGE \normalfont TD: Chaînes de Markov } } ;
\node[shift={(-1cm,0.2cm)},anchor=north west](CNW) at (Text.north west) {\pgfornament[width=1cm]{61}};
\node[shift={(1cm,0.2cm)},anchor=north east](CNE) at (Text.north east) {\pgfornament[width=1cm,symmetry=v]{61}};
\node[shift={(-1cm,-0.5cm)},anchor=south west](CSW) at (Text.south west) {\pgfornament[width=1cm,symmetry=h]{61}};
\node[shift={(1cm,-0.5cm)},anchor=south east](CSE) at (Text.south east) {\pgfornament[width=1cm,symmetry=c]{61}}; \node[shift={(0cm,0cm)}](CS) at (Text.south) {\pgfornament[width=4.5cm,ydelta=+3cm]{75}};
\pgfornamenthline{CNW}{CNE}{north}{89}
\pgfornamentvline{CNW}{CSW}{west}{87}
\pgfornamentvline{CNE}{CSE}{east}{87}
\end{tikzpicture}
\end{document}
Best Answer
A package is declared by writing:
When you load the package you write,
You do not specify any folders either in the
\usepackage
macro or the\ProvidesPackage
. What you need to do is install it in a directory where TeX can find it.If you read the
mcode.sty
file, you will notice that it has been written correctly and my guess is that if you drop it in the same folder like your document, it will work with no issues.Have a look at install package in subfolder to see how you can install it properly in a subfolder.