3

After I compile a document containing math content in WinEdt, keep it open, switch to another task (say opening the browser and viewing the tex.stackexchange.com site) and then when I return, I get the document math content like the below picture. When I close and open the document also, It is the same. What is the issue?

enter image description here

The output the corresponding code generates is:

enter image description here

Note

There are no issues with the compilation. But I am not able to understand, what code I have written when I view it next time.

Here is my source code:

Mainfile:

\documentclass[12pt, a4paper]{book}
\usepackage{setspace}
\usepackage[many]{tcolorbox}
\usepackage[detect-all]{siunitx}
\DeclareSIUnit\gauss{G}
\usepackage[pagestyles]{titlesec}
\usepackage{amsmath}
%\usepackage{empheq}
%%--------tcolorbox setting for the SI Units display---------%%
\newtcolorbox{siunit}{enhanced,
  colframe=red!60!black,colback=yellow!50!white,arc=4pt,boxrule=1pt,
  drop fuzzy shadow,before=\begin{center},after=\end{center},hbox}
%\tcbset{highlight math style={enhanced,
%  colframe=red!60!black,colback=yellow!50!white,arc=4pt,boxrule=1pt,
%  drop fuzzy shadow}}
\newtcbox{\picturebox}[1][]{nobeforeafter,math upper,tcbox raise base,
  enhanced,watermark graphics=example-grid-100x100bp.jpg,% from package mwe
  colback=white,frame hidden,boxrule=0pt,arc=10pt,
  watermark stretch=1.00,watermark opacity=0.4,#1}
%%--------Chapter and Section headings display------------%%
\makeatletter
\renewcommand{\thechapter}{\Roman{chapter}}
\titleformat{\chapter}[display]
{\bfseries\LARGE\filleft} %\centering doesn't work only \filleft
{\filleft\MakeUppercase{\chaptertitlename} \Huge\thechapter}
{4ex}
{\titlerule
\vspace{2ex}%
\filright}
[\vspace{2ex}
\titlerule]

\renewcommand{\thesection}{\Roman{section}}
\titleformat{\section}
{\Large\bfseries}
{}{1em}{}
\titlespacing{\section}
{-2.15pc}{3.5ex plus .1ex minus .2ex}{1.5ex minus .1ex}

\titlespacing*{\paragraph} {0pt}{3.25ex  plus 1ex minus .2ex}{0.35em}
\makeatletter

\newpagestyle{mystyle}{
\headrule \sethead[\thepage][][\chaptertitlename\ \thechapter. \chaptertitle]
{\sectiontitle}{}{\thepage}}

\begin{document}
\pagestyle{mystyle}
\frontmatter
\begin{titlepage}

\end{titlepage}
\mainmatter
\include{magnetic}
\end{document} 

magnetic.tex:

\chapter{Magnetic Materials}
\section{Introduction}
Magnetic materials have had various applications in ancient and modern society. A magnetic compass made of lodestone (magnetite) was used for navigation since the north pole of a compass point toward the south pole of Earth's magnetic field. In the modern era, magnetism and magnetic materials find applications in various fields.

\section{Origin of Magnetic properties of materials}
Magnetic properties of materials have their origin in :
\begin{enumerate}
\item Permanent magnetic moments of their atoms and$/$or
\item Induced magnetic moments due to the change of motion of the electric charges of the atoms in an external magnetic field.
\end{enumerate}
The magnetic moments of atomic nuclei are generally neglected as they are very small.

\paragraph{Permanent magnetic moment of atoms}is due to the orbital and spin motions of unpaired electrons (i.e., electrons in the incompletely filled valence shell). Electrons in completely filled valence shells have no magnetic moment.(Eg. He, Ne, Ar etc). Some of the important terms in the study of magnetic materials is given below.

\paragraph{Magnetic fields}are generated by movement of electric charges. \textit{\bfseries Magnetic field} is the region of space where moving charges, current carrying elements or other magnetic objects will experience a force.

\paragraph{Magnetic moment}of a magnet is a quantity that determines the force the magnet can exert on electric currents and the torque that a magnetic field will exert on it. A loop of electric current generates a \textit{magnetic dipole field}. \textit{Magnitude} of the magnetic dipole moment is the product of the current and the area of the loop. Magnetic dipole is often represented schematically as an arrow. The head of the arrow is the North pole.\par
\begin{siunit}
SI unit :  Ampere. square metre (\si{\ampere\square\meter})
\end{siunit}

\paragraph{Magnetic Field lines} run from the North pole to the South pole.
\paragraph{Magnetic Flux}The group of magnetic field lines emitted outward from the north pole of a magnet is called \textit{magnetic flux}.\par
\begin{siunit}
SI~unit :  Weber (\si{\weber})
\end{siunit}
One weber is equal to $1$ x $10⁸$ magnetic field lines. Direction of flux at any point in space indicates the direction of force that would be experienced by a North pole placed at that point.

\paragraph{Intensity of Magnetization M}A Material with a net (nonzero) magnetic moment is magnetized. \textit{Intensity of Magnetization M} is the magnetic moment per unit volume within the material.\par
\begin{siunit}
SI unit :  Ampere per metre (\si{\ampere\per\meter})
\end{siunit}
M depends on the following:
\begin{enumerate}
\item Number density of magnetic dipole moments within material.
\item Magnitude of the magnetic dipole moments.
\item The arrangement of the magnetic dipoles within the material and so on.
\end{enumerate}

\paragraph{Magnetization M}in materials mainly arises from spins of unpaired electrons within the material and to a lesser extent from their orbital motion.

\section{Magnetic field}
A \textbf{magnetic field} is a field of force produced by moving electric charges, by electric fields varying with time and by the \textbf{intrinsic} magnetic field of elementary particles due to their spin. Magnetic field is a vector field and is most commonly defined in terms of the Lorentz force that it exerts on moving electric charges. The magnetic field can be visualized as magnetic field lines.\par
There are two separate but closely related fields to which the name 'magnetic field' can refer:
A magnetic \textbf{B} field called \textit{magnetic induction} or \textit{magnetic flux density} \par
%{\centering \tcbox{SI unit :  tesla, T}} %%tcolorbox not properly aligned when using \centering -- thought will complete in a single line
\begin{siunit}
SI unit :  tesla, \si{\tesla}
\end{siunit}
and  a magnetic \textbf{H} field called \textit{magetic field strength} or \textit{magnetizing field}\par
%{\centering \tcbox{SI unit :  Ampere per metre $A.m⁻¹$}}
\begin{siunit}
SI unit :  Ampere per metre (\si{\ampere\per\meter})
\end{siunit}
Magnetic field strength \textbf{H} is measured in \si{\ampere\per\meter}, and magnetic flux density \textbf{B}, measured in \si{\newton\meter\per\ampere}, also called tesla (\si{\tesla}).

\paragraph{Magnetic flux density or magnetic induction B}\textit{Magnetic Flux density} \textbf{B} is the amount of magnetism induced in a body and it is a function of the \textit{magnetizing force} \textbf{H}.
The \textit{magnetic induction}, \textbf{B} is defined as the amount of magnetic flux through a unit area taken perpendicular to the direction of the magnetic flux.
\begin{siunit}
\begin{minipage}{0.75\linewidth}
SI unit  : Weber per metre square (\si{\weber\per\square\meter}) or tesla (\si{\tesla})
\par
CGS unit  : gauss ($\SI{1}{\tesla} = \SI{10000}{\gauss}$)
\end{minipage}
\end{siunit}

\paragraph{Manetic field strength, H}Magnetic field strength \textbf{H} is the amount of magnetizing force. Magnetic field strength is a vector quantity whose magnitude is the strength of a magnetic field at a point in the direction of the magnetic field at that point.
\begin{siunit}
SI~unit  : Ampere~per~metre (\si{\ampere\per\meter})
\end{siunit}

\section{Relation between B and H}
\textit{In free space or outside of a material (i.e., in vacuum) the \textbf{B} and \textbf{H} fields are indistinguishable (they only differ by a multiplicative constant).}
\begin{gather*}
B = \mu_{0}.H \quad \text{(in vaccum)} \\
\mu_{0}         → \text{magnetic permeability of free space (vacuum)}
\end{gather*}
where $\mu_{0} = 4\pi~\text{x}~10⁷ N.A⁻²~(H.m⁻¹)$ \par
Inside magnetic material,  $B = \mu.H = \mu_{0}.H + \mu_{0}.M $ where $\mu$ is the \\ \textit{magnetic permeability of medium}.

\paragraph{Magnetic Permeability $\mu$}refers to the degree of magnetization of a material in response to an applied magnetic field.

\begin{siunit}
SI~unit  : Newton~per~square~Ampere (\si{\newton\per\square\ampere})
\end{siunit}
The relation between $\mu$ and  $\mu₀$ is given by $μ= \mu₀.\mu_r$ where $\mu_r$ is the relative permeability of the medium. $\mu_r  = 1$ for free space (vacuum) and  $\mu_r  > 1$  for magnetic materials. The larger the value of $\mu_r$, the larger will be the degree of magnetization of the material in an external magnetic field.\par
Unlike \textbf{B}, magnetization \textbf{M} only exists inside a magnetic material. \\Therefore, field lines of \textbf{M} begin and end near magnetic poles.\par
Magnetic flux density \textbf{B} inside a magnetic material with intensity of  magnetization \textbf{M} is given by
\begin{align}
B &= \mu.H \notag \\
B &= \mu₀.H + \mu₀.M
\intertext{As $μ= \mu₀.\mu_r$,}
B &= \mu₀.\mu_r.H \notag \\
B &= \mu₀(H + M) \label{eq:2}
\end{align}
Using equation~\eqref{eq:2}, it is obtained that $χ= (M/H) = \mu_r-1$

Notice in the second file, how characters have changed example for (\mu and \chi)

I am using WinEdt 8 and Windows 7 professional

  • As you write this, it looks like a bug to me when the windows paint event (or another event) is called. Maybe you should visit the maintainers website and check if it's a known bug / inform the maintainer. – musicman May 19 '14 at 16:42
  • Ye really ought write \mu_0 rather than to insert an unicode character here. – wendy.krieger May 20 '14 at 4:27
  • Please indicate which version of WinEdt and which version of Windows you use. – Mico May 20 '14 at 4:37
  • @Mico please see my edit – subham soni May 20 '14 at 4:46
9

In your WinEdt you must have customized and enabled translation tables (or else someone else did it in your copy of the program without you knowing it). By default they are not enabled and do not translate any Greek characters like \mu or \chi.

You may not be aware of it but some packages on winedt.org introduce translation tables that would result in the described "feature". For example, MathGreek package installs read and write translation tables that among other things convert Greek symbols into their Unicode equivalents and vice versa.

In WinEdt you see:

\begin{align}
B &= \mu.H \notag \\
B &= \mu₀.H + \mu₀.M
\intertext{As $μ= \mu₀.\mu_r$,}
B &= \mu₀.\mu_r.H \notag \\
B &= \mu₀(H + M) \label{eq:2}
\end{align}
Using equation~\eqref{eq:2}, it is obtained that $χ= (M/H) = \mu_r-1$

Opening the same file in Notepad you see "proper" source code as previously typed:

begin{align}
B &= \mu.H \notag \\
B &= \mu_0.H + \mu_0.M
\intertext{As $\mu = \mu_0.\mu_r$,}
B &= \mu_0.\mu_r.H \notag \\
B &= \mu_0(H + M) \label{eq:2}
\end{align}
Using equation~\eqref{eq:2}, it is obtained that $\chi = (M/H) = \mu_r-1$

Solution: Save all documents, start Options Interface (Options Menu) and double click on Translation Tables. You will likely find something like:

TABLE="TeX_Read"
  TYPE=1
  INVERTED=0
  ENABLED=1
  MODE_FILTER="TeX"
SUB="END_LIST"
  "!`" -> "¡"
  "?`" -> "¿"
...
  "\mu " -> "μ"
  "\chi " -> "χ"
  "_0" -> "₀"
etc...

and the inverse translation for TABLE="TeX_Write". Disable BOTH(!!!) tables (ENABLED=0), reload the modified script, and restart WinEdt.

By default these tables are not enabled and there are no entries for \mu or \chi. They must have been enabled and modified on your side. Some users might consider this a feature. Since Read and Write translation table cancel each other this only affects the way WinEdt displays your text and not the way the file is saved and seen by TeX: that's why you have no problems with compilation. Read and Write translation tables were originally used to handle international characters in TeX notation (eg. \^{A} ->  for read and  -> \^{A} for write).

  • 1
    Welcome to TeX.SE! As it currently stands, your posting resembles a list of queries for more information rather than an answer. Hopefully, the OP will respond and provide some more pertinent information, allowing you to modify your posting to make it more of an answer. – Mico May 19 '14 at 22:12
  • If you don't mind... are you the author of winedt by any chance? Welcome to the site. :) – user11232 May 19 '14 at 22:31
  • 2
    @alex: that is great. You are here at last :) You may add @username before the comment (like I did) so that it is notified to the user. For details you may please read our starter guide. – user11232 May 19 '14 at 23:32
  • 5
    Please don't downvote!. This is not the way to welcome the author of winedt. I am glad that he is here. – user11232 May 19 '14 at 23:35
  • 2
    @subhamsoni: That may be correct but a different set of translation tables were enabled when you installed MathGreek package from winedt.org. Those translation tables are responsible for the described behavior. Case closed... – alex May 20 '14 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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