1

A related question to my question is this question, where it is discussed how to scale an object to a certain proportion of textwidth. However, what if I want to make an object 0.5 cm wider than textwidth?

I tried using length = \textwidth + 0.5 doesn't seem to work

J. Doe
  • 176
  • 2
    length = \dimexpr \textwidth+0.5cm could work (but as you didn't provide an example it is only a guess ) – Ulrike Fischer Apr 01 '22 at 14:37
  • On which side image can spill out from text area? – Zarko Apr 01 '22 at 15:07
  • Another simple way would be \newlength{\mywidth}\setlength{\mywidth}{\textwidth}\addtolength{\mywidth}{0.5cm}; but if you want the overflow to be balanced between left and right margins you may need to do more. – frabjous Apr 01 '22 at 15:43

2 Answers2

2

With use of the changepage package is simple. For example:

\documentclass{article}
%---------------- Show page layout. Don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%---------------------------------------------------------------%
\usepackage{lipsum}% For dummy text. Don't use in a real document

\usepackage{graphicx} \usepackage[strict]{changepage}

\begin{document} \begin{figure}[ht] \begin{adjustwidth}{}{-5mm} % <--- new \includegraphics[width=\linewidth]{example-image-duck} \end{adjustwidth} \end{figure} \lipsum[1][1-4] \end{document}

\lipsum[1][1-4]

(redlines indicate (part of) page layout)

Zarko
  • 296,517
2

For example in OpTeX:

\line{\hss \picw=\dimexpr\hsize+0.5cm \inspic{image.jpg}\hss}
wipet
  • 74,238