0

I wrote following program to insert figures.

\begin{figure}
  \includegraphics[option]{file}
  \caption{hoge}
  \label{fig:hoge}
\end{figure}

I want to change positioxn of all figure environment to [h].

Are there any good idea to change it?

EX: following is like

\renewcommand{\figureposision}{h}

Some TeX files are shared by some target files.

|- dir1
|   |- etc.tex
|   `- target1.tex
|- dir2
|   |- etc.tex
|   `- target2.tex
`- shared.tex 

\begin{figure}-\end{figure} are in shared.tex. The position option should be [h] in target1.tex, but [] in target2.tex

  • 2
    I would define a new environment \newenvironment{myfigure}{\begin{figure}}{\end{figure}}, use \begin{myfigure}...\end{myfigure} in shared.tex, and redefine \renewenvironment{myfigure}{\begin{figure}[h]}{\end{figure}} as appropriate. – Willie Wong Jan 02 '24 at 03:17
  • 3
    You can reset the default placement using \expandafter\def\csname fps@figure\endcsname{ht}. Note that [h] takes prescedence over [t] on the current page. – John Kormylo Jan 02 '24 at 04:26

0 Answers0