Change \imath Command for LaTeX

  • Context: LaTeX 
  • Thread starter Thread starter coyote_001
  • Start date Start date
  • Tags Tags
    Change
Click For Summary

Discussion Overview

The discussion revolves around the use of the \imath command in LaTeX, specifically addressing a request to change the symbol to one with a dot. Participants explore methods for efficiently replacing instances of \imath in a lengthy document without manually editing each occurrence.

Discussion Character

  • Technical explanation
  • Debate/contested
  • Homework-related

Main Points Raised

  • One participant expresses difficulty in changing the \imath command due to the size of their document and the number of equations involved.
  • Another suggests using a find/replace function in a text editor to replace all instances of \imath with \dot{\imath} or simply 'i'.
  • A participant points out that redefining \imath with a dot may lead to recursive substitution errors in LaTeX.
  • It is proposed that instead of redefining \imath, a new command \myi could be created to represent the dotted version, avoiding issues with the original command.
  • One participant mentions using the sed command for batch replacements in a single line, providing links for reference.

Areas of Agreement / Disagreement

Participants generally agree that redefining the \imath command can lead to complications, but there is no consensus on the best method to implement the change. Some favor using find/replace functions, while others suggest creating a new command.

Contextual Notes

There are unresolved concerns regarding the potential for errors when redefining commands in LaTeX, as well as the efficiency of different methods for replacing symbols in large documents.

Who May Find This Useful

This discussion may be useful for students and professionals working with LaTeX who need to modify commands or symbols in lengthy documents, particularly in the context of mathematical or scientific writing.

coyote_001
Messages
7
Reaction score
0
change imath command (LaTeX)

Hello,
I have a question about the \imath command... :confused:

I am a physics student and I wrote a huge document with many equations. In some equations there is the \imath symbol. When my professor saw this document he told me to change the symbol and use one with a dotted \imath.

So I thought to change the \imath command and use at the beginning


Code:
 \renewcommand{\imath}{\ensuremath{\dot{\imath}}}


but when I compile the document using this command the compiler comes with some errors concerning the \imath symbol.

There are a lot of \imath symbols in my document and changing them one by one it is going to take a lot of time :cry: .

Thank you in advance!
 
Last edited:
Physics news on Phys.org
What text editor are you using? You can just find/replace all and replace \imath with \dot{\imath} (or just i)!
 
What text editor are you using?
The question is about LaTeX...

You can just find/replace all and replace \imath with \dot{\imath} (or just i)!

It will take hours to replace one by one the symbol \imath, because the document is more than 150 pages and more than 400 equations.
 
coyote_001 said:
The question is about LaTeX...

Yes, but my point was that, if you're using a standard text editor, you can use the built in "find & replace all" function to replace all the occurances of \imath. This will have less potential for causing problems than redefining characters.

However, if you wish to do that, then use something like \renewcommand\imath{i}

(Latex doesn't like you dotting \imath, for some reason).
 
The problem is that your redefinition uses the original command, causing LaTeX to substitute it over and over:

\imath

\ensuremath{\dot{\imath}}

\ensuremath{\dot{\ensuremath{\dot{\imath}}}}

\ensuremath{\dot{\ensuremath{\dot{\ensuremath{\dot{\imath}}}}}}

...

I would recommend replacing it everywhere -- 150 pages of replacements should take Notepad 10 seconds or any modern editor < 50 ms. But I would replace \imath with \myi and define
\define{\myi}{\ensuremath{\dot{\imath}}}
(replacing \myi with some appropriate name).
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
8K
  • · Replies 36 ·
2
Replies
36
Views
3K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 11 ·
Replies
11
Views
6K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 23 ·
Replies
23
Views
3K
  • · Replies 7 ·
Replies
7
Views
3K