I want text to flow pictures. @Bernard adviced me this way of doing it with formulas and theorems. Thanks him, it works great in many cases better than any other variants I have ever seen. I have reworked it for my wishes.
But there are several problems.
zero. How to set default value of optional argument exactly in function?
- See the first prinscreen. Distance between left edge of paragraphs and left edge of the page are different! It is awful. Item 2 is natural. Text in the first item should be nearer to the left edge of paper.
the first:
- See the second printscreen. Text in the second item is over picture! It is awful. and I do not want to add picture earlier in code. I want text in the second item to flow it. I mean that text relating to the second item should flow the picture relating to the first item. (solution to do
\addpictureafter the seconditemis not correct)
the second:
In my function I used very unprofessional (I guess) mechanism of labeling pictures. Can you advice me some better variants?
- See the third printscreen and the second page of document. How cannot I do a new paragraph after proof here. I want word "Fusce" to follow "Proof" on the same line. I know that
\leavevmodemakes new line, but without it I get very bad result (you can see it at the fourth printscreen)
- See the third printscreen and the second page of document. How cannot I do a new paragraph after proof here. I want word "Fusce" to follow "Proof" on the same line. I know that
the third:
the fourth:
PS. If you know solution not using constructions below, please tell me.
PPS. In two words my questions are: How to make an ideal full automatic command of inserting pictures in latex? I want to make it as easy as possible.
PPPS. I have deleted quetion about odd and even pages, because it was solved: (If Then Else for odd page/even page).
PPPS. See my own anwer to get my success (or not) in this case.
\documentclass{article}
\usepackage{graphicx}
\usepackage{amsthm}
\usepackage{caption}
\usepackage{lipsum}
\usepackage{changepage}
\usepackage[colorlinks]{hyperref}
\usepackage{xargs}
\usepackage{mwe}
\newcounter{pictnumber}
\renewcommand{\thepictnumber}{\arabic{pictnumber}}
\input{insbox.tex}
\usepackage{threeparttable}
\newcommandx\myaddpicture[4][1=5,3=0]{\refstepcounter{pictnumber}%
\InsertBoxR{#3}{\begin{threeparttable}%
\begin{tabular}{c@{}}\includegraphics[width=#4\textwidth]{#2}\end{tabular}%
\captionof{figure}{}\end{threeparttable}}[#1]}
\begin{document}
\begin{proof}
\begin{enumerate}
\item
\lipsum[1]
\addpicture{example-image-a}{0.3}
\lipsum[2]
\addpicture{example-image-a}{0.3}
\item
\lipsum[3]
\end{enumerate}
\end{proof}
\newpage
\begin{proof}\leavevmode
\addpicture{example-image-a}[2]{0.45}
\lipsum[5]
\end{proof}
\end{document}








Can you help with
– Mar 07 '16 at 07:31\rightskip? My first attempts were very bad.I use
\rightskipwith success in each case.Your variant is kind of manual work. I have hundreds of pictures. And I have manual macroses, that consume all my wishes, but I am sure with power of LaTeX it is possible to do that automatically.
– Mar 07 '16 at 18:06lipsum, when I was writting this question. But when I try to solve this, I meet many problems with formulas and their huge number in my book, so I decided not to uselipsum.But if you wish, I did it. Take a look.
– Mar 09 '16 at 18:10demo? Well, I will use it too, but again I was thinking about it -- if you see a black square, you will not see text overlay in its full manifestation... Oh, but you are right about "just copy and paste". I will take that into account. – Mar 09 '16 at 18:32demooption,filecontentspackage - whatever you have to do to present working copypastable example of problems of minimum size (in your case it probably should compile to three pages to be able to test even and odd pages). – Leonid Mar 09 '16 at 18:40Microsoft Word process of adding picturesso saying that you want something like this means as much to me as describing what you want in Chinese. Actually, less, because I could at least run Chinese through Google translate. It is years and years since I had to add a picture in Word. At that time, it was very far from being simple! – cfr Mar 12 '16 at 22:21mwepackage if black boxes make it difficult to see the problem.\includegraphics{example-image-a}will work on any system with a standard installation of TeX. – cfr Mar 12 '16 at 22:24insbox.tex: it is part of standard TeX distributions, just asthreeparttable.styis and should be equally unproblematic. (The.texextension should be unneeded, of course, but won't stop it working.) – cfr Mar 12 '16 at 22:26I am sure that with power of LaTeX it can be solved.
– Mar 12 '16 at 22:58