Graphics, Figures & TablesProblems with wrapfig package

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
LorenzoM
Posts: 8
Joined: Thu Mar 01, 2018 8:02 pm

Problems with wrapfig package

Post by LorenzoM »

Hello everyone!
So I was writing a document with LaTeX and decided to add an image. In order to get it wrap around my text, I added the package wrapfig, and created the environment as follows:

Code: Select all

Code, edit and compile here:
\begin{wrapfigure}{r}{0.5\textwidth}
\vspace{-20pt}
\begin{center}
\includegraphics[width=0.48\textwidth]{adamo}
\end{center}
\vspace{-20pt}
\caption{A gull}
\vspace{-10pt}
\end{wrapfigure}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
However, upon trying to compile the code, I would get an error message and a messy pdf file. Unfortunately I still haven't figured out how to attach the .log file so I can't show you the error message.
Another thing I'd like to notice is that upon doing the same process on a blank LaTeX file I'd get the image wrapped with no problem. I tried to see if there were some problems with the other packages but nothing would work.
Any ideas?

Really, really thank you for your help.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

Problems with wrapfig package

Post by Stefan Kottwitz »

Hi Lorenzo,

you could copy and paste the error message hier as normal text.

Logfiles and pictures can be posted by clicking the Attachments link below the text edit field, when writing a post.

Stefan
LaTeX.org admin
LorenzoM
Posts: 8
Joined: Thu Mar 01, 2018 8:02 pm

Problems with wrapfig package

Post by LorenzoM »

Ok I'm copying the .log file here below:

Code: Select all

