I have two problems.
- I have an mechanism. It gives me correct number of lines, which I should make narrow (I have it in
\setcounter{ct}{...}). And I want to teach\addpicturethat skill and use it as default for the first optional argument. How can I do it?
In nutshell I want default value of optional argument of \addpicture to be calculated every time running this macro based on mandatory arguments of function \addpicture.
But I see that I will not success in this case because the third agrument of \addpicture is not a number of narrow lines. So,
The third argument of
\InsertBoxLis number of additional lines which should be narrower too. In documentation it is said correction. But in my function it spoils due to some mystical things. So, what it is now, and what shall I do to correct it?\documentclass{article} \usepackage{graphicx} \usepackage{forloop} \usepackage{caption} \usepackage{xargs} \usepackage{mwe} \input{insbox.tex} \usepackage{threeparttable} \newcounter{ct} \newlength\imageheight \newcount\narrowlinect \narrowlinect=0\relax \newcommandx\addpicture[4][1=5,3=0]{% \InsertBoxL{#3}{\begin{threeparttable}% \begin{tabular}{c@{}}\includegraphics[width=#4\textwidth]{#2}\end{tabular}% \captionof{figure}{}\end{threeparttable}}[#1]} \begin{document} \settoheight\imageheight{\includegraphics[width=0.45\textwidth]{example-image-a}} \narrowlinect=\imageheight\relax \setcounter{ct}{\numexpr((\narrowlinect)/\baselineskip+2)\relax} \arabic{ct} \addpicture[0]{example-image-a}[0]{0.45} \forloop{ct}{1}{\value{ct} < 30}{\arabic{ct}\newline } \end{document}


Isn't it?!
– Mar 14 '16 at 19:38wrapfigure. – Bernard Mar 14 '16 at 20:28threeparttablespoils it. I need to add this correction not only for adding place for caption (for example), but in order to make normal wrapping... It is wrong. – Mar 14 '16 at 20:31threeparttable(but you must specify the width of the image), and is simple to use. Please have a look at my completed answer – Bernard Mar 14 '16 at 20:54And by the way, do you have an idea about the first question?
– Mar 14 '16 at 21:06insboxcan work in the neighbourhood of lists, but it's a liitle harder to make it work. I have a solution, though, if you need it. For your first question, at first sight, I do not really understand what it does, but I' take a closer look tomorrow. That said, my solution works for one-lined captions. Do you have that many longer captions? – Bernard Mar 14 '16 at 21:22I need your solution for lists. please, give it to me. all of my time I am just trying to solve problem of wrapping in theorems, in lists. Particulary, when my picture is located to the left of the list
– Mar 14 '16 at 21:30There are my problems... Please, take look at my own answer -- there are my tryings. I will try your variants also.
– Mar 14 '16 at 22:03