Tag Archives: Latex

How to empty a whole line in latex (simple and effective)

Sometimes we need to empty a line, especially when we are doing a beamer. However, it seems that latex can’t empty a whole line directly. Two consecutive “\ \” still only have the function of line feed

At present, the online version is “vSpace {*}”, which requires you to estimate the length of the space, which is very inconvenient

I found an easy way to do it

\\ \hspace*{\fill} \\

That is, line feed, fill with blank space, and then line feed, you can achieve the effect of leaving a whole line empty, this method does not need any adjustment of the environment, you can use it directly

Latex’s mathematical formula: derivation and representation of fraction

Representation method

: fractional representation
: partial derivative sign
: normal derivative D (orthomorphic)

code effect meaning

x

y

\frac{x}{y}

YX

score

\partial

partial derivative symbol

d

t

\mathrm{d}t

DT

derivative

give an example

$$
\frac{\partial y}{\partial x_1} + \frac{\partial y}{\partial x_2} \\
\frac{\mathrm{d}y}{\mathrm{d}x_1} + \frac{\mathrm{d}y}{\mathrm{d}x_2}
$$

The display effect is as follows:
0

y

x

one

+

y

x

two

\frac{\partial y}{\partial x_ 1} + \frac{\partial y}{\partial x_ 2}

∂x1​∂y​+∂x2​∂y​

d

y

d

x

+

d

z

d

x

\frac{\mathrm{d}y}{\mathrm{d}x} + \frac{\mathrm{d}z}{\mathrm{d}x}

dxdy​+dxdz​

Greek letters in latex

Greek alphabet, we started to know it from primary school, but I still rely on the pronunciation of it. Especially in the analysis of university mathematics, there are so many Greek letters that many classical formulas are represented by Greek letters. It has naturally become an indispensable symbol in the field of mathematics, turning the complex content of mathematics into clear, easy to understand and approachable.

Today, why talk about the Greek alphabet? I have to use it when I wrote latex the day before yesterday

ε

Speaking of, what we found in Baidu Encyclopedia is

ϵ

The symbol is not what I want, and my hatred of Baidu suddenly increases several times. I found the correct way to write it from Google, including other commonly used Greek letters. By the way, I also want to introduce the upper and lower case forms of Greek letters. Think of what you want to use frequently, so write it down for subsequent use. Do enough homework to make yourself more convenient and successful. Enjoy it!


The usage of Greek letters in latex

In latex, the Greek letter should be written as a formula. In the $$sign, use the slash and the English symbol of Greek letter.

Greek letters in latex form

For ease of understanding, show how to write Greek letters in code symbols.

$\epsilon$

Results:
there was no significant difference between the two groups

ϵ


Greek alphabet

Greek lowercase and uppercase latex form Greek lowercase and uppercase latex form
latex form

α

A

\alpha A

μ

N

\mu N

β

B

\beta B

ξ

Ξ

\xi \Xi

γ

Γ

\gamma \Gamma o O o O

δ

Δ

\delta \ Delta

π

Π

\pi \Pi

ϵ

ε

E

\epsilon \varepsilon E

ρ

ϱ

P

\rho \varrho P

ζ

Z

\zeta Z

σ

Σ

\sigma \Sigma

η

H

\eta H

τ

T

\tau T

θ

ϑ

Θ

\theta \vartheta \Theta

υ

Υ

\upsilon \Upsilon

ι

I

\iota I

ϕ

φ

Φ

\phi \varphi \Phi

κ

K

\kappa K

χ

X

\chi X

λ

Λ

\lambda \Lambda

ψ

Ψ

\psi \Psi

μ

M

\mu M

ω

Ω

\omega \Omega

The usage of Greek alphabet in other programming languages

In other programming languages, the implicit latex method is used

$\Psi$

If it’s a formula, it’s used the same way.

Latex wave line~

Generally speaking, latex has two ways to make wave line

1. In mathematical mode

$\sim$

2. In text mode

\textasciitilde

The wavy line in mathematical mode is larger than that in text mode.

Download and install texlive

Found a download Texlive huazhong university of science and technology of mirror sites, http://mirrors.hust.edu.cn/CTAN/, and then in the systems (directory) find Texlive, click enter, then click enter Images, you can select an image file to download.

The installation process can be found in a blog post

Linux system tools installation, the installation of Ubuntu 16.04 TexLive 2016: https://blog.csdn.net/qq_33429968/article/details/62928742

How to Use Subfigure in Latex

First add the subfigure macro package in the introduction area.

\usepackage{subfigure}

