latex初学者的经验

1.一定要及时换行,要不然latex是不会替你自动换行缩进的,相反如果我第几十个字来换一次那么它就会替我自动缩进下换行。

2.关于中文首段缩进问题可用 \usepackage{indentfirst} + \setlength{\parindent}{2em} 来实现

3.\setcounter{section}{-1}可使章节从0序号开始

4.\usepackage[top=25mm,left=25mm,right=20mm,bottom=20mm]{geometry}可以来定制文档格式

5.\documentclass[a4paper,12pt]{article}可以用来指定纸张和通用字体大小

6.\usepackage[dvips]{graphicx}

    \begin{figure}[!h]  %只有加了[!h]才能在文字下方显示
    \centering
    \includegraphics[width=16cm]{1}
    \renewcommand{\figurename}{图}
    \label{figure1}
    \caption{}
    \end{figure}

可以被用来插入esp图片,图片可用gimp转换得到,如果使用参考引用的话figure1不能为中文

7.正文中的参考文献序号可由 $\,^\mathrm{\cite{id}}$来达到上标的目的,另外id不能为中文

8.\renewcommand{\figurename}{图}

  \renewcommand{\contentsname}{目录}
  \renewcommand{\abstractname}{摘要}

  可以将英文格式改为中文。

9.如果使用\usepackage{listings} + \begin{lstlisting} \end{lstlisting}包含代码出错时不妨试试\begin{lstlisting}[extendedchars=true,language=C++]或\begin{lstlisting}[extendedchars=false,language=C++]

如果还是有些中文注释出问题的话不妨试一下\lstset{basicstyle=\ttfamily,escapechar=`}来设置逃逸字符,然后使用

  `出问题的中文注释`来解决问题。

10.关于产生要写学号姓名那一类的封面

可以使用\begin{tabular}{l@{}c p{10cm}}来实现!

11.使用vspace{1cm}来产生一个中文空格




原文地址:https://www.cnblogs.com/findstr/p/2803700.html