3

I would like to implement Note style fields like in here (excerpt from https://developer.android.com/training/graphics/opengl/environment.html#manifest for demonstration)

enter image description here

How can I do this in LaTeX ?

P.S. Please change the tags if I have chosen the wrong ones.

EDIT

I have came up with something more or less like this:

\vspace{1em}\hspace{1.5em}
\hbox{%
\vrule\hspace{.5em}\parbox{.9\textwidth}%
{
\textbf{Note:}
Text.....
}
}
\vspace{1em}

Which produces:

enter image description here

But I am having problems to define an environment with this.

6

What about something more similar to the one you are trying to copy, made with mdframed?

enter image description here

Code:

\documentclass{article}

\usepackage[framemethod=TikZ]{mdframed}

\usepackage{lipsum} % just for the example

\newmdenv[%
    rightmargin = -10pt,
    skipabove = 1.2\topskip,
    rightline = false,
    topline = false,
    bottomline = false,
    innertopmargin = 2pt,
    innerbottommargin = 2pt,
    linewidth = 2pt,
    linecolor = cyan
]{leftlined}

\newenvironment{note}
  {\leftlined\textbf{Note:}}
  {\endleftlined}

\begin{document}

\noindent\lipsum[1]

\begin{note}
\lipsum[2]
\end{note}

\noindent\lipsum[1]

\end{document} 

I've first defined a new mdframed environment called leftlined and then I've used it to define a new environment note that adds the text "Note:" at its beginning.

0

I have finally defined environment for this :

\newenvironment{note}[1]
  {
  \vspace{1em}\hspace{1.5em}
  \hbox{%
  \vrule\hspace{.5em}\parbox{.9\textwidth}%
  {
  \textbf{Note:}
  #1
  }}}
  {\vspace{1em}}

To be used as follows:

\begin{note}
{"Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
nisi ut aliquip ex ea commodo consequat.
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum
dolore eu fugiat nulla pariatur.
Excepteur sint occaecat cupidatat non proident, sunt in culpa qui
officia deserunt mollit anim id est laborum."}
\end{note}

Which would produce: enter image description here

  • It is probably fine but not "breakable" at a break page. A solution with mdframed is better in this regard. – pluton Jan 15 '14 at 3:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.