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 a definition, written as follows:

\begin{definition}
This is a definition, in which I would like to have a few normal words.
\end{definition}

Ordinarily, the entire definition is rendered in italics. But I would like to remove the formatting from "normal," making it appear without the italics. Is there a quick way to achieve this?

share|improve this question

migrated from stackoverflow.com Nov 20 '11 at 19:03

This question came from our site for professional and enthusiast programmers.

    
Welcome to TeX.sx! Your question was migrated here from Stack Overflow. Please register on this site, too, and make sure that both accounts are associated with each other, otherwise you won't be able to comment on or accept answers or edit your question. –  Torbjørn T. Nov 20 '11 at 19:06

1 Answer 1

up vote 1 down vote accepted

You could manually alter the shape of the font using \upshape. Or, you could redefine what \itshape (switching to italic font) means by letting it default to \upshape. The latter is possible using a patch provided by the [etoolbox package][etoolbox-pkg]. However, even though the change will be local to the environment, other \itshape uses will also be made to \upshape. Perhaps this isn't a concern in this case.

enter image description here

\documentclass{article}
\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox
\newenvironment{definition}%
  {\itshape}% \begin{definition}
  {}% \end{definition}
\begin{document}
% Normal definition
\begin{definition}
  This is a definition, in which I would like to have a few normal words.
\end{definition}

% Manually corrected definition
\begin{definition}
  \upshape This is a definition, in which I would like to have a few normal words.
\end{definition}

\AtBeginEnvironment{definition}{\renewcommand{\itshape}{\upshape}}% You can also place this in your document preamble
% Automatically corrected definition
\begin{definition}
  This is a definition, in which I would like to have a few normal words.
\end{definition}

\end{document}
share|improve this answer
    
I think \textup is exactly what I am looking for. Thanks a lot! –  Shredderroy Nov 20 '11 at 18:52
1  
You can also say something like \expandafter\renewcommand\expandafter\definition{\expandafter\upshape} to redefine the (previously defined) definition environment. –  Gonzalo Medina Nov 20 '11 at 23:48

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.