3

I have this compilable MWE:

\documentclass[a4paper,12pt]{article}

\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}
\usepackage{mathtools,amssymb}
\usepackage[top=2.5cm,bottom=2.2cm,left=1.5cm,right=1.5cm,headsep=10pt,a4paper]{geometry}

\usepackage{wrapfig}

\begin{document}


\textit{Durante la prova non è consentito consultare libri, appunti e strumentazione elettronica compresa la calcolatrice scientifica o standard o l'app dello smartphone.}

\vskip .5cm
Lo studente/ssa risolva a scelta \textbf{solo tre} dei seguenti quattro problemi/quesiti/esercizi.


\vskip 1.5cm
\begin{center}
\textbf{I}
\end{center}


\vskip 1cm
\begin{center}
\textbf{II}
\end{center}

\vskip 1cm
\begin{center}
\textbf{III}
\end{center}

Da un foglio rettangolare con le dimensioni di 4,6 dm e 3,2 dm viene ritagliato un angolo come in figura. \begin{wrapfigure}{r}{0.5\textwidth}
\centering
\includegraphics[width=.65\linewidth]{example-image-a}
\end{wrapfigure}
Determina al variare di $x$ l'area $\mathcal A$ della parte di foglio che rimane. Entro quali valori può variare $x$? Rappresenta la funzione $\mathcal A(x)$ tenendo conto dei limiti di $x$ e indica che
tipo di relazione c’è tra $\mathcal A$ e $x$. Per quale valore di $x$ l'area diventa $\frac 14$
di quella iniziale?


\vskip 1.5cm
\begin{center}
\textbf{IV}
\end{center}
zhzfhfhfffffffffshfjggj
\end{document}

enter image description here

How can I improve the positioning and enlargement of the figure without encroaching on the IV number that moves it to the left for me? All Roman numerals must be centered. Is it better to use minipages or floats?

6
  • 1
    Why are you using appearance markup for what look like structural elements (sectioning of some kind?). Can't you put the figure at the beginning of the paragraph? Are you asking whether it is better to use the float versions of wrapfigure?
    – cfr
    Nov 15, 2023 at 20:56
  • @cfr Any changes to the code I have entered are welcome. I want put the figure at the right of the question with the IV centered without or with wrapfigure or other.
    – Sebastiano
    Nov 15, 2023 at 20:58
  • 2
    You're missing \end{document} by the way ....
    – cfr
    Nov 15, 2023 at 21:02
  • @cfr Thank you. 22 mins ago I have put \end{document}.
    – Sebastiano
    Nov 15, 2023 at 21:26
  • 1
    Lo studente/ssa sounds weird, doesn't it? If I were forced to, then I'd rather write Lo/La studente/ssa, but I would really prefer an impersonal construct Si risolva...
    – campa
    Nov 15, 2023 at 21:42

2 Answers 2

4

Do you want something like this? Note that skips are supposed to be stretchy i.e. to include glue e.g. plus 2pt minus 1pt or whatever.

figure wrapped more tidily, perhaps?

\documentclass[a4paper,12pt,italian]{article}
\usepackage{babel}
\usepackage[utf8]{inputenc}
\usepackage{mathtools,amssymb}
\usepackage[top=2.5cm,bottom=2.2cm,left=1.5cm,right=1.5cm,headsep=10pt]{geometry}

\usepackage{wrapfig}

\newcounter{sebcnt}
\setcounter{sebcnt}{0}
\RenewDocumentCommand \thesebcnt {} {\Roman{sebcnt}}
\NewDocumentCommand \sebsec { O {1.5cm} }
{%
  \vskip #1 plus .5cm minus .5cm
  \begin{center}
    \refstepcounter{sebcnt}
    \textbf{\thesebcnt}
  \end{center}%
}

\begin{document}

\textit{Durante la prova non è consentito consultare libri, appunti e strumentazione elettronica compresa la calcolatrice scientifica o standard o l'app dello smartphone.}

\vskip .5cm plus .25cm minus .15cm
Lo studente/ssa risolva a scelta \textbf{solo tre} dei seguenti quattro problemi/quesiti/esercizi.


\sebsec

\sebsec

\sebsec[1cm]

\begin{wrapfigure}[8]{r}{0.5\textwidth}
  \vspace*{-\intextsep}%
  \centering
  \includegraphics[width=.65\linewidth]{example-image-a}
\end{wrapfigure}
Da un foglio rettangolare con le dimensioni di 4,6 dm e 3,2 dm viene ritagliato un angolo come in figura. Determina al variare di $x$ l'area $\mathcal A$ della parte di foglio che rimane. 
Entro quali valori può variare $x$? Rappresenta la funzione $\mathcal A(x)$ tenendo conto dei limiti di $x$ e indica che tipo di relazione c’è tra $\mathcal A$ e $x$. 
Per quale valore di $x$ l'area diventa $\frac 14$ di quella iniziale?


\sebsec
zhzfhfhfffffffffshfjggj
\end{document}
5
  • Perfect. Why can't I do that? Changing the parameters of wrapfigure never moves the figure above for me. Why did you have to enter a counter \sebsec[1cm]? +1 for your effort.
    – Sebastiano
    Nov 15, 2023 at 21:33
  • 1
    @Sebastiano Because you specified a different value for the vertical spacing at that particular point. So I made it an optional argument i.e. default is 1.5cm, but you can override it, since that's what you'd done in your code.
    – cfr
    Nov 16, 2023 at 0:43
  • 1
    @Sebastiano It isn't the different parameters to wrapfigure which moves it up. wrapfigure adds \intextsep vertical spacing at the top and bottom. To move it up, I removed this padding at the top. The reason to specify the number of shortened lines is that this enables you to ensure the roman numeral following is not pushed left. Otherwise, wrapfigure is still wrapping and shortens the line when \sebsec is used, so the numeral is at the centre of a shorter line and looks as if it is pushed leftwards.
    – cfr
    Nov 16, 2023 at 0:46
  • 1
    @Sebastiano I should have had two \subsec[1cm], I think. But it was just for demonstration purposes anyway.
    – cfr
    Nov 16, 2023 at 0:49
  • I have understood.
    – Sebastiano
    Nov 16, 2023 at 10:39
3

If the text does not actually wrap around the figure, you can use paracol (more robust}.

Note, begin{figure}[h] will add the \intextsep gaps above and below the figure, same as wrapfigure.

\documentclass[a4paper,12pt]{article}

\usepackage[italian]{babel}
\usepackage[utf8]{inputenc}
\usepackage{mathtools,amssymb}
\usepackage[top=2.5cm,bottom=2.2cm,left=1.5cm,right=1.5cm,headsep=10pt,a4paper]{geometry}

\usepackage{wrapfig}
\usepackage{paracol}

\begin{document}


\textit{Durante la prova non è consentito consultare libri, appunti e strumentazione elettronica compresa la calcolatrice scientifica o standard o l'app dello smartphone.}

\vskip .5cm
Lo studente/ssa risolva a scelta \textbf{solo tre} dei seguenti quattro problemi/quesiti/esercizi.


\vskip 1.5cm
\begin{center}
\textbf{I}
\end{center}


\vskip 1cm
\begin{center}
\textbf{II}
\end{center}

\vskip 1cm
\begin{center}
\textbf{III}
\end{center}

Da un foglio rettangolare con le dimensioni di 4,6 dm e 3,2 dm viene ritagliato un angolo come in figura. 
\setcolumnwidth{\dimexpr 0.5\textwidth-0.5\columnsep}% second column is remainder
\begin{paracol}{2}
Determina al variare di $x$ l'area $\mathcal A$ della parte di foglio che rimane. Entro quali valori può variare $x$? Rappresenta la funzione $\mathcal A(x)$ tenendo conto dei limiti di $x$ e indica che
tipo di relazione c’è tra $\mathcal A$ e $x$. Per quale valore di $x$ l'area diventa $\frac 14$
di quella iniziale?
\switchcolumn
\begin{figure}
\centering
\includegraphics[width=.65\linewidth]{example-image-a}
\end{figure}
\end{paracol}

\vskip 1.5cm %???
\begin{center}
\textbf{IV}
\end{center}
zhzfhfhfffffffffshfjggj
\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .