Historique des modifications [retour]
cliquez ici pour masquer/afficher la révision 2

17 Fév '16, 04:30

Bernard's gravatar image

Bernard
4.6k15

Une façon de faire avec `insbox`, retrouvée dans un ancien code: on définit un *patch * *patch* ad hoc de `\InsertBoxL` et `\InsertBoxR`, qui ne marche bien qu'à partir du deuxième item. Pour parer à ça, j'ai *patché* la commande `\item` en un `\wrapitem`, à utiliser (exclusivement) pour la première image (ou objet) inséré(e) : \documentclass[10pt, BCOR=0mm, DIV=11, a5paper, oneside, latin]{scrartcl} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage[fulloldstyle,largesmallcaps]{kpfonts} \usepackage{tikz} \usepackage{lipsum} \usepackage{babel} \usepackage{enumitem} \input{insbox.tex} \makeatletter \@InsertBoxMargin = 8pt \makeatother \usepackage{etoolbox} \newcommand*{\wrapitem}{\apptocmd{\labelitemi}{\hspace*{\leftmargin}}{}{}\item\apptocmd{\labelitemi}{\hskip-\leftmargin}{}{}}% % \newcommand{\InsertListL}[3][]{% \setlength{\leftskip}{\leftmargin}\mbox{}\vspace*{-\baselineskip}% \InsertBoxL{#2}{#3}[#1]\par \hspace{\dimexpr\itemindent-\fontdimen2\font\relax} }% \newcommand{\InsertListR}[3][]{% \mbox{}\vspace*{-\baselineskip}\setlength{\leftskip}{\leftmargin}% \InsertBoxR{#2}{\hskip-\leftmargin#3\hskip\leftmargin}[#1] }% \newcommand\mypicture{% \begin{tikzpicture} \draw[thick,rounded corners=8pt] (0,0) -- (0,2) -- (1,3.25) -- (2,2) -- (2,0) -- (0.95,1) -- (2,2) -- (0,2) -- (1.05,1) -- (0,0) -- (2,0); \end{tikzpicture} } \begin{document}% \pagestyle{empty}% \begin{itemize}[noitemsep] \wrapitem% \InsertListL[-1]{2}{\mypicture}% Texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte. \lipsum[1] \item% \InsertListR[-1]{0}{\mypicture} {\lipsum[2-3]}% \item \lipsum[4] \end{itemize} \end{document} ![alt text][1] ![alt text][2] [1]: http://texnique.fr:80/osqa/upfiles/imagecoule.png [2]: http://texnique.fr:80/osqa/upfiles/imagecoule1.png
cliquez ici pour masquer/afficher la révision 1

17 Fév '16, 04:29

Bernard's gravatar image

Bernard
4.6k15

Une façon de faire avec `insbox`, retrouvée dans un ancien code: on définit un *patch * ad hoc de `\InsertBoxL` et `\InsertBoxR`, qui ne marche bien qu'à partir du deuxième item. Pour parer à ça, j'ai *patché* la commande `\item` en un `\wrapitem`, à utiliser (exclusivement) pour la première image (ou objet) inséré(e) : \documentclass[10pt, BCOR=0mm, DIV=11, a5paper, oneside, latin]{scrartcl} \usepackage[utf8x]{inputenc} \usepackage[T1]{fontenc} \usepackage[fulloldstyle,largesmallcaps]{kpfonts} \usepackage{tikz} \usepackage{lipsum} \usepackage{babel} \usepackage{enumitem} \input{insbox.tex} \makeatletter \@InsertBoxMargin = 8pt \makeatother \usepackage{etoolbox} \newcommand*{\wrapitem}{\apptocmd{\labelitemi}{\hspace*{\leftmargin}}{}{}\item\apptocmd{\labelitemi}{\hskip-\leftmargin}{}{}}% % \newcommand{\InsertListL}[3][]{% \setlength{\leftskip}{\leftmargin}\mbox{}\vspace*{-\baselineskip}% \InsertBoxL{#2}{#3}[#1]\par \hspace{\dimexpr\itemindent-\fontdimen2\font\relax} }% \newcommand{\InsertListR}[3][]{% \mbox{}\vspace*{-\baselineskip}\setlength{\leftskip}{\leftmargin}% \InsertBoxR{#2}{\hskip-\leftmargin#3\hskip\leftmargin}[#1] }% \newcommand\mypicture{% \begin{tikzpicture} \draw[thick,rounded corners=8pt] (0,0) -- (0,2) -- (1,3.25) -- (2,2) -- (2,0) -- (0.95,1) -- (2,2) -- (0,2) -- (1.05,1) -- (0,0) -- (2,0); \end{tikzpicture} } \begin{document}% \pagestyle{empty}% \begin{itemize}[noitemsep] \wrapitem% \InsertListL[-1]{2}{\mypicture}% Texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte texte. \lipsum[1] \item% \InsertListR[-1]{0}{\mypicture} {\lipsum[2-3]}% \item \lipsum[4] \end{itemize} \end{document} ![alt text][1] ![alt text][2] [1]: http://texnique.fr:80/osqa/upfiles/imagecoule.png [2]: http://texnique.fr:80/osqa/upfiles/imagecoule1.png

C'est votre première visite ici ? Consultez la FAQ !

×