
У меня есть документ, в который я хотел бы вставить изображение в правом нижнем углу страницы. Я думал сделать это, создав среду minpage. Но я не могу найти способ вставить это изображение туда, куда я хотел бы. Как мне это сделать?
\documentclass[14pt]{extarticle}
\usepackage{fontspec}
\setmainfont{industry-blackitalic}
\usepackage{lipsum}
\usepackage{mwe}
\usepackage{textpos}
\usepackage{graphics}
\pagenumbering{gobble}
\begin{document}
\lipsum [1-1]\\
\newpage %------ II pagina ------------
\lipsum [1-1]\\
\newpage %-------- III pagina ------------
\lipsum [1-1]\\
\newpage %--------IV pagina --------------
\lipsum[1-1]
\end{document}
Спасибо
Ренато
решение1
Пока не совсем понятно, что вы хотите. Однако вот пример того, как использовать textpos
для печати изображений в четырех углах одной страницы (в примере первый):
\documentclass[14pt]{extarticle}
\usepackage{fontspec}
%\setmainfont{industry-blackitalic}% Removed, because not essential for the problem.
%\usepackage{lipsum}% Removed, because also loaded by mwe
\usepackage{mwe}
\usepackage[absolute]{textpos}
\usepackage{graphics}
\pagenumbering{gobble}
\begin{document}
\begin{textblock*}{\paperwidth}(0mm,0mm)% Upper
\raggedright% left edge of page
\includegraphics[page=1,width=4cm]{example-image-a4-numbered}
\end{textblock*}
\begin{textblock*}{\paperwidth}(0mm,0mm)% Upper
\raggedleft% right edge of page
\includegraphics[page=2,width=4cm]{example-image-a4-numbered}
\end{textblock*}
\begin{textblock*}{\paperwidth}(0mm,\paperheight)% Lower
\raggedright% left edge of page
\raisebox{0pt}[0pt][0pt]{\includegraphics[page=3,width=4cm]{example-image-a4-numbered}}
\end{textblock*}
\begin{textblock*}{\paperwidth}(0mm,\paperheight)% Lower
\raggedleft% right edge of page
\raisebox{0pt}[0pt][0pt]{\includegraphics[page=4,width=4cm]{example-image-a4-numbered}}
\end{textblock*}
\lipsum [1-1]%\\% You should never use \\ at the end of a paragraph!
\newpage %------ II pagina ------------
\lipsum [1-1]%\\% You should never use \\ at the end of a paragraph!
\newpage %-------- III pagina ------------
\lipsum [1-1]%\\% You should never use \\ at the end of a paragraph!
\newpage %--------IV pagina --------------
\lipsum[1-1]
\end{document}
Если вы хотите, чтобы изображения располагались в углах текстовой области, просто удалите параметр и absolute
замените его \paperwidth
на .\textwidth
\paperheight
\textheight
Если вы хотите, чтобы изображения были на каждой странице, eso-pic
проще использовать:
\documentclass[14pt]{extarticle}
\usepackage{fontspec}
%\setmainfont{industry-blackitalic}% Removed, because not essential for the problem.
%\usepackage{lipsum}% Removed, because also loaded by mwe
\usepackage{mwe}
\usepackage{eso-pic}
\usepackage{adjustbox}
\usepackage{graphics}
\pagenumbering{gobble}
\AddToShipoutPictureBG{% put the images in the background of every page
\AtPageUpperLeft{% upper left corner of the page
\adjincludegraphics[page=1,width=4cm,valign=T]{example-image-a4-numbered}%
}%
\AtPageUpperLeft{% upper
\makebox[\paperwidth][r]{% right corner of the page
\adjincludegraphics[page=2,width=4cm,valign=T]{example-image-a4-numbered}%
}%
}%
\AtPageLowerLeft{% lower left corner of the page
\includegraphics[page=3,width=4cm]{example-image-a4-numbered}%
}%
\AtPageLowerLeft{% lower
\makebox[\paperwidth][r]{% right corner of the page
\includegraphics[page=3,width=4cm]{example-image-a4-numbered}%
}%
}%
}
\begin{document}
\lipsum [1-1]%\\% You should never use \\ at the end of a paragraph!
\newpage %------ II pagina ------------
\lipsum [1-1]%\\% You should never use \\ at the end of a paragraph!
\newpage %-------- III pagina ------------
\lipsum [1-1]%\\% You should never use \\ at the end of a paragraph!
\newpage %--------IV pagina --------------
\lipsum[1-1]
\end{document}
Опять же, вы можете адаптировать эти примеры, чтобы разместить изображения по краям текстовой области вместо бумаги. Для этого снова замените \paperwidth
на \textwidth
и также замените \AtPageUpperLeft
на \AtTextUpperLeft
и \AtPageLowerLeft
на \AtTextLowerLeft
.
Вы также можете воспользоваться этим предложением, чтобы добавить изображение(я) только на одну страницу, используя вариант со звездочкой \AddToShipoutPictureBG*
.
С помощью обновленного LaTeX вы также можете использоватькрючки для отгрузки:
\documentclass[14pt]{extarticle}
\usepackage{fontspec}
%\setmainfont{industry-blackitalic}% Removed, because not essential for the problem.
%\usepackage{lipsum}% Removed, because also loaded by mwe
\usepackage{mwe}
\usepackage{adjustbox}
\usepackage{graphics}
\pagenumbering{gobble}
\AddToHook{shipout/background}{% Put the images in the background of every page
\put(0,0){% upper left corner
\adjincludegraphics[page=1,width=4cm,valign=T]{example-image-a4-numbered}%
}%
\put(0,0){% upper
\makebox[\paperwidth][r]{% right corner
\adjincludegraphics[page=2,width=4cm,valign=T]{example-image-a4-numbered}%
}%
}%
\put(0,-\pageheight){% lower left corner
\includegraphics[page=3,width=4cm]{example-image-a4-numbered}%
}%
\put(0,-\pageheight){% lower
\makebox[\paperwidth][r]{% right corner
\includegraphics[page=4,width=4cm]{example-image-a4-numbered}%
}%
}%
}
\begin{document}
\lipsum [1-1]%\\% You should never use \\ at the end of a paragraph!
\newpage %------ II pagina ------------
\lipsum [1-1]%\\% You should never use \\ at the end of a paragraph!
\newpage %-------- III pagina ------------
\lipsum [1-1]%\\% You should never use \\ at the end of a paragraph!
\newpage %--------IV pagina --------------
\lipsum[1-1]
\end{document}
Более подробную информацию о них можно найти в руководствах по эксплуатации используемых пакетов.общее руководство по крючкамдля получения информации об использовании крючков.
Примечание: Существует множество других альтернатив для размещения изображений или других материалов в фиксированном положении на отдельных или всех страницах документа. Те, что показаны здесь, вероятно, самые простые и также наиболее часто используемые. Другая возможность, очень популярная средиТикЗпользователей, показано вэтот ответкуже как комментарий связанный вопросscrlayer-scrpage
. В качестве примера довольно нетрадиционных решений здесь показано использование пакета :
\documentclass[14pt]{extarticle}
\usepackage{fontspec}
%\setmainfont{industry-blackitalic}% Removed, because not essential for the problem.
%\usepackage{lipsum}% Removed, because also loaded by mwe
\usepackage{mwe}
\usepackage{adjustbox}
\usepackage{graphics}
\pagenumbering{gobble}
\usepackage{scrlayer-scrpage}
\pagestyle{plain}
\DeclareNewLayer[%
background,%
mode=picture,%
page,
contents={%
\put(0,\paperheight){%
\adjincludegraphics[page=1,width=4cm,valign=T]{example-image-a4-numbered}%
}%
\put(\paperwidth,\paperheight){%
\makebox[0pt][r]{%
\adjincludegraphics[page=2,width=4cm,valign=T]{example-image-a4-numbered}%
}%
}%
\put(0,0){%
\includegraphics[page=3,width=4cm]{example-image-a4-numbered}%
}%
\put(\paperwidth,0){%
\makebox[0pt][r]{%
\includegraphics[page=4,width=4cm]{example-image-a4-numbered}%
}%
}%
}%
]
{cornerimages}
\AddLayersToPageStyle{plain.scrheadings}{cornerimages}
\begin{document}
\lipsum [1-1]%\\% You should never use \\ at the end of a paragraph!
\newpage %------ II pagina ------------
\lipsum [1-1]%\\% You should never use \\ at the end of a paragraph!
\newpage %-------- III pagina ------------
\lipsum [1-1]%\\% You should never use \\ at the end of a paragraph!
\newpage %--------IV pagina --------------
\lipsum[1-1]
\end{document}
Хорошая особенность этого предложения в том, что вы можете добавлять и удалять вновь объявленный слой в любой стиль страницы на любой странице, которую вы хотите. Вы даже можете объявлять новые стили страницы с этим слоем или без него. Так что не \pagenumbering{gobble}
обязательно иметь страницы только с изображениями:
\documentclass[14pt]{extarticle}
\usepackage{fontspec}
%\setmainfont{industry-blackitalic}% Removed, because not essential for the problem.
%\usepackage{lipsum}% Removed, because also loaded by mwe
\usepackage{mwe}
\usepackage{adjustbox}
\usepackage{graphics}
\usepackage{scrlayer-scrpage}
\DeclareNewLayer[%
background,%
mode=picture,%
page,
contents={%
\put(0,\paperheight){%
\adjincludegraphics[page=1,width=4cm,valign=T]{example-image-a4-numbered}%
}%
\put(\paperwidth,\paperheight){%
\makebox[0pt][r]{%
\adjincludegraphics[page=2,width=4cm,valign=T]{example-image-a4-numbered}%
}%
}%
\put(0,0){%
\includegraphics[page=3,width=4cm]{example-image-a4-numbered}%
}%
\put(\paperwidth,0){%
\makebox[0pt][r]{%
\includegraphics[page=4,width=4cm]{example-image-a4-numbered}%
}%
}%
}%
]
{cornerimages}
\DeclareNewPageStyleByLayers{imagepagestyle}{cornerimages}
\pagestyle{imagepagestyle}
\begin{document}
\pagestyle{empty}
\lipsum[1-3]
\thispagestyle{imagepagestyle}% Use the images only on this page
\lipsum[4-10]
\pagestyle{imagepagestyle}% And from this page.
\lipsum
\end{document}
решение2
Хотя ваш вопрос довольно запутанный (вы должны показать хотя бы один пример ожидаемого вами вывода и минимальный пример кода для воспроизведения вашей проблемы), я попробую «угадать», что вы хотите сделать:
\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\begin{document}
% Your document content here
\vfill % push the minipage to the bottom of the page
\noindent % prevent indentation
\begin{minipage}[b]{\linewidth}
\raggedleft % right-align the content of the minipage
\includegraphics[width=0.3\linewidth]{example-image} % replace 'example-image' with your image file name
\end{minipage}
\end{document}