Text FormattingMargin shift in the middle of a page.

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
evans
Posts: 5
Joined: Tue Apr 24, 2012 2:51 pm

Margin shift in the middle of a page.

Post by evans »

Hi,
Can anyone help me on this: Within the middle of a page I would like to move the left margin or the hoffset to the middle of the page and insert some text aligning it the way i want.
As in this example(but it doesnt work, just to explain the idea)

Code: Select all

\documentclass{article}
\begin{document}
%some text here.
\begin{minipage}
\setlength{\hoffset}{5cm}
%some text aligned before and after the margin
\end{minipage}
\end{document}
I hope I have been able to make it clear. Thank you in advance for your help.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Margin shift in the middle of a page.

Post by localghost »

For indentation of a whole paragraph you can us a combination of \hangindent and \hangafter.

Code: Select all

\documentclass[11pt]{article}
\usepackage[T1]{fontenc}
\usepackage{lipsum}

\setlength{\parindent}{0em}

\begin{document}
  \lipsum[1]

  \medskip
  \hangindent2em
  \hangafter=0
  \lipsum[2]

  \medskip
  \lipsum[3]
\end{document}
There are other possible approaches, e. g. a customizes {quote} environment.


Best regards and welcome to the board
Thorsten
evans
Posts: 5
Joined: Tue Apr 24, 2012 2:51 pm

Margin shift in the middle of a page.

Post by evans »

Thank you. But what I would want to do is to be able to produce something like a keyword in context display within a page. For Example:
For example I can have text here like on a normal page and then within the page I would like to have something like this(without the dots):
..........................aerospace control
..................CMOS analogue
.................lattice Boltzmann
Then some other text will follow on the same page.
So as you can see I want to align text with respect to the middle of the page(highlighted text on right and the unhighlighted text on left as shown).
I am able to do this by changing the hoffset to the middle of the page when the display is the only thing on the page else its not possible to reset the hoffset when I already have some text on the page. Thank you and waiting for your help.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Margin shift in the middle of a page.

Post by localghost »

I guess you are searching for something like the {description} environment. Such lists can be enhanced by the enumitem package.
Post Reply