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 want to change the border color of the mdframe box. By default it take black.

\documentclass{article}
\usepackage{xcolor}
\usepackage{mdframed}
\newtheorem{mdtheorem}{Theorem}
 \newenvironment{theorem}%
 {\begin{mdframed}[backgroundcolor=lightgray]\begin{mdtheorem}}%
 {\end{mdtheorem}\end{mdframed}}
 \begin{document}
 \begin{theorem}
Sample
\end{theorem}
 \end{document} 
  1. My Default output is, enter image description here

  2. My Expected output is, enter image description here

Any one suggest me the correct. I am new to LaTeX.

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

The correct way to define a new theorem environment with mdframed is through the \newmdtheoremenv command.

The option to change the color of the frame border is linecolor. If you also want to change the width of the border, use the option linewidth.

If you then want to show only the bottom of the border, set to false the options topline, rightline, and leftline.

Here is a MWE:

\documentclass{article}
\usepackage{xcolor}
\usepackage{mdframed}

\newmdtheoremenv[%
  backgroundcolor=lightgray,
  linecolor=red!60!black,
  linewidth=2pt,
  topline=false,
  rightline=false,
  leftline=false]{theorem}{Theorem}

\begin{document}
\begin{theorem}
Sample
\end{theorem}
\end{document} 

Output:

enter image description here

share|improve this answer
    
I want to set the bottom line in that environment...@karlkoeller. –  PSK Mar 6 at 13:40
    
@PSK Oh, I see. Answer edited. –  karlkoeller Mar 6 at 13:44
    
Thank you so much...its working...@karlkoeller. –  PSK Mar 6 at 13:53
add comment

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.