Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have this:

\usepackage{picins}
\shadowthickness{2pt}
\newcommand{\sidenote}[1]{
    \begin{center}
    \hpic(0.95\textwidth,0pt)[rs]{
        \parbox[b]{0.9\textwidth}{\small
             \bigskip{#1}\bigskip
        }
    }
    \end{center}
}

Which generates a nice (shadowed) box with padding. The problem is that \sidenote cannot accept formatted text (i.e. paragraphs).

Is it possible to define a "FancyRemark" environment which has the same visual style but does allow for paragraphs and display style math?

share|improve this question
    
Assuming you want an output similar to the current answer, I would use mdframed- it allows you to tweak everything very easily... –  cmhughes Jan 29 '13 at 22:33

2 Answers 2

up vote 3 down vote accepted

Sorry, picins somehow does not seem to work at the moment, on this machine.

This is what I guess you wanted:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shadows}
\usepackage{environ}
\NewEnviron{sidenote}{%
  \begin{tikzpicture}[font=\normalsize]
      \node [text width=0.9\linewidth,draw,drop shadow,fill=white,inner sep=10pt]{%
           \BODY
        };
   \end{tikzpicture}
}
\begin{document}
\begin{sidenote}
  sfasdfasdfasdf
\begin{equation}
1+2=3
\end{equation}
\end{sidenote}
\end{document}

Example figure

Please give me a preview, if you want me to tweak the looks to your expectations.

share|improve this answer
    
That's great. Thank you. If I could just get a parameter for `cellpadding' within the box I can tweak the values on my end. –  vrbatim Jan 29 '13 at 22:02
    
I assume you mean padding as in HTML5 http://www.w3schools.com/tags/att_table_cellpadding.asp ? That would be inner sep. I inserted that with 10pt. Any TeX dimension is allowed. –  user24276 Jan 29 '13 at 22:08
    
Thanks again for your help. I appreciate it. –  vrbatim Jan 29 '13 at 23:03
    
Followup question: How can \sidenote be made to respect the current font size? (It seems to be outputting 12pt whereas the document is set to 11pt). –  vrbatim Feb 11 '13 at 18:12
    
It should be typeset in normalsize, but I added an option to force it, just to be sure. –  user24276 Feb 11 '13 at 19:39

Here are some options using environments defined with the help of the mdframed and tcolorbox packages; the advantage of using these packages is that the offer an easy customization mechanism and the frames allow page breaks:

\documentclass{article}
\usepackage{picins}
\usepackage[most]{tcolorbox}
\usepackage[framemethod=tikz]{mdframed}
\usetikzlibrary{shadows}

\newmdenv[
leftmargin=10pt,
rightmargin=10pt,
innertopmargin=10pt,
innerbottommargin=10pt,
shadow=true,
]{mdsidenote}

\newtcolorbox{tsidenote}{
breakable,
enhanced,
colback=white,
width=\dimexpr\linewidth-20pt\relax,
enlarge left by=10pt,
shadow={1mm}{-1mm}{0mm}{black!40}
}

\shadowthickness{2pt}
\newcommand{\sidenote}[1]{
    \begin{center}
    \hpic(0.95\textwidth,0pt)[rs]{
        \parbox[b]{0.9\textwidth}{\small
             \bigskip{#1}\bigskip
        }
    }
    \end{center}
}

\newcommand\Text{% just to generate text for the example
Quisque ullamcorper placerat ipsum. Cras nibh. Morbi vel justo vitae lacus
tincidunt ultrices. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In hac habitasse platea dictumst.}

\begin{document}

\sidenote{some text goes here}

\begin{mdsidenote}
Some text inside the environment; a displayed expression and some paragraphs:
\[
a + b = c + d+ e.
\]
\Text\par\Text
\end{mdsidenote}

\begin{tsidenote}
Some text inside the environment; a displayed expression and some paragraphs:
\[
a + b = c + d+ e.
\]
\Text\par\Text
\end{tsidenote}

\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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