diff --git a/src/computational.tex b/src/computational.tex new file mode 100644 index 0000000..2cffdcd --- /dev/null +++ b/src/computational.tex @@ -0,0 +1,131 @@ +\Part[ + \eng{Computational Physics} + \ger{Computergestützte Physik} +]{comp} +\Section[ + \eng{Many-body physics} + \ger{Vielteilchenphysik} +]{mb} +\TODO{TODO} + \Subsection[ + \eng{Importance sampling} + \ger{Importance sampling / Stichprobenentnahme nach Wichtigkeit} + ]{importance_sampling} + \TODO{Monte Carlo} + + \Subsection[ + \eng{Matrix product states} + \ger{Matrix Produktzustände} + ]{mps} + +\Section[ + \eng{Misc} + \ger{Verschiedenes} +]{misc} + \begin{formula}{mean_field} + \desc{Mean field approximation}{Replaces 2-particle operator by 1-particle operator}{Example for Coulumb interaction between many electrons} + \desc[german]{Molekularfeldnäherung}{Ersetzt 2-Teilchen Operator durch 1-Teilchen Operator}{Beispiel für Coulumb Wechselwirkung zwischen Elektronen} + \eq{ + \frac{1}{2}\sum_{i\neq j} \frac{e^2}{\abs{\vec{r}_i - \vec{r}_j}} \approx \sum_{i} V_\text{eff}(\vec{r}_i) + } + \end{formula} + + +\Section[ + \eng{Tight-binding} + \ger{Tight-binding} +]{tb} + + +\Section[ + \eng{Density functional theory (DFT)} + \ger{Dichtefunktionaltheorie (DFT)} +]{dft} + \Subsection[ + \eng{Hartree-Fock} + \ger{Hartree-Fock} + ]{hf} + \begin{ttext} + \eng{ + \begin{itemize} + \item \fqEqRef{comp:misc:mean_field} theory + \item Self-interaction free: Self interaction is cancelled out by the Fock-term + \end{itemize} + } + \end{ttext} + \begin{formula}{equation} + \desc{Hartree-Fock equation}{}{ + $\varphi_\xi$ single particle wavefunction of $\xi$th orbital, + $\hat{T}$ kinetic electron energy, + $\hat{V}_{\text{en}}$ electron-nucleus attraction, + $\hat{V}_{\text{HF}}$ \fqEqRef{comp:dft:hf:potential}, + } + \desc[german]{Hartree-Fock Gleichung}{}{ + $\varphi_\xi$ ein-Teilchen Wellenfunktion des $\xi$-ten Orbitals, + $\hat{T}$ kinetische Energie der Elektronen, + $\hat{V}_{\text{en}}$ Electron-Kern Anziehung, + $\hat{V}_{\text{HF}}$ \fqEqRef{comp:dft:hf:potential} + } + \eq{ + \left(\hat{T} + \hat{V}_{\text{en}} + \hat{V}_{\text{HF}}^\xi\right)\varphi_\xi(x) = \epsilon_\xi \varphi_\xi(x) + } + \end{formula} + \begin{formula}{potential} + \desc{Hartree-Fock potential}{}{} + \desc[german]{Hartree Fock Potential}{}{} + \eq{ + V_{\text{HF}}^\xi(\vecr) = + \sum_{\vartheta} \int \d x' + \frac{e^2}{\abs{\vecr - \vecr'}} + \left( + \underbrace{\abs{\varphi_\xi(x')}^2}_{\text{Hartree-Term}} + - \underbrace{\frac{\varphi_{\vartheta}^*(x') \varphi_{\xi}(x') \varphi_{\vartheta}(x)}{\varphi_\xi(x)}}_{\text{Fock-Term}} + \right) + } + \end{formula} + \begin{formula}{scf} + \desc{Self-consistend field}{}{} + % \desc[german]{}{}{} + \ttxt{ + \eng{ + \begin{enumerate} + \item Initial guess for $\psi$ + \item Solve SG for each particle + \item Make new guess for $\psi$ + \end{enumerate} + } + } + \end{formula} + + \Subsection[ + \eng{Kohn-Sham} + \ger{Kohn-Sham} + ]{ks} + \TODO{TODO} + + \Subsection[ + \eng{Born-Oppenheimer Approximation} + \ger{Born-Oppenheimer Näherung} + ]{bo} + \TODO{TODO} + + \Subsection[ + \eng{Molecular Dynamics} + \ger{Molekulardynamik} + ]{md} + \begin{ttext} + \eng{Statistical method} + + \end{ttext} + + + + +\Section[ + \eng{Gradient descent} + \ger{Gradientenverfahren} + ]{gd} + \TODO{TODO} + + + diff --git a/src/condensed_matter.tex b/src/condensed_matter.tex index 812d940..bc73e56 100644 --- a/src/condensed_matter.tex +++ b/src/condensed_matter.tex @@ -166,53 +166,6 @@ family of plane that are equivalent due to crystal symmetry \eq{\mu = \frac{q \tau}{m}} \end{formula} - \Subsection[ - \eng{Drude model} - \ger{Drude-Modell} - ]{drude} - \begin{ttext} - \eng{Classical model describing the transport properties of electrons in materials (metals): - The material is assumed to be an ion lattice and with freely moving electrons (electron gas). The electrons are - accelerated by an electric field and decelerated through collisions with the lattice ions. - The model disregards the Fermi-Dirac partition of the conducting electrons. - } - \ger{Ein klassisches Model zur Beschreibung der Transporteigenschaften von Elektronen in (v.a.) Metallen: - Der Festkörper wird als Ionenkristall mit frei beweglichen Elektronen (Elektronengas). - Die Elektronen werden durch ein Elektrisches Feld $E$ beschleunigt und durch Stöße mit den Gitterionen gebremst. - Das Modell vernachlässigt die Fermi-Dirac Verteilung der Leitungselektronen. - } - \end{ttext} - \begin{formula}{motion} - \desc{Equation of motion}{}{$v$ electron speed, $\vec{v}_\text{D}$ drift velocity, $\tau$ mean free time between collisions} - \desc[german]{Bewegungsgleichung}{}{$v$ Elektronengeschwindigkeit, $\vec{v}_\text{D}$ Driftgeschwindigkeit, $\tau$ Stoßzeit} - \eq{\masse \odv{\vec{v}}{t} + \frac{\masse}{\tau} \vec{v}_\text{D} = -e \vec{E}} - \end{formula} - \begin{formula}{current_density} - \desc{Current density}{Ohm's law}{$n$ charge particle density} - \desc[german]{Stromdichte}{Ohmsches Gesetz}{$n$ Ladungsträgerdichte} - \eq{\vec{j} = -ne\vec{v}_\text{D} = ne\mu \vec{E}} - \end{formula} - \begin{formula}{conductivity} - \desc{Drude-conductivity}{}{} - \desc[german]{Drude-Leitfähigkeit}{}{} - \eq{\sigma = \frac{\vec{j}}{\vec{E}} = \frac{e^2 \tau n}{\masse} = n e \mu} - \end{formula} - - \Subsection[ - \eng{Sommerfeld model} - \ger{Sommerfeld-Modell} - ]{sommerfeld} - \begin{ttext} - \eng{Assumes a gas of free fermions underlying the pauli-exclusion principle. Only electrons in an energy range of $\kB T$ around the Fermi energy $\EFermi$ participate in scattering processes.} - \ger{Annahme eines freien Fermionengases, welches dem Pauli-Prinzip unterliegt. Nur Elektronen in einem Energiebereich von $\kB T$ um die Fermi Energe $\EFermi$ nehmen an Streuprozessen teil.} - \end{ttext} - \begin{formula}{current_density} - \desc{Current density}{}{} - \desc[german]{Stromdichte}{}{} - \eq{\vec{j} = -en\braket{v} = -e n \frac{\hbar}{\masse}\braket{\vec{k}} = -e \frac{1}{V} \sum_{\vec{k},\sigma} \frac{\hbar \vec{k}}{\masse}} - \end{formula} - \TODO{The formula for the conductivity is the same as in the drude model?} - \Subsection[ \eng{2D electron gas} \ger{2D Elektronengas} @@ -256,177 +209,9 @@ family of plane that are equivalent due to crystal symmetry \TODO{TODO} -\Section[ - \eng{Semiconductors} - \ger{Halbleiter} -]{semic} - \begin{formula}{charge_density_eq} - \desc{Equilibrium charge densitites}{}{} - \desc[german]{Ladungsträgerdichte im Equilibrium}{}{} - \eq{ - n_0 &\approx N_\text{c}(T) e^{-\frac{E_\text{c} - \EFermi}{\kB T}} \\ - p_0 &\approx N_\text{v}(T) e^{-\frac{\EFermi - E_\text{v}}{\kB T}} - } - \end{formula} - \begin{formula}{charge_density_intrinsic} - \desc{Intrinsic charge density}{}{} - \desc[german]{Intrinsische Ladungsträgerdichte}{}{} - \eq{ - n_\text{i} \approx \sqrt{n_0 p_0} = \sqrt{N_\text{c}(T) N_\text{v}(T)} e^{-\frac{E_\text{gap}}{2\kB T}} - } - \end{formula} \Section[ - \eng{Measurement techniques} - \ger{Messtechniken} -]{meas} - \Subsection[ - \eng{ARPES} - \ger{ARPES} - ]{arpes} - what? - in? - how? - plot - - \Subsection[ - \eng{Scanning probe microscopy SPM} - \ger{Rastersondenmikroskopie (SPM)} - ]{spm} - \begin{ttext} - \eng{Images of surfaces are taken by scanning the specimen with a physical probe.} - \ger{Bilder der Oberfläche einer Probe werden erstellt, indem die Probe mit einer Sonde abgetastet wird.} - \end{ttext} - - \Eng[name]{Name} - \Ger[name]{Name} - \Eng[application]{Application} - \Ger[application]{Anwendung} - - - \begin{minipagetable}{amf} - \entry{name}{ - \eng{Atomic force microscopy (AMF)} - \ger{Atomare Rasterkraftmikroskopie (AMF)} - } - \entry{application}{ - \eng{Surface stuff} - \ger{Oberflächenzeug} - } - \entry{how}{ - \eng{With needle} - \ger{Mit Nadel} - } - \end{minipagetable} - \begin{minipage}{0.5\textwidth} - \begin{figure}[H] - \centering - \includegraphics[width=0.8\textwidth]{img/cm_amf.pdf} - \caption{\cite{Bian2021}} - \end{figure} - \end{minipage} - - - \begin{minipagetable}{stm} - \entry{name}{ - \eng{Scanning tunneling microscopy (STM)} - \ger{Rastertunnelmikroskop (STM)} - } - \entry{application}{ - \eng{Surface stuff} - \ger{Oberflächenzeug} - } - \entry{how}{ - \eng{With TUnnel} - \ger{Mit TUnnel} - } - \end{minipagetable} - \begin{minipage}{0.5\textwidth} - \begin{figure}[H] - \centering - \includegraphics[width=0.8\textwidth]{img/cm_stm.pdf} - \caption{\cite{Bian2021}} - \end{figure} - \end{minipage} - -\Section[ - \eng{Fabrication techniques} - \ger{Herstellungsmethoden} - ]{fab} - \begin{minipagetable}{cvd} - \entry{name}{ - \eng{Chemical vapor deposition (CVD)} - \ger{Chemische Gasphasenabscheidung (CVD)} - } - \entry{how}{ - \eng{ - A substrate is exposed to volatile precursors, which react and/or decompose on the heated substrate surface to produce the desired deposit. - By-products are removed by gas flow through the chamber. - } - \ger{ - An der erhitzten Oberfläche eines Substrates wird aufgrund einer chemischen Reaktion mit einem Gas eine Feststoffkomponente abgeschieden. - Nebenprodukte werden durch den Gasfluss durch die Kammer entfernt. - } - } - \entry{application}{ - \eng{ - \begin{itemize} - \item Polysilicon \ce{Si} - \item Silicon dioxide \ce{SiO_2} - \item Graphene - \item Diamond - \end{itemize} - } - \ger{ - \begin{itemize} - \item Poly-silicon \ce{Si} - \item Siliziumdioxid \ce{SiO_2} - \item Graphen - \item Diamant - \end{itemize} - } - } - \end{minipagetable} - \begin{minipage}{0.5\textwidth} - \centering - \includegraphics[width=\textwidth]{img/cm_cvd_english.pdf} - \end{minipage} - - - \Subsection[ - \eng{Epitaxy} - \ger{Epitaxie} - ]{epitaxy} - \begin{ttext} - \eng{A type of crystal groth in which new layers are formed with well-defined orientations with respect to the crystalline seed layer.} - \ger{Eine Art des Kristallwachstums, bei der mindestens eine kristallographische Ordnung der wachsenden Schicht der des Substrates entspricht.} - \end{ttext} - - \begin{minipagetable}{mbe} - \entry{name}{ - \eng{Molecular Beam Epitaxy (MBE)} - \ger{Molekularstrahlepitaxie (MBE)} - } - \entry{how}{ - \eng{In a ultra-high vacuum, the elements are heated until they slowly sublime. The gases then condensate on the substrate surface} - \ger{Die Elemente werden in einem Ultrahochvakuum erhitzt, bis sie langsam sublimieren. Die entstandenen Gase kondensieren dann auf der Oberfläche des Substrats} - } - \entry{application}{ - \eng{ - \begin{itemize} - \item Gallium arsenide \ce{GaAs} - \end{itemize} - \TODO{Link to GaAs} - } - \ger{ - \begin{itemize} - \item Galliumarsenid \ce{GaAs} - \end{itemize} - } - } - \end{minipagetable} - \begin{minipage}{0.5\textwidth} - \centering - \includegraphics[width=\textwidth]{img/cm_mbe_english.pdf} - \end{minipage} + \eng{\GT{misc}} + \ger{\GT{misc}} +]{misc} diff --git a/src/constants.tex b/src/constants.tex new file mode 100644 index 0000000..e30828a --- /dev/null +++ b/src/constants.tex @@ -0,0 +1,10 @@ +\Section[ + \eng{Constants} + \ger{Konstanten} +]{constants} + \begin{constant}{planck}{h}{def} + \desc{Planck Constant}{}{} + \desc[german]{Plancksches Wirkumsquantum}{}{} + \val{6.62607015\cdot 10^{-34}}{\joule\s} + \val{4.135667969\dots\cdot 10^{-15}}{\eV\s} + \end{constant} diff --git a/src/electrodynamics.tex b/src/electrodynamics.tex index a402304..b31946d 100644 --- a/src/electrodynamics.tex +++ b/src/electrodynamics.tex @@ -1,5 +1,3 @@ -\def\PhiB{\Phi_\text{B}} -\def\PhiE{\Phi_\text{E}} \Part[ \eng{Electrodynamics} @@ -10,7 +8,7 @@ \Section[ \eng{Maxwell-Equations} \ger{Maxwell-Gleichungen} - ]{Maxwell} +]{Maxwell} \begin{formula}{vacuum} \desc{Vacuum}{microscopic formulation}{} \desc[german]{Vakuum}{Mikroskopische Formulierung}{} @@ -32,97 +30,143 @@ \Rot \vec{H} &= \vec{j} + \odv{\vec{D}}{t} } \end{formula} - \TODO{Polarization, Magnetisation} + \TODO{Polarization} + \Section[ - \eng{Fields} - \ger{Felder} - ]{fields} + \eng{Electric field} + \ger{Elektrisches Feld} +]{el} + \begin{formula}{gauss_law} + \desc{Gauss's law for electric fields}{Electric flux through a closed surface is proportional to the electric charge}{$S$ closed surface} + \desc[german]{Gaußsches Gesetz für elektrische Felder}{Der magnetische Fluss durch eine geschlossene Fläche ist proportional zur elektrischen Ladung}{$S$ geschlossene Fläche} + \eq{\PhiE = \iint_S \vec{E}\cdot\d\vec{S} = \frac{Q}{\varepsilon_0}} + \end{formula} + +\Section[ + \eng{Magnetic field} + \ger{Magnetfeld} +]{mag} + \begin{constant}{h_joule}{\hbar}{def} + \desc{Planck Constant}{}{} + \desc[german]{Plancksches Wirkumsquantum}{}{} + \val{6.62607015\cdot 10^{-34}}{\joule\s} + \val{4.135667969\dots\cdot 10^{-15}}{\eV\s} + \end{constant} + + \Eng[magnetic_flux]{Magnetix flux density} + \Ger[magnetic_flux]{Magnetische Flussdichte} + + \begin{quantity}{magnetic_flux}{\PhiB}{\weber=\volt\per\s=\kg\m^2\per\s^2\A}{scalar} + \desc{Magnetic flux}{} + \desc[german]{Magnetischer Fluss}{} + \end{quantity} + + \begin{quantity}{magnetic_flux_density}{\vec{B}}{\tesla=\volt\s\per\m^2=\newton\per\ampere\m=\kg\per\ampere\s^2}{} + \desc{Magnetic flux density}{} + \desc[german]{Magnetische Flussdichte}{} + \end{quantity} + \begin{formula}{magnetic_flux_density} + \desc{\qtyRef{magnetic_flux_density}}{}{$\vec{H}$ \qtyRef{magnetic_field_density}, $\vec{M}$ \qtyRef{magnetization}, $\mu_0$ \constRef{vacuum_permeability}} + \desc[german]{}{}{} + \eq{\vec{B} = \mu_0 (\vec{H}+\vec{M})} + \end{formula} + + \begin{quantity}{magnetic_permeability}{\mu}{\henry\per\m=\volt\s\per\ampere\m}{scalar} + \desc{Magnetic permeability}{} + \desc[german]{Magnetisch Permeabilität}{} + \end{quantity} + \begin{constant}{vacuum_permeability}{\mu_0}{exp} + \desc{Magnetic vauum permeability}{}{} + \desc[german]{Magnetische Vakuumpermeabilität}{}{} + \val{1.25663706127(20)}{\henry\per\m=\newton\per\ampere^2} + \end{constant} + + \begin{formula}{magnetic_flux} + \desc{Magnetic flux}{}{$\vec{A}$ \GT{area}} + \desc[german]{Magnetischer Fluss}{}{} + \eq{\PhiB = \iint_A \vec{B}\cdot\d\vec{A}} + \end{formula} + + \begin{formula}{gauss_law} + \desc{Gauss's law for magnetism}{Magnetic flux through a closed surface is $0$ \Rightarrow there are no magnetic monopoles}{$S$ closed surface} + \desc[german]{Gaußsches Gesetz für Magnetismus}{Der magnetische Fluss durch eine geschlossene Fläche ist $0$ \Rightarrow es gibt keine magnetischen Monopole}{$S$ geschlossene Fläche} + \eq{\PhiB = \iint_S \vec{B}\cdot\d\vec{S} = 0} + \end{formula} + + \begin{quantity}{magnetization}{\vec{M}}{\ampere\per\m}{vector} + \desc{Magnetization}{Vector field describing the density of magnetic dipoles} + \desc[german]{Magnetisierung}{Vektorfeld, welches die Dichte von magnetischen Dipolen beschreibt.} + \end{quantity} + \begin{quantity}{magnetic_moment}{\vec{m}}{\ampere\m^2}{vector} + \desc{Magnetic moment}{Strength and direction of a magnetic dipole} + \desc[german]{Magnetisches Moment}{Stärke und Richtung eines magnetischen Dipols} + \end{quantity} + + \begin{formula}{magnetization} + \desc{\qtyRef{magnetization}}{}{$m$ \qtyRef{magnetic_moment}, $V$ \qtyRef{volume}} + \desc[german]{}{}{} + \eq{\vec{M} = \odv{\vec{m}}{V} = \chi_\text{m} \cdot \vec{H}} + \end{formula} + + \begin{formula}{angular_torque} + \desc{Torque}{}{$m$ \qtyRef{magnetic_moment}} + \desc[german]{Drehmoment}{}{} + \eq{\vec{\tau} = \vec{m} \times \vec{B}} + \end{formula} + + \begin{formula}{suceptibility} + \desc{Susceptibility}{}{} + \desc[german]{Suszeptibilität}{}{} + \eq{\chi_\text{m} = \pdv{M}{B} = \frac{\mu}{\mu_0} - 1 } + \end{formula} + + + \begin{formula}{poynting} + \desc{Poynting vector}{Directional energy flux or power flow of an electromagnetic field [$\si{\W\per\m^2}$]}{} + \desc[german]{Poynting-Vektor}{Gerichteter Energiefluss oder Leistungsfluss eines elektromgnetischen Feldes [$\si{\W\per\m^2}$]}{} + \eq{\vec{S} = \vec{E} \times \vec{H}} + \end{formula} + + \begin{formula}{magnetic_permeability} + \desc{\qtyRef{magnetic_permeability}}{}{$B$ \qtyRef{magnetic_flux_density}, $H$ \qtyRef{magnetic_field_intensity}} + \desc[german]{}{}{} + \eq{\mu=\frac{B}{H}} + \end{formula} \Subsection[ - \eng{Electric field} - \ger{Elektrisches Feld} - ]{el} - \begin{formula}{gauss_law} - \desc{Gauss's law for electric fields}{Electric flux through a closed surface is proportional to the electric charge}{$S$ closed surface} - \desc[german]{Gaußsches Gesetz für elektrische Felder}{Der magnetische Fluss durch eine geschlossene Fläche ist proportional zur elektrischen Ladung}{$S$ geschlossene Fläche} - \eq{\PhiE = \iint_S \vec{E}\cdot\d\vec{S} = \frac{Q}{\varepsilon_0}} + \eng{Induction} + \ger{Induktion} + ]{induction} + \begin{formula}{farady_law} + \desc{Faraday's law of induction}{}{} + \desc[german]{Faradaysche Induktionsgesetz}{}{} + \eq{U_\text{ind} = -\odv{}{t} \PhiB = - \odv{}{t} \iint_A\vec{B} \cdot \d\vec{A}} \end{formula} - \Subsection[ - \eng{Magnetic field} - \ger{Magnetfeld} - ]{mag} - - \Eng[magnetic_flux]{Magnetix flux density} - \Ger[magnetic_flux]{Magnetische Flussdichte} - - \begin{quantity}{mag_flux}{\Phi}{\weber=\volt\per\s=\kg\m^2\per\s^2\A}{scalar} - \desc{Magnetic flux}{} - \desc[german]{Magnetischer Fluss}{} - \end{quantity} - - \begin{formula}{magnetic_flux} - \desc{Magnetic flux}{}{} - \desc[german]{Magnetischer Fluss}{}{} - \eq{\PhiB = \iint_A \vec{B}\cdot\d\vec{A}} - \end{formula} - - \begin{formula}{gauss_law} - \desc{Gauss's law for magnetism}{Magnetic flux through a closed surface is $0$ \Rightarrow there are no magnetic monopoles}{$S$ closed surface} - \desc[german]{Gaußsches Gesetz für Magnetismus}{Der magnetische Fluss durch eine geschlossene Fläche ist $0$ \Rightarrow es gibt keine magnetischen Monopole}{$S$ geschlossene Fläche} - \eq{\PhiB = \iint_S \vec{B}\cdot\d\vec{S} = 0} - \end{formula} - - \begin{formula}{magnetization} - \desc{Magnetization}{}{$m$ mag. moment, $V$ volume} - \desc[german]{Magnetisierung}{}{$m$ mag. Moment, $V$ Volumen} - \eq{\vec{M} = \odv{\vec{m}}{V} = \chi_\text{m} \cdot \vec{H}} - \end{formula} - - \begin{formula}{angular_torque} - \desc{Torque}{}{$m$ mag. moment} - \desc[german]{Drehmoment}{}{$m$ mag. Moment} - \eq{\vec{\tau} = \vec{m} \times \vec{B}} - \end{formula} - - \begin{formula}{suceptibility} - \desc{Susceptibility}{}{} - \desc[german]{Suszeptibilität}{}{} - \eq{\chi_\text{m} = \pdv{M}{B} = \frac{\mu}{\mu_0} - 1 } - \end{formula} - - - \begin{formula}{poynting} - \desc{Poynting vector}{Directional energy flux or power flow of an electromagnetic field [$\si{\W\per\m^2}$]}{} - \desc[german]{Poynting-Vektor}{Gerichteter Energiefluss oder Leistungsfluss eines elektromgnetischen Feldes [$\si{\W\per\m^2}$]}{} - \eq{\vec{S} = \vec{E} \times \vec{H}} - \end{formula} - - - - \Subsection[ - \eng{Induction} - \ger{Induktion} - ]{induction} - \begin{formula}{farady_law} - \desc{Faraday's law of induction}{}{} - \desc[german]{Faradaysche Induktionsgesetz}{}{} - \eq{U_\text{ind} = -\odv{}{t} \PhiB = - \odv{}{t} \iint_A\vec{B} \cdot \d\vec{A}} - \end{formula} - - \begin{formula}{lenz} - \desc{Lenz's law}{}{} - \desc[german]{Lenzsche Regel}{}{} - \ttxt{ - \eng{ - Change of magnetic flux through a conductor induces a current that counters that change of magnetic flux. - } - \ger{ - Die Änderung des magnetischen Flußes durch einen Leiter induziert einen Strom der der Änderung entgegenwirkt. - } + \begin{formula}{lenz} + \desc{Lenz's law}{}{} + \desc[german]{Lenzsche Regel}{}{} + \ttxt{ + \eng{ + Change of magnetic flux through a conductor induces a current that counters that change of magnetic flux. } - \end{formula} + \ger{ + Die Änderung des magnetischen Flußes durch einen Leiter induziert einen Strom der der Änderung entgegenwirkt. + } + } + \end{formula} + + \Subsection[ + \eng{Magnetic materials} + \ger{Magnetische Materialien} + ]{materials} + \begin{formula}{paramagnetism} + \desc{Paramagnetism}{}{$\mu$ \fqEqRef{ed:mag:permeability}, $\chi$ \fqEqRef{ed:mag:susecptibility}} + \desc[german]{Paramagnetismus}{}{} + \eq{\mu &> 1 \\ \chi > 0} + \end{formula} + \Section[ \eng{Hall-Effect} @@ -152,9 +196,9 @@ \end{formula} \begin{formula}{coefficient} - \desc{Hall coefficient}{}{} - \desc[german]{Hall-Koeffizient}{}{} - \eq{R_\text{H} = -\frac{Eg}{j_x Bg} = \frac{1}{ne} = \frac{\rho_{xy}}{B_z}} + \desc{Hall coefficient}{Sometimes $R_\txH$}{} + \desc[german]{Hall-Koeffizient}{Manchmal $R_\txH$}{} + \eq{A_\text{H} := -\frac{E_y}{j_x B_z} \explOverEq{\GT{metals}} \frac{1}{ne} = \frac{\rho_{xy}}{B_z}} \end{formula} \begin{formula}{resistivity} @@ -240,7 +284,7 @@ \Section[ \eng{Dipole-stuff} \ger{Dipol-zeug} - ]{dipole} +]{dipole} \begin{formula}{poynting} \desc{Dipole radiation Poynting vector}{}{} diff --git a/src/main.tex b/src/main.tex old mode 100644 new mode 100755 index 8793639..305c9dd --- a/src/main.tex +++ b/src/main.tex @@ -1,6 +1,6 @@ \documentclass[11pt, a4paper]{article} % \usepackage[utf8]{inputenc} -\usepackage[english]{babel} +\usepackage[german]{babel} \usepackage[left=2cm,right=2cm,top=2cm,bottom=2cm]{geometry} % ENVIRONMENTS etc \usepackage{adjustbox} @@ -15,23 +15,19 @@ \usepackage{expl3} % switch case and other stuff \usepackage{substr} \usepackage{xcolor} -\usepackage{float} +% FORMATING +\usepackage{float} % float barrier +\usepackage{subcaption} % subfigure \usepackage[hidelinks]{hyperref} -\usepackage{subcaption} - \usepackage[shortlabels]{enumitem} % easily change enum symbols to i), a. etc -\hypersetup{colorlinks = true, % Colours links instead of ugly boxes - urlcolor = blue, % Colour for external hyperlinks - linkcolor = cyan, % Colour of internal links - citecolor = red % Colour of citations - } +\usepackage{titlesec} % colored titles +\usepackage{array} +\newcolumntype{C}{>{$}c<{$}} % math-mode version of "c" column type +% \usepackage{sectsty} +% TRANSLATION \usepackage{translations} \input{util/translation.tex} - -\usepackage{sectsty} -\usepackage{titlesec} \input{util/colorscheme.tex} - % GRAPHICS \usepackage{tikz} % drawings \usetikzlibrary{decorations.pathmorphing} @@ -40,9 +36,7 @@ % \usetikzlibrary{external} % \tikzexternalize[prefix=tikz_figures] % \tikzexternalize - \usepackage{circuitikz} - % SCIENCE PACKAGES \usepackage{mathtools} \usepackage{MnSymbol} % for >>> \ggg sign @@ -57,23 +51,21 @@ \sisetup{separate-uncertainty} \sisetup{per-mode = power} \sisetup{exponent-product=\ensuremath{\cdot}} - - +% DUMB STUFF +% \usepackage{emoji} +% \newcommand\temoji[1]{\text{\emoji{#1}}} +% \def\sigma{\temoji{shark}} +% \def\lambda{\temoji{sheep}} +% \def\psi{\temoji{pickup-truck}} +% \def\pi{\temoji{birthday-cake}} +% \def\Pi{\temoji{hospital}} +% \def\rho{\temoji{rhino}} +% \def\nu{\temoji{unicorn}} +% \def\mu{\temoji{mouse}} \newcommand{\TODO}[1]{{\color{bright_red}TODO:#1}} \newcommand{\ts}{\textsuperscript} -% put an explanation above an equal sign -% [1]: equality sign (or anything else) -% 2: text (not in math mode!) -\newcommand{\explUnderEq}[2][=]{% - \underset{\substack{\uparrow\\\mathrlap{\text{\hspace{-1em}#2}}}}{#1}} -\newcommand{\explOverEq}[2][=]{% - \overset{\substack{\mathrlap{\text{\hspace{-1em}#2}}\\\downarrow}}{#1}} - - - - % "automate" sectioning % start
, get heading from translation, set label % fqname is the fully qualified name: the keys of all previous sections joined with a ':' @@ -118,37 +110,57 @@ % Make the translation of #1 a reference to a equation % 1: key -\newcommand{\fqEqRef}[1]{ - \edef\fqeqrefname{\GT{#1}} - \hyperref[eq:#1]{\fqeqrefname} +\newrobustcmd{\fqEqRef}[1]{% + % \edef\fqeqrefname{\GT{#1}} + % \hyperref[eq:#1]{\fqeqrefname} + \hyperref[eq:#1]{\GT{#1}}% } -\newcommand{\qtyRef}[1]{ - % using temp edef so that underscores in undefined trasnlation keys are printed as characters - \edef\qtyrefname{\GT{qty:#1}} - \hyperref[qty:#1]{\qtyrefname} +\newrobustcmd{\qtyRef}[1]{% + \hyperref[qty:#1]{\GT{#1}}% +} +\newrobustcmd{\constRef}[1]{% + \hyperref[const:#1]{\GT{#1}}% } % Make the translation of #1 a reference to a section % 1: key -\newcommand{\fqSecRef}[1]{ - \hyperref[sec:#1]{\GT{#1}} +\newrobustcmd{\fqSecRef}[1]{% + \hyperref[sec:#1]{\GT{#1}}% } % \usepackage{xstring} \input{circuit.tex} +\input{util/macros.tex} +\input{util/environments.tex} % requires util/translation.tex to be loaded first -% some translations +\def\inputOnlyFile{\relax} +\newcommand\Input[1]{ + \ifstrequal{\relax}{\inputOnlyFile}{ + \input{#1} + }{ + \ifstrequal{#1}{\inputOnlyFile}{ + \input{#1} + }{} + } +} + +% \includeonly{mechanics} +% \includeonly{low_temp} \title{Formelsammlung} \author{Matthias Quintern} \date{\today} - -\input{util/macros.tex} -\input{util/environments.tex} - -% \includeonly{computational} \begin{document} +\IfFileExists{\jobname.translations.aux}{% + \input{\jobname.translations.aux} +}{} + + +\newwrite\translationsaux +\immediate\openout\translationsaux=\jobname.translations.aux +\immediate\write\translationsaux{\noexpand\def\noexpand\MYVAR{AUSM AUX}}% +\AtEndDocument{\immediate\closeout\translationsaux} \maketitle \tableofcontents @@ -159,7 +171,7 @@ % \include{maths/linalg} % \include{maths/geometry} -% \include{maths/analysis} +\input{maths/analysis.tex} % \include{maths/probability_theory} \include{mechanics} @@ -168,25 +180,30 @@ \include{electrodynamics} -\include{quantum_mechanics} -\include{atom} +% \include{quantum_mechanics} +% \include{atom} \include{condensed_matter} -\include{low_temp} +\input{cm/charge_transport.tex} +\input{cm/low_temp.tex} +\input{cm/semiconductors.tex} +% \include{cm/techniques} \include{topo} -\include{quantum_computing} +% \include{quantum_computing} \include{computational} \include{quantities} +\include{constants} \newpage % \DT[english]{ttest}{TESTT EN} % \DT[german]{ttest}{TESTT DE} -\addtranslation{english}{ttest}{JA MOIN} +\paragraph{Testing GT, GetTranslation, IfTranslationExists, IfTranslation} +\addtranslation{english}{ttest}{This is the english translation of \texttt{ttest}} \noindent GT: ttest = \GT{ttest}\\ GetTranslation: ttest = \GetTranslation{ttest}\\ @@ -194,6 +211,7 @@ Is english? = \IfTranslation{english}{ttest}{yes}{no} \\ Is german? = \IfTranslation{german}{ttest}{yes}{no} \\ Is defined = \IfTranslationExists{ttest}{yes}{no} \\ +\paragraph{Testing translation keys containing macros} \def\ttest{NAME} % \addtranslation{english}{\ttest:name}{With variable} % \addtranslation{german}{\ttest:name}{Mit Variable} @@ -211,17 +229,27 @@ Is defined? = \expandafter\IfTranslationExists\expandafter{\ttest:name}{yes}{no} % \DT[qty:test]{english}{HAHA} -{blablabla \label{test}} +\paragraph{Testing hyperrefs} +\noindent{This text is labeled with "test" \label{test}}\\ +\hyperref[test]{This should refer to the line above}\\ +Link to quantity which is defined after the reference: \qtyRef{test}\\ +\DT[qty:test]{english}{If you read this, then the translation for qty:test was expandend!} +Link to defined quantity: \qtyRef{mass} +\begin{equation} + \label{qty:test} + E = mc^2 +\end{equation} + +\paragraph{Testing translation keys with token symbols like undescores} +\noindent +\GT{absolute_undefined_translation_with_underscors}\\ +\gt{relative_undefined_translation_with_underscors}\\ +\GT{absolute_undefined_translation_with_&ersand} + + -\hyperref[test]{TEST reference} -\qtyRef{test} - -\DT[qty:test]{english}{HAHA} -\qtyRef{mass} -\GT{qty:#1} -\GT{\qtyname} \newpage \Eng[appendix]{Appendix} diff --git a/src/maths/analysis.tex b/src/maths/analysis.tex index 704356e..14d93aa 100644 --- a/src/maths/analysis.tex +++ b/src/maths/analysis.tex @@ -3,6 +3,13 @@ \ger{Analysis} ]{cal} + % \begin{formula}{shark} + % \desc{Shark-midnight formula}{\emoji{shark}-s}{} + % \desc[german]{Shark-Mitternachtformel}{}{} + % \eq{ + % \temoji{seal}_{1,2} = \frac{-\temoji{shark}\pm \sqrt{\temoji{shark}^2-4\temoji{octopus}\temoji{tropical-fish}}}{2\temoji{octopus}} + % } + % \end{formula} \Subsection[ \eng{Convolution} @@ -15,7 +22,7 @@ \begin{formula}{def} \desc{Definition}{}{} \desc[german]{Definition}{}{} - \eq{(f*g)(t) = f(t) * g(t) = int_{-\infty}^\infty f(\tau) g(t-\tau) \d \tau} + \eq{(f*g)(t) = f(t) * g(t) = \int_{-\infty}^\infty f(\tau) g(t-\tau) \d \tau} \end{formula} \begin{formula}{notation} \desc{Notation}{}{} @@ -134,6 +141,12 @@ } \end{formula} + \begin{formula}{delta_of_function} + \desc{Dirac-Delta of a function}{}{$g(x_0) = 0$} + \desc[german]{Dirac-Delta einer Funktion}{}{} + \eq{\delta(f(x)) = \frac{\delta(x-x_0)}{\abs{g'(x_0)}}} + \end{formula} + \Section[ \eng{Logarithm} @@ -150,12 +163,23 @@ x^{\log(y)} &= y^{\log(x)} } \end{formula} + \begin{formula}{intergral} + \desc{Integral of natural logarithm}{}{} + \desc[german]{Integral des natürluchen Logarithmus}{}{} + \eq{ + \int \ln(x) \d x &= x \left(\ln(x) -1\right) \\ + \int \ln(ax + b) \d x &= \frac{ax+b}{a} \left(\ln(ax + b) -1\right) + } + \end{formula} \Section[ \eng{List of common integrals} \ger{Liste nützlicher Integrale} ]{integrals} + % Put links to other integrals here + \fqEqRef{cal:log:integral} + \begin{formula}{spherical-coordinates} \desc{Spherical coordinates}{}{} \desc[german]{Kugelkoordinaten}{}{} @@ -179,3 +203,4 @@ + diff --git a/src/maths/probability_theory.tex b/src/maths/probability_theory.tex index 5951da5..9816e35 100644 --- a/src/maths/probability_theory.tex +++ b/src/maths/probability_theory.tex @@ -47,6 +47,12 @@ \eq{F(x) = \int_{-\infty}^x f(t) \d t} \end{formula} + \begin{formula}{autocorrelation} + \desc{Autocorrelation}{Correlation of $f$ to itself at an earlier point in time, $C$ is a covariance function}{} + \desc[german]{Autokorrelation}{Korrelation vonn $f$ zu sich selbst zu einem früheren Zeitpunkt. $C$ ist auch die Kovarianzfunktion}{} + \eq{C_A(\tau) = \lim_{T \to \infty} \frac{1}{2T}\int_{-T}^{T} f(t+\tau) f(t) \d t) = \braket{f(t+\tau)\cdot f(t)}} + \end{formula} + \Section[ \eng{Distributions} \ger{Verteilungen} diff --git a/src/quantities.tex b/src/quantities.tex new file mode 100644 index 0000000..12e5163 --- /dev/null +++ b/src/quantities.tex @@ -0,0 +1,77 @@ +% if this causes a compilation error, check that none of the units have been redefined + +\Eng[si_base_units]{SI base units} +\Ger[si_base_units]{SI Basisgrößen} + +\paragraph{\GT{si_base_units}} + + \begin{quantity}{time}{t}{\second}{} + \desc{Time}{} + \desc[german]{Zeit}{} + \end{quantity} + + \begin{quantity}{Length}{l}{\m}{e} + \desc{Length}{} + \desc[german]{Länge}{} + \end{quantity} + + \begin{quantity}{mass}{m}{\kg}{es} + \desc{Mass}{} + \desc[german]{Masse}{} + \end{quantity} + + \begin{quantity}{temperature}{T}{\kelvin}{is} + \desc{Temperature}{} + \desc[german]{Temperatur}{} + \end{quantity} + + \begin{quantity}{current}{I}{\ampere}{es} + \desc{Electric current}{} + \desc[german]{Elektrischer Strom}{} + \end{quantity} + + \begin{quantity}{amount}{n}{\mol}{es} + \desc{Amount of substance}{} + \desc[german]{Stoffmenge}{} + \end{quantity} + + \begin{quantity}{luminous_intensity}{I_\text{V}}{\candela}{s} + \desc{Luminous intensity}{} + \desc[german]{Lichtstärke}{} + \end{quantity} + +\paragraph{\GT{other}} + \begin{quantity}{volume}{V}{\m^d}{} + \desc{Volume}{$d$ dimensional Volume} + \desc[german]{Volumen}{$d$ dimensionales Volumen} + \end{quantity} + + \begin{quantity}{force}{\vec{F}}{\newton=\kg\m\per\second^2}{ev} + \desc{Force}{} + \desc[german]{Kraft}{} + \end{quantity} + + \begin{quantity}{spring_constant}{k}{\newton\per\m=\kg\per\second^2}{s} + \desc{Spring constant}{} + \desc[german]{Federkonstante}{} + \end{quantity} + + \begin{quantity}{velocity}{\vec{v}}{\m\per\s}{v} + \desc{Velocity}{} + \desc[german]{Geschwindigkeit}{} + \end{quantity} + + \begin{quantity}{torque}{\tau}{\newton\m=\kg\m^2\per\s^2}{v} + \desc{Torque}{} + \desc[german]{Drehmoment}{} + \end{quantity} + + \begin{quantity}{heat_capacity}{C}{\joule\per\kelvin}{} + \desc{Heat capacity}{} + \desc[german]{Wärmekapazität}{} + \end{quantity} + + \begin{quantity}{charge}{q}{\coulomb=\ampere\s}{} + \desc{Charge}{} + \desc[german]{Ladung}{} + \end{quantity} diff --git a/src/quantum_mechanics.tex b/src/quantum_mechanics.tex index ba25ee5..e6bbce9 100644 --- a/src/quantum_mechanics.tex +++ b/src/quantum_mechanics.tex @@ -53,6 +53,43 @@ \eq{\hat{A} = \hat{A}^\dagger} \end{formula} + \Subsubsection[ + \eng{Measurement} + \ger{Messung} + ]{measurement} + \begin{ttext} + \eng{An observable is a hermition operator acting on $\hat{H}$. The measurement randomly yields one of the eigenvalues of $\hat{O}$ (all real).} + \ger{Eine Observable ist ein hermitscher Operator, der auf $\hat{H}$ wirkt. Die Messung ergibt zufällig einen der Eigenwerte von $\hat{O}$, welche alle reell sind.} + \end{ttext} + \begin{formula}{name} + \desc{Measurement probability}{Probability to measure $\psi$ in state $\lambda$}{} + \desc[german]{Messwahrscheinlichkeit}{Wahrscheinlichkeit, $\psi$ im Zustand $\lambda$ zu messen}{} + \eq{p(\lambda) = \braket{\psi|\hat{P}_\lambda|\psi}} + \end{formula} + \begin{formula}{state_after} + \desc{State after measurement}{}{} + \desc[german]{Zustand nach der Messung}{}{} + \eq{\ket{\psi}_\text{post} = \frac{1}{\sqrt{p(\lambda)}}\hat{P}_\lambda \ket{\psi}} + \end{formula} + + + \Subsubsection[ + \eng{Pauli matrices} + \ger{Pauli-Matrizen} + ]{pauli_matrices} + \begin{formula}{pauli_matrices} + \desc{Pauli matrices}{}{} + \desc[german]{Pauli Matrizen}{}{} + \eqAlignedAt{2}{ + \sigma_x &= \sigmaxmatrix &&= \sigmaxbraket \label{eq:pauli_x} \\ + \sigma_y &= \sigmaymatrix &&= \sigmaybraket \label{eq:pauli_y} \\ + \sigma_z &= \sigmazmatrix &&= \sigmazbraket \label{eq:pauli_z} + } + \end{formula} + % $\sigma_x$ NOT + % $\sigma_y$ PHASE + % $\sigma_z$ Sign + \Subsection[ \ger{Wahrscheinlichkeitstheorie} \eng{Probability theory} @@ -84,23 +121,6 @@ \sigma_A \sigma_B &\ge \frac{1}{2} \abs{\braket{[\hat{A},\hat{B}]}} } \end{formula} - - \Subsubsection[ - \eng{Pauli matrices} - \ger{Pauli-Matrizen} - ]{pauli_matrices} - \begin{formula}{pauli_matrices} - \desc{Pauli matrices}{}{} - \desc[german]{Pauli Matrizen}{}{} - \eqAlignedAt{2}{ - \sigma_x &= \sigmaxmatrix &&= \sigmaxbraket \label{eq:pauli_x} \\ - \sigma_y &= \sigmaymatrix &&= \sigmaybraket \label{eq:pauli_y} \\ - \sigma_z &= \sigmazmatrix &&= \sigmazbraket \label{eq:pauli_z} - } - \end{formula} - % $\sigma_x$ NOT - % $\sigma_y$ PHASE - % $\sigma_z$ Sign \Subsection[ diff --git a/src/readme.md b/src/readme.md index 3abd4f6..ef3fe96 100644 --- a/src/readme.md +++ b/src/readme.md @@ -27,7 +27,11 @@ Functions that create a hyperlink (and use the translation of the target element ## Multilanguage -All text should be defined as a translation (`translations` package, see `util/translation.tex`) and then used using the `gt` or `GT` macros. +All text should be defined as a translation (`translations` package, see `util/translation.tex`). +Use `\dt` or `\DT` or the the shorthand language commands `\eng`, `\Eng` etc. to define translations. +These commands also be write the translations to an auxiliary file, which is read after the document begins. +This means (on subsequent compilations) that the translation can be resolved before they are defined. +Use the `gt` or `GT` macros to retrieve translations. The english translation of any key must be defined, because it will also be used as fallback. Lower case macros are relative to the current `fqname`, while upper case macros are absolute. diff --git a/src/statistical_mechanics.tex b/src/statistical_mechanics.tex index 7f58208..9cdc3c6 100644 --- a/src/statistical_mechanics.tex +++ b/src/statistical_mechanics.tex @@ -5,12 +5,12 @@ \begin{ttext} \eng{ - \textbf{Intensive quantities:} Additive for subsystems (system size dependent): $S(\lambda E, \lambda V, \lambda N) = \lambda S(E, V, N)$\\ - \textbf{Extensive quantities:} Independent of system size, ratio of two intensive quantities + \textbf{Extensive quantities:} Additive for subsystems (system size dependent): $S(\lambda E, \lambda V, \lambda N) = \lambda S(E, V, N)$\\ + \textbf{Intensive quantities:} Independent of system size, ratio of two extensive quantities } \ger{ - \textbf{Intensive Größen:} Additiv für Subsysteme (Systemgrößenabhänig): $S(\lambda E, \lambda V, \lambda N) = \lambda S(E, V, N)$\\ - \textbf{Extensive Größen:} Unabhängig der Systemgröße, Verhältnis zweier intensiver Größen + \textbf{Extensive Größen:} Additiv für Subsysteme (Systemgrößenabhänig): $S(\lambda E, \lambda V, \lambda N) = \lambda S(E, V, N)$\\ + \textbf{Intensive Größen:} Unabhängig der Systemgröße, Verhältnis zweier extensiver Größen } \end{ttext} @@ -660,7 +660,7 @@ \eq{ pV &= \kB T \ln Z_g \\ \shortintertext{\GT{after} \GT{td:real_gas:virial}} - &= N \kB T \left[1 \mp \frac{\lambda^3}{2^{5/2} g v} + \Order\left(\left(\frac{\lambda^3}{v}\right)^2\right)\right] + &= N \kB T \left[1 \mp \frac{\lambda^3}{2^{5/2} g v} + \Order{\left(\frac{\lambda^3}{v}\right)^2}\right] } \end{formula} \begin{formula}{relevance} diff --git a/src/svgs/convertToPdf.sh b/src/svgs/convertToPdf.sh old mode 100755 new mode 100644 diff --git a/src/util/colorscheme.tex b/src/util/colorscheme.tex index f29193c..f1f9bc0 100644 --- a/src/util/colorscheme.tex +++ b/src/util/colorscheme.tex @@ -1,4 +1,4 @@ -% Define Gruvbox colors +% Gruvbox colors \definecolor{dark0_hard}{HTML}{1d2021} \definecolor{dark0}{HTML}{282828} \definecolor{dark0_soft}{HTML}{32302f} @@ -36,13 +36,13 @@ \definecolor{faded_aqua}{HTML}{427b58} \definecolor{faded_orange}{HTML}{af3a03} -% Use Gruvbox colors for various elements +% Dark mode % \pagecolor{light0_hard} % \color{dark0_hard} % \pagecolor{dark0_hard} % \color{light0_hard} -% Section headings in bright colors +% section headings in bright colors, \titleformat from titlesec package \titleformat{\section} {\color{neutral_purple}\normalfont\Large\bfseries} {\color{neutral_purple}\thesection}{1em}{} @@ -63,10 +63,9 @@ {\color{neutral_purple}\normalfont\normalsize\bfseries} {\color{neutral_purple}\thesubparagraph}{1em}{} -% Links in neutral colors \hypersetup{ colorlinks=true, - linkcolor=neutral_red, + linkcolor=neutral_purple, citecolor=neutral_green, filecolor=neutral_blue, urlcolor=neutral_orange diff --git a/src/util/environments.tex b/src/util/environments.tex index 48fce78..8b1634e 100644 --- a/src/util/environments.tex +++ b/src/util/environments.tex @@ -7,7 +7,7 @@ \edef\realfqname{\fqname} \edef\fqname{\fqname:#1} }{ - \expandafter\GT\expandafter{\fqname} \\ + \expandafter\GT\expandafter{\fqname}% \\ \edef\fqname{\realfqname} } @@ -149,7 +149,7 @@ % 4: definitions/links \newcommand{\desc}[4][english]{ % language, name, description, definitions - \dt[#1]{##1}{##2} + \ifblank{##2}{}{\dt[#1]{##1}{##2}} \ifblank{##3}{}{\dt[#1_desc]{##1}{##3}} \ifblank{##4}{}{\dt[#1_defs]{##1}{##4}} } @@ -211,13 +211,114 @@ tex.print(result) end } + +% 1: key +% 2: symbol +% 3: value +% 4: units +% 5: exp or def +% \newenvironment{constant}[5]{ +% % key, symbol, si unit(s), comment (key to global translation) +% \newcommand{\desc}[3][english]{ +% % language, name, description +% % \DT[qty:#1]{##1}{##2} +% % \ifblank{##3}{}{\DT[qty:#1_desc]{##1}{##3}} +% \ifblank{##2}{}{\DT[const:#1]{##1}{##2}} +% \ifblank{##3}{}{\DT[const:#1_desc]{##1}{##3}} +% } +% % TODO put these in long term key - value storage for generating a full table and global referenes \constRef +% % for references, there needs to be a label somwhere +% \edef\constName{const:#1} +% \edef\constDesc{const:#1_desc} +% \def\constSymbol{#2} +% \edef\constValue{#3} +% \def\constUnits{#4} +% \edef\constExpOrDef{const:#5} +% } +% { +% \NameLeftContentRight{\constName}{ +% \begingroup +% Symbol: $\constSymbol$ +% \IfTranslationExists{\constDesc}{ +% \\Description: \GT{\constDesc} +% }{} +% \\Value: $\constValue$ +% \\Unit: $\directlua{split_and_print_units([[\constUnits]])}$ +% \GT{\constExpOrDef} +% \label{\constName} +% \endgroup +% } +% \ignorespacesafterend + +% % for TOC +% \refstepcounter{constant}% +% % \addquantity{\expandafter\gt\expandafter{\qtyname}}% +% % \noindent\textbf{My Environment \themyenv: #1}\par% +% } +\newcounter{constant} +\newenvironment{constant}[3]{ + % [1]: language + % 2: name + % 3: description + % 4: definitions/links + \newcommand{\desc}[4][english]{ + % language, name, description, definitions + \ifblank{##2}{}{\DT[const:#1]{##1}{##2}} + \ifblank{##3}{}{\DT[const:#1_desc]{##1}{##3}} + \ifblank{##4}{}{\DT[const:#1_defs]{##1}{##4}} + } + \directlua{ + constVals = {} + constUnits = {} + } + % 1: equation for align environment + \newcommand{\val}[2]{ + \directlua{ + %--table.insert(constVals, "LOL") + table.insert(constVals, [[##1]]) + table.insert(constUnits, [[##2]]) + %--table.insert(constUnits, "\luaescapestring{##2}") + } + \def\constValue{##1} + \def\constUnit{##2} + } + \edef\constName{const:#1} + \edef\constDesc{const:#1_desc} + \def\constSymbol{#2} + \edef\constExpOrDef{\GT{const:#3}} +}{ + \NameLeftContentRight{\constName}{ + \begingroup % for label + Symbol: $\constSymbol$ + \IfTranslationExists{\constDesc}{ + \\Description: \GT{\constDesc} + }{} + % TODO manage multiple values + % \\Value: $\constValue\,\si{\constUnit}$ + \\\constExpOrDef: + \directlua{ + %--tex.sprint("Hier steht Luatext" .. ":", #constVals) + for i, v in ipairs(constVals) do + tex.sprint("\\\\\\hspace*{1cm}${", constVals[i], "}\\,\\si{", constUnits[i], "}$") + %--tex.sprint("VALUE ", i, v) + end + } + \label{\constName} + \endgroup + } + \ignorespacesafterend +} + + + +% 1: key +% 2: symbol +% 3: units +% 4: comment key to translation \newenvironment{quantity}[4]{ - % key, symbol, si unit(s), comment (key to global translation) + % language, name, description \newcommand{\desc}[3][english]{ - % language, name, description - % \DT[qty:#1]{##1}{##2} - % \ifblank{##3}{}{\DT[qty:#1_desc]{##1}{##3}} - \DT[qty:#1]{##1}{##2} + \ifblank{##2}{}{\DT[qty:#1]{##1}{##2}} \ifblank{##3}{}{\DT[qty:#1_desc]{##1}{##3}} } % TODO put these in long term key - value storage for generating a full table and global referenes \qtyRef @@ -227,6 +328,7 @@ \def\qtysymbol{#2} \def\qtyunits{#3} \edef\qtycomment{#4} + % Unit: $\directlua{split_and_print_units([[\m\per\kg]])}$ } { \NameLeftContentRight{\qtyname}{ @@ -238,7 +340,7 @@ \\Unit: $\directlua{split_and_print_units([[\qtyunits]])}$ \expandafter\IfTranslationExists\expandafter\qtycomment{ \\Comment: \GT\qtycomment - }{\\No comment \color{gray}} + }{}%{\\No comment \color{gray}} \label{\qtyname} \endgroup } @@ -246,12 +348,10 @@ % for TOC \refstepcounter{quantity}% - \addquantity{\expandafter\gt\expandafter{\qtyname}}% + % \addquantity{\expandafter\gt\expandafter{\qtyname}}% % \noindent\textbf{My Environment \themyenv: #1}\par% } \newcounter{quantity} -\Eng[list_of_quantitites]{List of quantitites} -\Ger[list_of_quantitites]{Liste von Größen} \newcommand{\listofquantities}{% \section*{\GT{list_of_quantitites}}% \addcontentsline{toc}{section}{\GT{list_of_quantitites}}% diff --git a/src/util/macros.tex b/src/util/macros.tex index e593c40..1f75ef1 100644 --- a/src/util/macros.tex +++ b/src/util/macros.tex @@ -1,38 +1,108 @@ \def\gooditem{\item[{$\color{neutral_red}\bullet$}]} \def\baditem{\item[{$\color{neutral_green}\bullet$}]} +% put an explanation above an equal sign +% [1]: equality sign (or anything else) +% 2: text (not in math mode!) +\newcommand{\explUnderEq}[2][=]{% + \underset{\substack{\uparrow\\\mathrlap{\text{\hspace{-1em}#2}}}}{#1}} +\newcommand{\explOverEq}[2][=]{% + \overset{\substack{\mathrlap{\text{\hspace{-1em}#2}}\\\downarrow}}{#1}} + +% COMMON SYMBOLS WITH SUPER/SUBSCRIPTS, VECTOR ARROWS ETC. \def\Grad{\vec{\nabla}} \def\Div{\vec{\nabla} \cdot} \def\Rot{\vec{\nabla} \times} -% common vectors \def\vecr{\vec{r}} \def\vecx{\vec{x}} - \def\kB{k_\text{B}} \def\EFermi{E_\text{F}} - +\def\Evalence{E_\text{v}} +\def\Econd{E_\text{c}} +\def\Egap{E_\text{gap}} \def\masse{m_\textrm{e}} +\def\Four{\mathcal{F}} % Fourier transform +\def\Lebesgue{\mathcal{L}} % Lebesgue +\def\O{\mathcal{O}} +\def\PhiB{\Phi_\text{B}} +\def\PhiE{\Phi_\text{E}} + +% SYMBOLS \def\R{\mathbb{R}} \def\C{\mathbb{C}} \def\Z{\mathbb{Z}} \def\N{\mathbb{N}} +% caligraphic +\def\calE{\mathcal{E}} +% upright +\def\txA{\text{A}} +\def\txB{\text{B}} +\def\txC{\text{C}} +\def\txD{\text{D}} +\def\txE{\text{E}} +\def\txF{\text{F}} +\def\txG{\text{G}} +\def\txH{\text{H}} +\def\txI{\text{I}} +\def\txJ{\text{J}} +\def\txK{\text{K}} +\def\txL{\text{L}} +\def\txM{\text{M}} +\def\txN{\text{N}} +\def\txO{\text{O}} +\def\txP{\text{P}} +\def\txQ{\text{Q}} +\def\txR{\text{R}} +\def\txS{\text{S}} +\def\txT{\text{T}} +\def\txU{\text{U}} +\def\txV{\text{V}} +\def\txW{\text{W}} +\def\txX{\text{X}} +\def\txY{\text{Y}} +\def\txZ{\text{Z}} -\def\Four{\mathcal{F}} % Fourier transform -\def\Lebesgue{\mathcal{L}} % Lebesgue -\def\Order{\mathcal{O}} - +\def\txa{\text{a}} +\def\txb{\text{b}} +\def\txc{\text{c}} +\def\txd{\text{d}} +\def\txe{\text{e}} +\def\txf{\text{f}} +\def\txg{\text{g}} +\def\txh{\text{h}} +\def\txi{\text{i}} +\def\txj{\text{j}} +\def\txk{\text{k}} +\def\txl{\text{l}} +\def\txm{\text{m}} +\def\txn{\text{n}} +\def\txo{\text{o}} +\def\txp{\text{p}} +\def\txq{\text{q}} +\def\txr{\text{r}} +\def\txs{\text{s}} +\def\txt{\text{t}} +\def\txu{\text{u}} +\def\txv{\text{v}} +\def\txw{\text{w}} +\def\txx{\text{x}} +\def\txy{\text{y}} +\def\txz{\text{z}} % complex, may be changed later to idot or upright... \def\I{i} +% SPACES \def\sdots{\,\dots\,} \def\qdots{\quad\dots\quad} \def\qRarrow{\quad\Rightarrow\quad} +% DELIMITERS \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} \DeclarePairedDelimiter{\floor}{\lfloor}{\rfloor} \DeclarePairedDelimiter{\ceil}{\lceil}{\rceil} +% OPERATORS \DeclareMathOperator{\e}{e} \DeclareMathOperator{\T}{T} % transposed \DeclareMathOperator{\sgn}{sgn} @@ -44,7 +114,6 @@ % diff, for integrals and stuff % \DeclareMathOperator{\dd}{d} \renewcommand*\d{\mathop{}\!\mathrm{d}} - % functions with paranthesis \newcommand\CmdWithParenthesis[2]{ #1\left(#2\right) @@ -52,3 +121,4 @@ \newcommand\Exp[1]{\CmdWithParenthesis{\exp}{#1}} \newcommand\Sin[1]{\CmdWithParenthesis{\sin}{#1}} \newcommand\Cos[1]{\CmdWithParenthesis{\cos}{#1}} +\newcommand\Order[1]{\CmdWithParenthesis{\mathcal{O}}{#1}} diff --git a/src/util/translation.tex b/src/util/translation.tex index 58a12a0..ac099f0 100644 --- a/src/util/translation.tex +++ b/src/util/translation.tex @@ -15,27 +15,40 @@ % expandafter required because the translation commands dont expand anything % shortcuts for translations % 1: key -\newcommand{\gt}[1]{\expandafter\GetTranslation\expandafter{\fqname:#1}} -\newcommand{\GT}[1]{\expandafter\GetTranslation\expandafter{#1}} -\newcommand{\IfTranslationExists}[1]{ - % \IfTranslation{english}{#1}%{#2}{#3} % only check english. All translations must be defined for english - % \edef\arg{#1} - \def\tempiftranslation{\IfTranslation{english}} - \expandafter\tempiftranslation\expandafter{#1} % only check english. All translations must be defined for english - % {S\color{red}\arg END} - % \IfTranslation{english}{\arg} % only check english. All translations must be defined for english +\newcommand{\IfTranslationExists}[1]{% + % only check english. All translations must be defined for english + \def\tempiftranslation{\IfTranslation{english}}% + \expandafter\tempiftranslation\expandafter{#1}% } -\newcommand{\iftranslation}[3]{ - \IfTranslationExists{\fqname:#1}{#2}{#3} +\newcommand{\iftranslation}[3]{% + \IfTranslationExists{\fqname:#1}{#2}{#3}% +} + +\newcommand{\gt}[1]{% + \iftranslation{#1}{% + \expandafter\GetTranslation\expandafter{\fqname:#1}% + }{% + \fqname:\detokenize{#1}% + }% +} +\newrobustcmd{\GT}[1]{%\expandafter\GetTranslation\expandafter{#1}} + \IfTranslationExists{#1}{% + \expandafter\GetTranslation\expandafter{#1}% + }{% + \detokenize{#1}% + }% } % Define a translation and also make the fallback if it is the english translation % 1: lang, 2: key, 3: translation \newcommand{\addtranslationcustom}[3]{ \ifstrequal{#1}{english}{ - \addtranslationfallback{#2}{#3} - }{} + \addtranslationfallback{#2}{#3} + \immediate\write\translationsaux{\noexpand\addtranslationfallback{#2}{\detokenize{#3}}} + % \immediate\write\translationsaux{\noexpand\addtranslationfallback{#2}{{#3}}}% + }{} + \immediate\write\translationsaux{\noexpand\addtranslation{#1}{#2}{\detokenize{#3}}} \addtranslation{#1}{#2}{#3} } @@ -46,9 +59,11 @@ % hack because using expandafter on the second arg didnt work \def\tempaddtranslation{\addtranslationcustom{#2}} \ifstrequal{#1}{\fqname}{ - \expandafter\tempaddtranslation\expandafter{\fqname}{#3} + % \expandafter\tempaddtranslation\expandafter{\fqname}{#3} + \addtranslationcustom{#2}{#1}{#3} }{ - \expandafter\tempaddtranslation\expandafter{\fqname:#1}{#3} + \addtranslationcustom{#2}{\fqname:#1}{#3} + % \expandafter\tempaddtranslation\expandafter{\fqname:#1}{#3} } } } @@ -59,9 +74,11 @@ % hack because using expandafter on the second arg didnt work \def\tempaddtranslation{\addtranslationcustom{#2}} \ifstrequal{#1}{dummy}{ - \expandafter\tempaddtranslation\expandafter{\fqname}{#3} + % \expandafter\tempaddtranslation\expandafter{\fqname}{#3} + \addtranslationcustom{#2}{\fqname}{#3} }{ - \expandafter\tempaddtranslation\expandafter{#1}{#3} + % \expandafter\tempaddtranslation\expandafter{#1}{#3} + \addtranslationcustom{#2}{#1}{#3} } } } diff --git a/src/util/translations.tex b/src/util/translations.tex index 18f59bc..d911645 100644 --- a/src/util/translations.tex +++ b/src/util/translations.tex @@ -1,9 +1,37 @@ +% WORDS +\Eng[even]{even} +\Ger[even]{gerade} + +\Eng[odd]{odd} +\Ger[odd]{ungerade} + +% SCIENTIFIC \Eng[angle_deg]{Degree} \Ger[angle_deg]{Grad} \Eng[angle_rad]{Radian} \Ger[angle_rad]{Rad} +\Eng[time]{Time} +\Ger[time]{Zeit} + +\Eng[ensemble]{Ensemble} +\Ger[ensemble]{Ensemble} + +\Eng[area]{area} +\Ger[area]{Fläche} + +% SPECIFIC +\Eng[diamond]{Diamond} +\Ger[diamond]{Diamant} + +% FORMATING +\Eng[list_of_quantitites]{List of quantitites} +\Ger[list_of_quantitites]{Liste von Größen} + +\Eng[other]{Others} +\Ger[other]{Sonstige} + \Eng[see_also]{See also} \Ger[see_also]{Siehe auch} @@ -13,15 +41,8 @@ \Eng[and_therefore_also]{and therefore also} \Ger[and_therefore_also]{und damit auch} -\Eng[time]{Time} -\Ger[time]{Zeit} - -\Eng[ensemble]{Ensemble} -\Ger[ensemble]{Ensemble} - -\Eng[even]{even} -\Ger[even]{gerade} - -\Eng[odd]{odd} -\Ger[odd]{ungerade} +\Eng[const:exp]{Experimental value} +\Ger[const:exp]{Experimenteller Wert} +\Eng[const:def]{Defined value} +\Ger[const:def]{Definierter Wert}