Subfig e subcaption – uso contemporaneo

  • Questo topic ha 2 risposte, 2 partecipanti ed è stato aggiornato l'ultima volta 15 anni fa da Marco87.
  • Creatore
    Topic
  • #63146
    Up
    0
    Down
    ::


    Ciao a tutti,

    sto cercando di compilare un file con il seguente preambolo:

    `% Codifica di input e di output
    %******************************
    \usepackage[T1]{fontenc}
    \usepackage[latin1]{inputenc}

    % Scelta tipografica
    %*******************
    \usepackage[italian]{babel}

    % Composizione paragrafi
    %***********************
    \usepackage{microtype}

    % Indice, elenco figure ed elenco tabelle
    %****************************************
    \usepackage{tocloft}
    \renewcommand{\cftchapfillnum}[1]{\nobreak\hspace{1.5em}\textbf{#1}\cftparfillskip\par}
    \renewcommand{\cftsecfillnum}[1]{\nobreak\hspace{1.5em}#1\cftparfillskip\par}
    \renewcommand{\cftsubsecfillnum}[1]{\nobreak\hspace{1.5em}#1\cftparfillskip\par}
    \renewcommand{\cftfigfillnum}[1]{\nobreak\hspace{1.5em}#1\cftparfillskip\par}
    \renewcommand{\cfttabfillnum}[1]{\nobreak\hspace{1.5em}#1\cftparfillskip\par}

    % Miniindice
    %***********
    \usepackage[tight,italian]{minitoc}

    % Interlinea
    %***********
    \linespread{1.05}

    % Stile e dimensioni pagina, dimensioni corpo testo
    %**************************************************
    \usepackage[binding=5mm]{layaureo}

    % Bibliografia
    %*************
    \usepackage[babel,italian=guillemets]{csquotes}
    \usepackage[style=philosophy-modern,square=true,backref,ibidtracker=false]{biblatex}
    \bibliography{Bibliografia.bib}

    % Font
    %*****
    \usepackage[osf,sc]{mathpazo}
    \usepackage[scaled=.95]{helvet}
    \usepackage{courier}
    \usepackage{pifont}
    \usepackage{calligra}

    % Sottolineatura testo
    %*********************
    \usepackage[normalem]{ulem}

    % Pacchetti per la matematica
    %****************************
    \usepackage{amssymb,amsmath,amsthm}
    \usepackage{mathrsfs,eucal,dsfont}
    \usepackage{bbm}
    %\usepackage{eulervm}

    % Figure
    %*******
    \usepackage{epsfig}
    \usepackage{graphicx}
    \usepackage{wrapfig}
    \usepackage[percent]{overpic}

    % Footnote
    %*********
    \usepackage{footnote}

    % Cartella delle immagini
    %************************
    \graphicspath{{../Immagini/}{../Immagini/immaginiEl1/}{../Immagini/immaginiEl2/}}

    % Oggetti rotanti
    %****************
    \usepackage{rotating}

    % Tabelle
    %********
    \usepackage{tabularx}
    \makesavenoteenv{tabular}
    \usepackage{array}
    \usepackage{booktabs}
    \usepackage{multicol}
    \usepackage{multirow}
    \usepackage{longtable}

    % Gestione dei colori
    %********************
    \usepackage{xcolor}

    % Opzioni caption
    %****************
    \usepackage[font={small,sf},format=hang,labelfont={sf,bf}]{caption}
    \setlength{\captionmargin}{.10\textwidth}
    \usepackage{subfig}
    \usepackage{subcaption}
    \captionsetup[table]{position=top}

    % Riferimenti “automatici''
    %***************************
    \usepackage[italian]{varioref}

    % Acronimi
    %*********
    \DeclareRobustCommand*{\acronimo}[1]{%
    \mbox{\scshape\MakeLowercase{#1}}}

    % Epigrafe
    %*********
    \usepackage{epigraph}
    \setlength{\epigraphwidth}{.75\textwidth}

    % Sistemi di equazioni
    %*********************
    \usepackage{empheq}

    % SI delle misure
    %****************
    \usepackage{siunitx}
    \sisetup{detect-display-math=true}

    % Righe di codici
    %****************
    \usepackage{listings}
    \lstset{language=Matlab,basicstyle=\small\ttfamily}

    % Riferimenti ipertestuali
    %******************
    %\usepackage[pdfborder=000,pdfstartpage=1]{hyperref}
    \usepackage[unicode=true,pdfauthor=MarcoDaniel,linkcolor=,colorlinks=false,linkcolor=blue]{hyperref}

    % Profondità  di numerazione dei titoli
    %*************************************
    \setcounter{secnumdepth}{3}
    \setcounter{tocdepth}{3}

    % Numerazione equazioni, figure e subfigure
    %******************************************
    \numberwithin{equation}{chapter}
    \numberwithin{figure}{chapter}
    \numberwithin{subfigure}{chapter}
    \renewcommand\thesubfigure{(\alph{subfigure})}
    \captionsetup[subfigure]{labelformat=simple}

    % Nuovi comandi
    %**************
    \newcommand{\ull}{\underline}
    \newcommand{\dul}[1]{\underline{\underline{#1}}}
    \newcommand{\ol}{\overline}
    \newcommand{\dol}[1]{\overline{\overline{#1}}}
    \newcommand{\ds}{\displaystyle}
    \newcommand{\enep}{\text{e}}
    \newcommand{\diff}{\mathop{}\!d}
    \newcommand{\imm}{\text{i}}
    \newcommand{\cu}{\rightrightarrows}
    \newcommand{\cp}{\rightarrow}
    \newcommand{\immag}[1]{\text{Im}\left\{#1\right\}}
    \newcommand{\real}[1]{\text{Re}\left\{#1\right\}}
    \newcommand{\e}[1]{\cdot 10^{#1}}
    \newcommand{\cls}{calcestruzzo}
    \newcommand{\elstr}[1]{\emph{#1}}

    \DeclareRobustCommand{\vect}[1]{
    \ifcat#1\relax
    \boldsymbol{#1}
    \else
    \mathbf{#1}
    \fi}
    \DeclareRobustCommand{\mat}[1]{
    \ifcat#1\relax
    \boldsymbol{#1}
    \else
    \mathbf{#1}
    \fi}

    \makeatletter
    \newcommand{\der}[2]{\begingroup
    \@tempswafalse\toks@={}\count@=\z@
    \@for\next:=#2\do
    {\expandafter\check@var\next\@nil
    \advance\count@\der@exp
    \if@tempswa
    \toks@=\expandafter{\the\toks@\,}%
    \else
    \@tempswatrue
    \fi
    \toks@=\expandafter{\the\expandafter\toks@\expandafter\partial\der@var}}%
    \frac{\partial\ifnum\count@=\@ne\else^{\number\count@}\fi#1}{\the\toks@}%
    \endgroup}
    \def\check@var{\@ifstar{\mult@var}{\one@var}}
    \def\mult@var#1#2\@nil{\def\der@var{#2^{#1}}\def\der@exp{#1}}
    \def\one@var#1\@nil{\def\der@var{#1}\chardef\der@exp\@ne}
    \makeatother
    %esempio:\der{f}{*{2}{x_i},y}

    \makeatletter
    \newcommand{\dert}[2]{\begingroup
    \@tempswafalse\toks@={}\count@=\z@
    \@for\next:=#2\do
    {\expandafter\check@var\next\@nil
    \advance\count@\der@exp
    \if@tempswa
    \toks@=\expandafter{\the\toks@\,}%
    \else
    \@tempswatrue
    \fi
    \toks@=\expandafter{\the\expandafter\toks@\expandafter d\der@var}}%
    \frac{d\ifnum\count@=\@ne\else^{\number\count@}\fi#1}{\the\toks@}%
    \endgroup}
    \def\check@var{\@ifstar{\mult@var}{\one@var}}
    \def\mult@var#1#2\@nil{\def\der@var{#2^{#1}}\def\der@exp{#1}}
    \def\one@var#1\@nil{\def\der@var{#1}\chardef\der@exp\@ne}
    \makeatother

    % Renewcommand
    %*************
    \renewcommand{\epsilon}{\varepsilon}
    \renewcommand{\phi}{\varphi}
    \renewcommand{\theta}{\vartheta}
    \renewcommand{\l}{\left}
    \renewcommand{\r}{\right}

    % Nuovi ambienti
    %***************
    \newenvironment{citazione}
    {\begin{quotation}\small}
    {\end{quotation}}

    % Nuovi operatori
    %****************
    \DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it}
    \DeclareMathOperator{\arcot}{arcot}
    \DeclareMathOperator{\diverg}{div}
    \DeclareMathOperator{\rot}{rot}

    % Derivate in numero romano
    %**************************
    \newcommand{\hod}[1]{^{\scriptscriptstyle\mathrm{#1}}}

    % Newtheorem
    %***********
    \newtheorem{definizione}{Definizione}
    \newtheorem{ipotesi}{Ipotesi}
    \newtheorem{principio}{Principio}
    \newtheorem{equazione}{Equazione}
    \newtheorem{teorema}{Teorema}

    % Lipsum
    %*******
    \usepackage{lipsum}

    %*******************************************************************************
    % FANCY…
    %*******************************************************************************

    \usepackage[Sonny]{fncychap}

    \makeatletter
    \ChNameVar{\Large\sf} % sets the style for name
    \ChNumVar{\Huge} % sets the style for digit
    \ChTitleVar{\Large\sf} % sets the style for title
    \ChRuleWidth{.5pt} % Set RW=4pt
    \ChNameUpperCase % Make name uppercase
    \renewcommand{\DOCH}{%
    \flushright
    {\CNV\FmN{Elaborato}\space \CNoV\thechapter}\par\nobreak
    \vskip 21\p@}
    \renewcommand{\DOTI}[1]{%
    \CTV\FmTi{\huge\bfseries #1}\par\nobreak
    \vskip 40\p@}

    \usepackage{fancyhdr}

    \pagestyle{fancy}
    \fancyhf{} % cancella tutti i campi (testatina e pié di pagina)
    \fancypagestyle{plain}{%
    \renewcommand{\headrulewidth}{0pt}%
    \fancyhf{}\fancyfoot[C]{\sffamily\thepage}%
    }

    \renewcommand{\chaptermark}[1]{%
    \markboth{#1}{}}
    \fancyhead[RE]{\sffamily\MakeUppercase{\leftmark}}

    \renewcommand{\sectionmark}[1]{%
    \markright{\thesection\ #1}}
    \fancyhead[LO]{\sffamily\rightmark}

    \fancyhead[RO,LE]{\sffamily\thepage}
    \renewcommand{\headrulewidth}{0pt}
    \setlength{\headheight}{13.59999pt}
    \usepackage{emptypage}`

    Quando compilo mi viene indicato quest’errore: ! Package subcaption Error: This package can’t be used in cooperation (subcaption) with the subfig package. Che cosa sbaglio?

    Ciao e grazie,
    Marco.

Visualizzazione 1 filone di risposte
  • Autore
    Risposte
    • #63147
      Up
      0
      Down
      ::


      Usane uno solo: sono pensati per lo stesso scopo.

      Ciao
      Enrico

    • #63148
      Up
      0
      Down
      ::


      Ciao Enrico,

      grazie mille. Ora mi metterò a sistemare le varie figure che ho inserito, adeguando le caption a uno dei due pacchetti.

      Ciao,
      Marco.

Visualizzazione 1 filone di risposte
  • Devi essere connesso per rispondere a questo topic.

Go to top