Suppose I want to arrange three images as three sub-images to solve the problem of cross-page arrangement of images, then use the following code:

\begin{figure}[h]
	\addtocounter{figure}{-1} %%%%%%%%%note1
	\centering
	\subfigure{
		\begin{minipage}[t]{1\linewidth}%%%%%%%%%note2
			\includegraphics[width=0.9\linewidth]{Index}%%%%%%%%%note3
		\caption{Image 1 Name}
		\label{0}
		\end{minipage}%
	}%

%%%%%%%%%note4
	\subfigure{
		\begin{minipage}[t]{1\linewidth}
				\includegraphics[width=0.9\linewidth]{Index}
			\caption{Image 2 Name}
			\label{1}
		\end{minipage}%
	}%


	\subfigure{
		\begin{minipage}[t]{1\linewidth}
			\includegraphics[width=0.9\linewidth]{Index}
		\caption{Image Name}
		\label{2}
		\end{minipage}
	}%
	
	\centering
\end{figure}


Description:
Note 1: Note that you need to subtract 1 from the image label manually when using a subfigure, because the larger image composed of three subfigures is also involved in counting. Note 2: This controls the width of each subgraph. For example, if you want to put 4 graphs in a row, set this to 0.25\linewidth. Note 3: This controls the size of each subgraph. Note 4: Note that this line (there may be several pictures) has been arranged, move to the next line.


Add a new page in latex

When we use Latex, we sometimes need to start a new page to continue writing. Instead of using \ newPage, you’d better implement this using \ ClearPage.
Because:
\newpage: The \newpage command ends The current page.
\clearpage: The \clearpage command ends the current page and causes all figures and tables that have so far appeared in the input to be printed.
In plain English, when you add a large number of new pages, the two are basically the same. When you add a small number of new pages, \ NewPage won’t achieve the effect you want, but \ ClearPage will.
Here’s an example:
Exp1:
\documentclass[twocolumn]{article}
\usepackage{CJK}
\setlength\textwidth{8cm}
\setlength\textheight{8cm}
\begin{document}
\begin{CJK*}{song}
\CJKtilde
first side
\newpage
sorry, first side
\clearpage
\end{CJK*}
\end{document}

Exp2:
\documentclass[twocolumn]{article}
\usepackage{CJK}
\setlength\textwidth{8cm}
\setlength\textheight{8cm}
\begin{document}
\begin{CJK*}{song}
\CJKtilde
first side
\clearpage
haha, second side
\clearpage
\end{CJK*}
\end{document}

Latex row overflow problem overfull / hbox (1.1499pt too wide) in paragraph

Reference: http://en.wikibooks.org/wiki/LaTeX/Errors_and_Warnings#Overfull_hbox

Problem source: When writing latex source files, Overfull \hbox (1.1499 PT too wide) in paragraph often appears. When viewing the compiled PDF, we find that the line exceeds the boundary, so we need to solve it.

Solution: Find the corresponding prompt line, then cut off the last few words arbitrarily, then start another line.
Eg; I’m very powerful in computer.
Change to: I’m very happy
Powerful in computer.
Justification problem: Moving the last word on the line to the next line would make the Spaces in the line wider than the current limit.)

Latex’s problem about package missing

Latex Error:File ‘etoolbox. Sty ‘not found latex Error:
latex Error:File 'etoolbox. Sty' not found
What should I do when I make such a mistake?
The

    click http://mirror.unl.edu/ctan/help/Catalogue/brief.html in download file with the same name. Copy etoolbox. Sty and Etoolbox. Def to../Tex /latex/ EToolbox/below EToolbox. PDF copy to../Doc /latex/ EToolbox/MiKTeX open Setting, General — & GT; Refresh FNDB and restart WinEdt.

Sometimes the download is ins and other files, how to do?
, add a step after the top 3. CMD switch to the current directory, and execute latex toolbox. Ins to generate the.sty file, then refresh.

dvips Error:-no default destination available

# dvips work-summary.dvi

This is dvips(k) 5.95a Copyright 2005 Radical Eye Software (www.radicaleye.com)

‘ TeX output 2008.09.16:1816’ -> work-summary-08_09.ps

<tex.pro><texps.pro>. <cmti10.pfb><cmti12.pfb><cmmi10.pfb><cmr7.pfb> lpr: Error – no default destination available.

lpr is about printer or print file

Because I have no printer connected to my PC, so I did below:

#texconfig

Then:

->choose dvips,

->choose Dest,

->press enter (so that dvips destination can be a file, instead of a printer).