Can anyone tell me how to put the formula for faraday's law in LaTeX?
This is the formula I want
emf=(Delta.Phi)/(Delta.t)
thanks
math-modephysics
Can anyone tell me how to put the formula for faraday's law in LaTeX?
This is the formula I want
emf=(Delta.Phi)/(Delta.t)
thanks
The simplest way to cope with this is to define a new command for a breakable comma:
\documentclass{article}
\newcommand{\bcomma}{,\allowbreak}
\begin{document}
Figure \ref{figure:example graph} shows an example of a graph
$G = (\{v_{1}, \dots, v_{5}\},
\{(v_{1}, v_{2})\bcomma
(v_{2}, v_{3})\bcomma
(v_{1}, v_{3})\bcomma
(v_{2}, v_{5})\bcomma
(v_{3}, v_{4}),
(v_{4}, v_{5})\})$
with $|V| = n = 5$ vertices and $|E| = m = 6$ edges.
\end{document}
I'd prefer not to use \bcomma
after the list of vertices and before the last edge, but in an emergency you can change also those.
A more complex solution can be written with LaTeX3 facilities:
\documentclass{article}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\mathlist}{ O{,} m m }
{
\egreg_mathlist:nnn { #1 } { #2 } { #3 }
}
\seq_new:N \l__egreg_mathlist_seq
\cs_new_protected:Npn \egreg_mathlist:nnn #1 #2 #3
{
\seq_set_split:Nnn \l__egreg_mathlist_seq { #1 } { #3 }
\seq_use:Nnnn \l__egreg_mathlist_seq { #2 } { #2 } { #2 }
}
\ExplSyntaxOff
\begin{document}
Figure \ref{figure:example graph} shows an example of a graph
$G = (\{\mathlist{,}{v_{1}, \dots, v_{5}}\},
\{\mathlist[;]{,\allowbreak}
{(v_{1}, v_{2});
(v_{2}, v_{3});
(v_{1}, v_{3});
(v_{2}, v_{5});
(v_{3}, v_{4});
(v_{4}, v_{5})}
\})$
with $|V| = n = 5$ vertices and $|E| = m = 6$ edges.
\end{document}
The \mathlist
command has an optional argument (the item separator, default a comma); the first mandatory argument tells what to put in place of the separator, the second argument is the list.
The first usage of \mathlist
in the example is of course redundant; the second one isn't: since the comma is used in the ordered pairs, I choose a semicolon as separator and it's substituted after processing by ,\allowbreak
as in the simpler definition above.
If the list of edges is stored in a macro, the method above doesn't work. But the definition can be extended to cope with this case:
\documentclass{article}
\usepackage{xparse}
\ExplSyntaxOn
\NewDocumentCommand{\mathlist}{ s O{,} m m }
{
\IfBooleanTF{#1}
{ \egreg_mathlist:nnV { #2 } { #3 } #4 }
{ \egreg_mathlist:nnn { #2 } { #3 } { #4 } }
}
\seq_new:N \l__egreg_mathlist_seq
\cs_new_protected:Npn \egreg_mathlist:nnn #1 #2 #3
{
\seq_set_split:Nnn \l__egreg_mathlist_seq { #1 } { #3 }
\seq_use:Nnnn \l__egreg_mathlist_seq { #2 } { #2 } { #2 }
}
\cs_generate_variant:Nn \egreg_mathlist:nnn { nnV }
\ExplSyntaxOff
\newcommand{\edgelist}{(v_{1}, v_{2}); (v_{2}, v_{3}); (v_{1}, v_{3});
(v_{2}, v_{5}); (v_{3}, v_{4}); (v_{4}, v_{5})}
\begin{document}
Figure \ref{figure:example graph} shows an example of a graph
$G = (\{\mathlist{,}{v_{1}, \dots, v_{5}}\},
\{\mathlist[;]{,\allowbreak}
{(v_{1}, v_{2});
(v_{2}, v_{3});
(v_{1}, v_{3});
(v_{2}, v_{5});
(v_{3}, v_{4});
(v_{4}, v_{5})}
\})$
with $|V| = n = 5$ vertices and $|E| = m = 6$ edges.
The list of edges can also be obtained by
$\mathlist*[;]{,\allowbreak}{\edgelist}$.
\end{document}
I think what Harish was intending to suggest in his comment is that you can use single dollar-sign delimited strings to shift into math mode and insert a formula.
So if you wanted to typeset "The expected rate of events is λ." you would write
The expected rate of events is $\lambda$.
Were you to instead use \[ … \]
or $$ … $$
to delimit your text, it would put the formula on the next line because this defines a displayed equation, which is placed on its own line, and (usually) centered.
See below (On \[ … \]
vs. $$ … $$
) for a further explanation of why you would choose between \[ … \]
and $$ … $$
.
The quick heuristic would be:
\[ … \]
$$ … $$
.So were you to typeset the previous example as:
The expected rate of events is \[\lambda\].
that would be rendered as:
The expected rate of events is
λ
.
Note that the period is also placed after a new line because of the way that equation environments work.
--Edit--
As pointed out by Ethan in the comments, often if you are going to use this notation, it is more common to type:
The expected rate of events is \[
\lambda
\].
This makes explicit in the plaintext representation of your maths that you intend it to be on its own line.
See the attached image for a rendered example of what I mean.
\[ … \]
vs. $$ … $$
Though using double dollar signs ($$
) to delimit displayed math mode in LaTeX is discouraged — see Why is \[ … \]
preferable to $$
? — this is not always feasible if you want your LaTeX to be rendered appropriately by MathJax based LaTeX interpreters that are common on web based text editors that provide maths typesetting support.
For example, the Jupyter notebook is designed to display both code and markup stored in JSON format, where mathematical content is LaTeX formatted plaintext that is interpreted via MathJax. However, if you use \[ … \]
instead of $$ … $$
your LaTeX will refuse to render correctly because of the way that JSON requires escaping slashes (\
). You can instead use \\[ … \\]
but then this can cause other issues with interpreting LaTeX inside the delimiters forcing you to use nonvalid LaTeX to be able to write (for example) subscripts by escaping underscores. In this case and with other JSON based storage solutions for encoding plaintext, $$ … $$
is preferable in order to avoid these issues around \
and escaping.
Note: the Cross Validated StackExchange website explicitly encourages the use of $$ … $$
. Or – more accurately – it encourages using:
$$
…
$$
Best Answer
It’s common to use ℰ (U+2130, or
\mathcal{E}
) as the symbol for EMF. There are a number of variations of Δ, but inunicode-math
,stix
orstix2
, the upright math operator is\increment
. In ISO style, both Φ and N are variables rather than constants, and so should be slanted. (Under the default settings, though, capital Greek letters appear upright.)Here’s how I’d do that in the modern toolchain:
If you want to replace the symbol ℰ with the word Emf or EMF, replace the definition of
\Emf
withThis is spaced like the operator log or sin if you try to write something like 2 Emf t. (Eta: egreg correctly brings up that this breaks
\Emf \cdot t
, so you would need to insert a\!
in front of a binary operator.)If you want something visually distinct from either an operator or the product of variables named e, m and f, you might go with small caps:
This departs from ISO style, in which variables are always slanted, unless you select slanted small caps, such as:
If you prefer your capital Greek letters upright, remove the
[math-style=ISO]
option from\usepackage{unicode-math}
.If you’d rather have a slanted Δ, write
\mathit{\Delta}
.If you have to (or prefer to) use PDFLaTeX instead of LuaLaTeX or XeLaTeX, load your font package of choice. Many math font packages have a
slantedgreek
option. If you aren’t usingstix
orstix2
, you might replace\increment
with either\Delta
or\triangle
.