2

I would like to define a new environment, which I can use to change the appearance of my text locally.

Specifically, I would like to have certain sections look like this, with indentation, smaller and title in bold.

indent_everything_that_follows{ {\footnotesize \textbf{Example: } a few paragraphs here } } 

Thank you!

1
  • I've recently added an example in tex.stackexchange.com/questions/16494/… . It automatically adds a number and a title to the env and you can create a listof with the title in it. You might have to rearrange some things for your needs. Commented Apr 18, 2018 at 13:52

2 Answers 2

0

Starting from here, I defined an environment myindent that takes a title is mandatory argument and prints the text indented by 1cm, in \scriptsize and with the title in boldface.

\documentclass{article} \usepackage{lipsum} \newenvironment{myindent}[1]{\list{}{\leftmargin=1cm}\item\footnotesize\textbf{#1}}{\endlist} \begin{document} \lipsum[1] \begin{myindent}{Example:} \lipsum[2-3] \end{myindent} \lipsum[3] \end{document} 

enter image description here

0

Here is one approach, assuming you always want the title to be Example:

\documentclass{article} \usepackage{lipsum} \newenvironment{myindent}{% \setlength{\leftskip}{3em} \footnotesize \noindent\textbf{Example:}\par\smallskip } {} \begin{document} \lipsum[1] \begin{myindent} \lipsum[2-3] \end{myindent} \lipsum[4] \end{document} 

enter image description here

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.