GeneralFlexibility for Definition of new Command

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Dangi
Posts: 2
Joined: Thu Aug 15, 2013 4:22 pm

Flexibility for Definition of new Command

Post by Dangi »

Hi!

I need a way to mark parts in my thesis as preliminary. I want to be flexible in the way to set the unfinished text apart from the finished text.

When I have \newcommand{\fixit}{\Large}. I then use it as follows.

Code: Select all

{\fixit here are rough ideas that need pondering}
Sadly, if I decide I want another way of distinguishing the texts I am not flexible:

Code: Select all

\newcommand{\fixit}{\emph}       %consider \marginpar instead of \emph
The use is like this.

Code: Select all

\fixit{here are rough ideas that need pondering}
I would have to go through all the pages and set the braces manually at its new place. This is what I absolutely want to avoid. Also I don't want to write a string substitution program :-).

I'm not clinging to \newcommand if a better idea suits the purpose.

I believe LaTeX offers a solution. Only I don't find it, please help.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

cgnieder
Site Moderator
Posts: 2000
Joined: Sat Apr 16, 2011 7:27 pm

Flexibility for Definition of new Command

Post by cgnieder »

Hi Dangi,

Welcome to the LaTeX community!

For every font changing command like \emph{}, \textit{}, \textbf{}, \textsc{} etc there is also a switch: \em, \itshape, \bfseries, \scshape.

This means defining

Code: Select all

\newcommand{\fixit}{\em}
would work for you example.

I would probably define the command in a slightly different way, though:

Code: Select all

\documentclass{article}

\newcommand\fixit[1]{{\fixitformat{#1}}}
\newcommand\fixitformat{\Large}

\begin{document}

Text \fixit{Text} Text

\renewcommand\fixitformat{\emph}

Text \fixit{Text} Text

\end{document}
By the way: there are some packages which help for tasks like this: todo, todonotes, changes just to mention a few.

Regards
site moderator & package author
Dangi
Posts: 2
Joined: Thu Aug 15, 2013 4:22 pm

Flexibility for Definition of new Command

Post by Dangi »

Hi cgnieder,

and thanks for your reply! It works with your code suggestion for the definition! I also had a look at the suggested packages, great help!

Dangi
Post Reply