我是 Latex 的新手,对这个软件只有基本的了解(我主要使用 MS Word 来准备文档)。我现在的问题是这个文件。我目前正在做的是编辑样本文件并替换适当的句子和单词。例如
\begin{abstract}
Abstract Goes here.
\end{abstract}
到
\begin{abstract}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisis sem. Nullam nec
mi et neque pharetra sollicitudin. Praesent imperdiet mi nec ante. Donec ullamcorper, felis non
sodales commodo, lectus velit ultrices augue, a dignissim nibh lectus placerat pede. Vivamus nunc
nunc, molestie ut, ultricies vel, semper in, veli
\end{abstract}
这样我就替换了作者、标题、摘要和关键词。
但当我尝试替换标题时,我找不到任何代码样本但当我编译它时我得到了标题
1 Heading on level 1 (section)
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Etiam lobortis facilisis sem. Nullam nec
mi et neque pharetra sollicitudin. Praesent imperd
你能告诉我如何编辑标题并在这个 latex 文件中包括图片吗?目前我正在使用 sharelatex.com 编辑 latex 文件
答案1
模板使用了\blinddocument
,必须删除。此外,与 模板不同,最好使用align
。 eqnarray
以下是带注释的示例代码:
%%%%%%%%%%%%%%%%%%%%%%
\documentclass{article}
%%%%%%%%%%%%%%%%%%%%%%
\usepackage[paperwidth=8.5in, paperheight=10.0in]{geometry}
\usepackage{hyperref}
\usepackage[numbers,sort&compress]{natbib}
\usepackage{graphicx}
\usepackage{amsmath,amssymb} %% amsmath added
\usepackage{blindtext}
\usepackage[none]{hyphenat}
\usepackage{authblk}
\hypersetup{bookmarks=true, % show bookmarks bar?
unicode=false, % non-Latin characters in Acrobat’s bookmarks
pdftoolbar=true, % show Acrobat’s toolbar?
pdfmenubar=true, % show Acrobat’s menu?
pdffitwindow=false, % window fit to page when opened
pdfstartview={FitH}, % fits the width of the page to the window
colorlinks=true}
\usepackage{fancyhdr}
\setlength{\headheight}{15.2pt}
\pagestyle{fancy}
\fancyhead[LE,LO,RE,RO]{}
\fancyhead[CE,CO]{\textbf{International Journal of Mathematical Engineering and Science (IJMES)} \newline Volume 3 Issue 2 (February 2014)\ \ \ \ \ \ \ \ ISSN : 2277-6982 \newline \url{http://www.ijmes.com/}}
\title{More than one Author with different Affiliations}
\author[1]{Author A\thanks{[email protected]}}
\author[1]{Author B\thanks{[email protected]}}
\author[1]{Author C\thanks{[email protected]}}
\author[2]{Author D\thanks{[email protected]}}
\author[2]{Author E\thanks{[email protected]}}
\affil[1]{Department of Computer Science, \LaTeX\ University}
\affil[2]{Department of Mechanical Engineering, \LaTeX\ University}
\renewcommand\Authands{ and }
%%%%%%%%%%%%%%%%%
\begin{document}%
%%%%%%%%%%%%%%%%%
\setcounter{page}{1}
\maketitle
\begin{abstract}
Abstract Goes here.
\end{abstract}
\noindent \textbf{Keywords : } Keyword1,keyword2,keyword3.
%% comment the following
%\sloppy
%\nohyphens
%{
%\blinddocument
%% and add the sections and content
\section{My section}
Here we add things. Add a figure here.
\begin{figure}[htb]
\centering
\includegraphics[width=3cm]{example-image-a}
\caption[Short caption]{This can be very long indeed}\label{fig:myfig}
\end{figure}
You see the image?
\section{Just another section}
Here is another one.
\section{How to add references}
You could refer this way \cite{Mikals2014,Bos2014,GarcíaGonzález201419} or this way \citet{Langlois20141}. The citet command is possible due to the ``natbib'' package and ``IEEETranN.bst'' file.
\section{Tables}
Lets move ahead with tables.
\begin{table}[htb]
\caption{My first table} % title of Table
\label{table:t1} % is used to refer this table in the text
\centering % used for centering table
\begin{tabular}{l l l l l} % centered columns (4 columns)
\hline\hline %inserts double horizontal lines
Technique &H/W & Distance & Limitations \\ [0.5ex] % inserts table heading
\hline % inserts single horizontal line
RSSI & No & Few Meters & Noise, Interference in range\\
ToA & Yes & Few Cms & Nodes synchronization\\
TDoA & Ultrasound Txr & Few Meters & Maximum distance of work\\
AoA & Set of receivers & few degrees & Work on small sensor nodes\\[0.5ex] % [1ex] adds vertical space
\hline %inserts single line
\end{tabular}
\end{table}
We can always refer this table \ref{table:t1} using its label. We can include the equations as well. Both environments viz. begin\{equation\} -- end\{equation\} and begin\{eqnarray\} -- end\{eqnarray\} are available. We personally prefer the later one. An example is given below in equation \ref{eq:e1}.
%% better use `align` than `eqnarray`
\begin{align}
x(t) &=
\begin{cases}{ll}
0, & \text{if}\ t<0, \\
1, & \text{otherwise.}
\end{cases}
\label{eq:e1}
\end{align}
That's all from us. You may explore as much as you want.
\bibliographystyle{IEEEtranN}
\bibliography{reference}
%} %% Remove this
\end{document}
答案2
嗯,我看到你正在使用链接到问题的 zip 文件中的模板。从那里你应该构建自己的 MWE 来询问到底是什么问题。
从模板代码中,也就是sample.tex
为了更改标题,您应该更改以下几行:
\usepackage{fancyhdr}
\setlength{\headheight}{15.2pt}
\pagestyle{fancy}
\fancyhead[LE,LO,RE,RO]{}
\fancyhead[CE,CO]{\textbf{International Journal of Mathematical Engineering and Science (IJMES)} \newline Volume 3 Issue 2 (February 2014)\ \ \ \ \ \ \ \ ISSN : 2277-6982 \newline \url{http://www.ijmes.com/}}
由于我们不知道你到底想在标题中放什么,你应该看看fancyhdr
包文档以了解做什么和怎样做。
另一方面,正如 Harish Kumar 所建议的,您应该在第 55 行删除宏\blinddocument
,而不是编写您自己的内容。
最后,为了插入图像,您应该加载graphicx
包,并且可以使用以下代码片段:
\begin{figure}[htbp]
\begin{center}
\includegraphics[<option such scale or width>]{<name of the file>}
\end{center}
\caption{Caption here} %The text of the caption
\label{fig:figure1} %a label for cross reference inside the document
\end{figure}
但首先读这个四是要加深对它的认识。