This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017) (preloaded format=pdflatex 2018.3.2) 21 NOV 2018 19:11
entering extended mode
restricted \write18 enabled.
file:line:error style messages enabled.
%&-line parsing enabled.
**"Gesu il Cristo.tex"
(./Gesu il Cristo.tex
LaTeX2e <2017-04-15>
Babel <3.10> and hyphenation patterns for 84 language(s) loaded.
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/book.cls
Document Class: book 2014/09/29 v1.4h Standard LaTeX document class
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/bk10.clo
File: bk10.clo 2014/09/29 v1.4h Standard LaTeX file (size option)
)
\c@part=\count79
\c@chapter=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/inputenc.sty
Package: inputenc 2015/03/17 v1.2c Input encoding file
\inpenc@prehook=\toks14
\inpenc@posthook=\toks15
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/utf8.def
File: utf8.def 2017/01/28 v1.1t UTF-8 support for inputenc
Now handling font encoding OML ...
... no UTF-8 mapping file for font encoding OML
Now handling font encoding T1 ...
... processing UTF-8 mapping file for font encoding T1
(/usr/local/texlive/2017/texmf-dist/tex/latex/base/t1enc.dfu
File: t1enc.dfu 2017/01/28 v1.1t UTF-8 support for inputenc
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
User avatar
Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

Problems with wrapfig package

Post by Stefan Kottwitz »

One closung brace } is too much, or one opening brace { is missing.

The code that you posted above was ok, so the error may have been caused before this wrapfigure.

Stefan
LaTeX.org admin
LorenzoM
Posts: 8
Joined: Thu Mar 01, 2018 8:02 pm

Problems with wrapfig package

Post by LorenzoM »

But the error message doesn't show up if I don't use the wrapfigure environment and the compiling goes on smoothly...
Thank you for your attention :D
User avatar
Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

Problems with wrapfig package

Post by Stefan Kottwitz »

Perhaps post code that produces the error. A reduced copy with preamble and that wrapfigure (plus stuff before) that produces the error when it's compiled. That should make it easy.

Stefan
LaTeX.org admin
LorenzoM
Posts: 8
Joined: Thu Mar 01, 2018 8:02 pm

Problems with wrapfig package

Post by LorenzoM »

Ok here it is:

Code: Select all

documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage[LGR,T1]{fontenc}
\usepackage[english,hebrew,greek.ancient,italian]{babel}
\usepackage{epigraph}
\usepackage{multicol}
\usepackage{cjhebrew}
\usepackage{oldgerm}
\usepackage{txfonts}
\usepackage{caption}
\usepackage{graphicx}
\graphicspath{ {./libellum/} }
\usepackage{substitutefont}
\substitutefont{LGR}{\rmdefault}{Tempora-TLF}
\title{\textsc{Gesù, detto Cristo}}
\author{Lorenzo Murrone}
\date{}
\newcommand{\abbr}[1]{\textit{#1}\par}
\newcommand{\libro}[3]{\textsc{#1}, \textit{#2} ({#3})}
\newcommand{\riv}[5]{\textsc{#1}, “{#2}”, \textit{#3} {#4} ({#5})}
\begin{document}
\maketitle
Paolo nacque in una famiglia ebraica, della setta dei farisei (Fil 3,5). I farisei rappresentavano, assieme ai sadducei, agli zeloti ed al variegato gruppo generalmente accomunato sotto il nome di “esseni”, una delle principali forme di Giudaismo al tempo di Gesù. Essi si fondavano su una rigida (e spesso letterale) osservanza della legge Mosaica, alla quale associavano anche la tradizione orale rabbinica, ovvero un ampio corpus (per lo più orale) di interpretazioni e regole provenienti dalle discussioni dei rabbini dei tempi passati (ed anche del presente). Queste tradizioni sono per lo più le stesse che si svilupparono in seguito fino a divenire il Talmud, e a formare il moderno Giudaismo.\footnote{Per ulteriori informazioni sui farisei, cf. \libro{G. Boccacini; A. Bardi}{I giudaismi del secondo tempio: da Ezechiele a Daniele}{Brescia: Morcelliana, 2008}; \libro{P. Sacchi}{The History of the Second Temple Period}{Sheffield: Sheffield Academic Press, 2000}.} Secondo il suo racconto, lo zelo di Paolo per l’osservanza dell’Ebraismo lo portò al perseguitare la Chiesa: le sue lettere non parlano di quanto estesa questa persecuzione fosse, ma ci riportano che le chiese della Giudea, pur non conoscendo personalmente Paolo, ne conoscevano la fama (Fil 3,6; 1 Cor 15,8-9; Gal 1,23): è dunque evidente che la sua attività persecutrice non poteva esser troppo ristretta. Tuttavia, ad un certo punto della sua esperienza Paolo subisce una drastica conversione che lo porterà da persecutore della Chiesa a predicatore del Cristianesimo. Secondo quanto le lettere ci riportano, Paolo era già Cristiano al tempo del re nabateo Areta IV (2 Cor 11,32): dal momento che questo re morì nel 40 d. C., dobbiamo datare la conversione di Paolo ad un anno anteriore a questo e posteriore agli eventi circa la crocifissione di Gesù, che avvennero attorno al 30 d. C.\footnote{Pilato fu deposto nel 37 d. C. (\textsc{Ioseph.}, \emph{Antiq.} XVIII, 89.), e perciò non è possibile pensare ad una data posteriore. Dato che il battesimo di Gesù avvenne intorno al 28 d. C. (cf. Lc 3,1), e dal momento che tutt’e quattro le narrazioni evangeliche non fanno passare più di due o tre anni fino alla crocefissione, è ragionevole datare quest’ultima al 30 o 31 d. C.} Abbiamo dunque una finestra di 10 anni (30–40 d. C.) nella quale l’apostolo di Tarso abbracciò la fede cristiana. Considerando ch’egli passò anche qualche tempo come persecutore del Cristianesimo stesso, possiamo datare la sua conversione al massimo al 32 o 33 d. C., o anche più tardi, forse al 35 o 36.\par
\begin{wrapfigure}{r}{0.5\textwidth}
\vspace{-20pt}
\begin{center}
\includegraphics[width=0.48\textwidth]{adamo}
\end{center}
\vspace{-20pt}
\caption{A gull}
\vspace{-10pt}
\end{wrapfigure}
Le lettere non narrano ampiamente cosa sia avvenuto nella conversione di Paolo. Ciò nonostante, l’autore talvolta vi allude descrivendola come un momento in cui Dio gli “rivelò il Figlio suo” (Gal 1,15-16). L’esperienza dev’esser stata più di un semplice cambio di opinione, poiché l’apostolo stesso s’inserisce nell’elenco dei testimoni che hanno visto il Cristo risorto (1 Cor 15,8). Gli Atti degli Apostoli, dei quali discuteremo in seguito, descrivono l’evento come una vera e propria teofania, dai tratti ben noti, in cui Gesù apparve a Paolo in una luce sfolgorante e gli parlò (At 9,3-9). Sebbene né gli Atti né le lettere siano eccessivamente dettagliate circa l’accaduto, entrambe le fonti sono concordi nell’affermare che la conversione di Paolo avvenne in seguito ad uno stravolgente evento nel quale l’uomo incontrò Gesù Cristo, non una semplice visione eterea, ma un incontro che lo convinse, come più tardi lui stesso scriverà, che Gesù è veramente risorto dai morti.\par
\end{document}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

As you said, I've omitted part of the code, only adding the paragraphs that come before and after the wrapfigure code.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10330
Joined: Mon Mar 10, 2008 9:44 pm

Problems with wrapfig package

Post by Stefan Kottwitz »

The error is caused by the hebrew option to babel in the 4th line. If you remove hebrew, the error goes away. It doesn't seem to be compatible with wrapfig.

Stefan
LaTeX.org admin
LorenzoM
Posts: 8
Joined: Thu Mar 01, 2018 8:02 pm

Problems with wrapfig package

Post by LorenzoM »

I tried it but still it's not working...
User avatar
visblak
Posts: 1
Joined: Fri Feb 09, 2024 8:01 pm

Problems with wrapfig package

Post by visblak »

use the user package \usepackage{wrapfig},
on the error if you press h and check the fix, it states package not defined
Post Reply