Latex Indentation - latex

I have a list which I want to indent from the section title. I have tried \indent and \hspace{1cm} without success.
Here is my code
\vspace{0.2in}
\section{Affiliations}
\vspace{0.1in}
\indent The American Geophysical Union.\\
\hspace{1cm} The Seismological Society of America.

For consistent indentation of a "somewhat list-like structure", use adjustwidth from changepage:
\documentclass{article}
\usepackage{changepage}
\begin{document}
\section{Affiliations}
\begin{adjustwidth}{1cm}{0pt}
\setlength{\parindent}{0pt}%
The American Geophysical Union.
The Seismological Society of America.
\end{adjustwidth}
\end{document}
However, I'd suggest a regular list-like structure like itemize:
\documentclass{article}
\usepackage{enumitem}
\begin{document}
\section{Affiliations}
\begin{itemize}[leftmargin=1cm]
\item The American Geophysical Union.
\item The Seismological Society of America.
\end{itemize}
\end{document}

Related

Capitalize journal title for apa in Latex

I am using overleaf to put together my references that follow the apa 7th edition. The journal titles however are not capitalized. How do I correct that? Note that I tried the method suggested in this post Capitalize journal name in latex but it didn't work for me.
Here is a minimal reproducible example:
\documentclass[man]{apa7}
\usepackage[american]{babel}
\usepackage{csquotes}
\usepackage[style=apa,uniquename=false,sortcites=true,sorting=nyt,backend=biber]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\addbibresource{refs.bib}
\begin{document}
\parencite{golinkoff1979comparison} said this
\printbibliography
\end{document}
My refs.bib here
#article{golinkoff1979comparison,
title={A comparison of fathers' and mothers' speech with their young children},
author={Golinkoff, Roberta Michnick and Ames, Gail Johnson},
journal={Child development},
pages={28--32},
year={1979},
publisher={JSTOR}
}
The reference prints this:
This is a cross post: https://tex.stackexchange.com/questions/670231/capitalize-journal-title-for-apa-in-latex
Same method as in the post you linked to:
\documentclass[man]{apa7}
\usepackage[american]{babel}
\title{text}
\shorttitle{short title}
\usepackage{csquotes}
\usepackage[style=apa,uniquename=false,sortcites=true,sorting=nyt,backend=biber]{biblatex}
\DeclareLanguageMapping{american}{american-apa}
\begin{filecontents*}[overwrite]{\jobname.bib}
#article{golinkoff1979comparison,
title={A comparison of fathers' and mothers' speech with their young children},
author={Golinkoff, Roberta Michnick and Ames, Gail Johnson},
journal={Child development},
pages={28--32},
year={1979},
publisher={JSTOR}
}
\end{filecontents*}
\usepackage{mfirstuc}
\DeclareFieldFormat{journaltitle}{\capitalisewords{#1}}
\addbibresource{\jobname.bib}
\begin{document}
\parencite{golinkoff1979comparison} said this
\printbibliography
\end{document}

Bibtex not showing in Latex Doc when inserted in main.tex

I'm trying to include the following in my latex doc (references.tex)
#INPROCEEDINGS{inception,
author={C. {Szegedy} and {Wei Liu} and {Yangqing Jia} and P. {Sermanet} and S. {Reed} and D. {Anguelov} and D. {Erhan} and V. {Vanhoucke} and A. {Rabinovich}},
booktitle={2015 IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
title={Going deeper with convolutions},
year={2015},
volume={},
number={},
pages={1-9},
keywords={convolution;decision making;feature extraction;Hebbian learning;image classification;neural net architecture;resource allocation;convolutional neural network architecture;resource utilization;architectural decision;Hebbian principle;object classification;object detection;Computer architecture;Convolutional codes;Sparse matrices;Neural networks;Visualization;Object detection;Computer vision},
doi={10.1109/CVPR.2015.7298594},
ISSN={1063-6919},
month=Jun,
address={Boston, MA}
}
#InProceedings{vgg,
author = "Karen Simonyan and Andrew Zisserman",
title = "Very Deep Convolutional Networks for Large-Scale Image Recognition",
booktitle = "International Conference on Learning Representations",
year = "2015",
month = May,
address = {San Diego, CA}
}
#inproceedings{dean2012large,
title={Large scale distributed deep networks},
author={Dean, Jeffrey and Corrado, Greg and Monga, Rajat and Chen, Kai and Devin, Matthieu and Mao, Mark and Senior, Andrew and Tucker, Paul and Yang, Ke and Le, Quoc V},
booktitle={Advances in neural information processing systems},
pages={1223--1231},
month = dec,
year={2012},
address = {Lake Tahoe, NV}
}
However, when I include this in my latex doc, it doesn't show, any idea what is wrong here?
\documentclass[12pt,twoside]{report}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{biblatex}
\usepackage{acronym}
\addbibresource{references.bib}
\usepackage{titlesec}
\usepackage{lipsum}
\titleformat{\chapter}[display]
{\normalfont\bfseries}{}{0pt}{\Large}
\usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry}
\usepackage{fancyhdr}
\graphicspath{{images/}}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[RO,LE]{Scaling A Neural Network Based Flower Counting Application}
\renewcommand{\headrulewidth}{0.4pt}
\begin{document}
\input{cover}
\pagenumbering{roman}
\chapter*{Permission To Use}
\addcontentsline{toc}{chapter}{Permissions To Use}
\input{sections/permissions}
\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}
\input{sections/abstract}
\chapter*{Acknowledgements}
\addcontentsline{toc}{chapter}{Acknowledgements}
\input{sections/acknowledgements}
\newgeometry{top=0mm, bottom=25mm}
\tableofcontents
\addcontentsline{toc}{chapter}{Contents}
\listoftables
\addcontentsline{toc}{chapter}{List of Tables}
\listoffigures
\addcontentsline{toc}{chapter}{List of Figures}
\newgeometry{top=25mm, bottom=25mm}
\addcontentsline{toc}{chapter}{List of Abbreviations}
\include{sections/abbreviations}
\chapter{Introduction}
\pagenumbering{arabic}
\input{sections/introduction}
\chapter{Section Two Title}
\input{sections/section/section-2}
\chapter{Section Three Title}
\input{sections/section/section-3}
\chapter{Section Four Title}
\input{sections/section/section-4}
\chapter{Section Five Title}
\input{sections/section/section-5}
\chapter{Conclusion}
\input{sections/conclusion}
\appendix
\chapter{Appendix Title}
\input{sections/appendix}
\printbibliography
\end{document}
Never ignore error messages. Have a look at the tiny red rectangle at the top right, this tells you where the problem is.
Multiple problems:
You must not use math commands like ^ in normal text mode
\acro{P$^2$IRC}{Plant Phenotyping and Imaging Research Center}
The command \ection is not defines, I assume you mean \section? (there are several occasions)
you must \cite{...} at least one entry from your .bib file

Undefined control sequence \chapter

Hello I'm new in Latex.
I was trying to write my thesis, using the MasterDoctoralClass.cls.
This is my main.tex:
\documentclass[
11pt,
english,
singlespacing,
headsepline
]{MastersDoctoralThesis}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{mathpazo}
\usepackage[backend=bibtex,style=authoryear,natbib=true]{biblatex} )
\addbibresource{example.bib}
\usepackage[autostyle=true]{csquotes}
%----------------------------------------------------------------------------------------
% MARGIN SETTINGS
%----------------------------------------------------------------------------------------
\geometry{
paper=a4paper,
inner=2.5cm,
outer=3.8cm,
bindingoffset=.5cm,
top=1.5cm,
bottom=1.5cm
}
%----------------------------------------------------------------------------------------
% THESIS INFORMATION
%----------------------------------------------------------------------------------------
\thesistitle{Title Thesis}
\supervisor{Prof. X \textsc{Y} \\ Dr. Z \textsc{W}}
\degree{Master of Science in Electronic Engineering}
\author{Name \textsc{Surname}}
\subject{Electronic Engineering}
\keywords{}
\university{{Università}}
\department{{Department of Information Engineering, Electronics and Telecommunications}}
\group{{Master of Science in Electronic Engineering}}
\faculty{{Faculty of Information Engineering, Informatics and Statistics}}
\AtBeginDocument{
\hypersetup{pdftitle=\ttitle}
\hypersetup{pdfauthor=\authorname}
\hypersetup{pdfkeywords=\keywordnames}
}
\begin{document}
\frontmatter
\pagestyle{plain}
%----------------------------------------------------------------------------------------
% TITLE PAGE
%----------------------------------------------------------------------------------------
\begin{titlepage}
\begin{center}
\includegraphics[scale=1]{logo.jpg}
\end{center}
\begin{center}
\vspace*{.01\textheight}
\textsc{\Large Master Thesis}\\[1cm]
\HRule \\[0.4cm]
{\huge \bfseries \ttitle\par}\vspace{0.4cm}
\HRule \\[1.5cm]
\begin{minipage}[t]{0.4\textwidth}
\begin{flushleft} \large
\emph{Author:}\\
\href{}{\authorname}
\end{flushleft}
\end{minipage}
\begin{minipage}[t]{0.4\textwidth}
\begin{flushright} \large
\emph{Supervisor:} \\
{\supname}
\end{flushright}
\end{minipage}\\[2cm]
\begin{center}
\includegraphics[scale=0.4]{logo2.jpg}\hfill\includegraphics[scale=0.5]{logo3.jpg}
\end{center}
\vspace*{1.5cm}
\groupname\\\deptname\\[1.5cm]
\vfill
\rule{3cm}{1pt}\\
{\large \today}\\[4cm]
%\includegraphics{Logo}
\vfill
\end{center}
\end{titlepage}
%----------------------------------------------------------------------------------------
% QUOTATION PAGE
%----------------------------------------------------------------------------------------
\vspace*{0.2\textheight}
\begin{flushright}
\thispagestyle{empty}
\vspace*{5cm}
\itshape\enquote{Something}\\[0.3cm]
\end{flushright}
\hfill Name
%----------------------------------------------------------------------------------------
% ABSTRACT PAGE
%----------------------------------------------------------------------------------------
\begin{abstract}
\addchaptertocentry{\abstractname}
The Thesis Abstract is written here (and usually kept to just this page). The page is kept centered vertically so can expand into the blank space above the title too\ldots
\end{abstract}
%----------------------------------------------------------------------------------------
% ACKNOWLEDGEMENTS
%----------------------------------------------------------------------------------------
\begin{acknowledgements}
\addchaptertocentry{\acknowledgementname}
The acknowledgments and the people to thank go here, don't forget to include your project advisor\ldots
\end{acknowledgements}
%----------------------------------------------------------------------------------------
% LIST OF CONTENTS/FIGURES/TABLES PAGES
%----------------------------------------------------------------------------------------
\tableofcontents
\listoffigures
\listoftables
%----------------------------------------------------------------------------------------
% ABBREVIATIONS
%----------------------------------------------------------------------------------------
\begin{abbreviations}{ll} %
\textbf{LAH} & \textbf{L}ist \textbf{A}bbreviations \textbf{H}ere\\
\textbf{WSF} & \textbf{W}hat (it) \textbf{S}tands \textbf{F}or\\
\end{abbreviations}
%----------------------------------------------------------------------------------------
% PHYSICAL CONSTANTS/OTHER DEFINITIONS
%----------------------------------------------------------------------------------------
\begin{constants}{lr#{${}={}$}l}
Speed of Light & $c_{0}$ & \SI{2.99792458e8}{\meter\per\second} (exact)\\
\end{constants}
%----------------------------------------------------------------------------------------
% SYMBOLS
%----------------------------------------------------------------------------------------
\begin{symbols}{lll}
$a$ & distance & \si{\meter} \\
$P$ & power & \si{\watt} (\si{\joule\per\second}) \\
%Symbol & Name & Unit \\
\addlinespace
$\omega$ & angular frequency & \si{\radian} \\
\end{symbols}
%----------------------------------------------------------------------------------------
% DEDICATION
%----------------------------------------------------------------------------------------
\dedicatory{For my family}
\end{document}
%----------------------------------------------------------------------------------------
% THESIS CONTENT - CHAPTERS
%----------------------------------------------------------------------------------------
\mainmatter
\pagestyle{thesis}
\include{Chapters/Introduction}
%\include{Chapters/Chapter1}
If I compile main.tex (with PDFLatex, I also did it with Latex and PDFTex) it doesn't return me any error, but when I look at the PDF it doesn't print the Introduction.
So I was watching to the Introduction.tex:
% Chapter 1
\chapter{Chapter Title Here} % Main chapter title
\label{Chapter1} % For referencing the chapter elsewhere, use \ref{Chapter1}
%----------------------------------------------------------------------------------------
% Define some commands to keep the formatting separated from the content \newcommand{\keyword}[1]{\textbf{#1}} \newcommand{\tabhead}[1]{\textbf{#1}} \newcommand{\code}[1]{\texttt{#1}} \newcommand{\file}[1]{\texttt{\bfseries#1}} \newcommand{\option}[1]{\texttt{\itshape#1}}
%----------------------------------------------------------------------------------------
\section{Welcome and Thank You} Welcome to this \LaTeX{} Thesis Template, a beautiful and easy to use template for writing a thesis using the \LaTeX{} typesetting system.
If you are writing a thesis (or will be in the future) and its subject is technical or mathematical (though it doesn't have to be), then creating it in \LaTeX{} is highly recommended as a way to make sure you can just get down to the essential writing without having to worry over formatting or wasting time arguing with your word processor.
\LaTeX{} is easily able to professionally typeset documents that run to hundreds or thousands of pages long. With simple mark-up commands, it automatically sets out the table of contents, margins, page headers and footers and keeps the formatting consistent and beautiful. One of its main strengths is the way it can easily typeset mathematics, even \emph{heavy} mathematics. Even if those equations are the most horribly twisted and most difficult mathematical problems that can only be solved on a super-computer, you can at least count on \LaTeX{} to make them look stunning.
And if I complie it I have some errors:
Undefined control sequence \chapter
Missing \begin{document}. \chapter{C
Undefined control sequence \section
I tryed to put the \begin{document} but I still have the same errors on the undefined control sequence and other errors like
The font size command \normalisize si not defined:there is probably something wrong with the class file.
Can someone help me, please? Thanks!
If on line 13 you remove the ) and move the \end{document} statement on line 183 to the end of the main, it will compile properly.

! LaTeX Error: Something's wrong--perhaps a missing \item

\documentclass[11pt,a4paper]{report}
\usepackage[latin1]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{graphics}
\usepackage {epsfig}
\usepackage{fancyhdr}
\linespread{1.4}
\setlength{\topmargin}{-0.4in}
\setlength{\topskip}{0.3in} % between header and text
\setlength{\textheight}{9.5in} % height of main text
\setlength{\textwidth}{6in} % width of text
%\setlength{\leftmargin}{-0.6in}
%\setlength{\oddsidemargin}{0.75in} % odd page left margin
%\setlength{\evensidemargin}{0.75in} % even page left margin
\addtolength{\evensidemargin}{-0.4in}
\addtolength{\oddsidemargin}{-0.4in}
\addtolength{\textwidth}{0.4in}
\begin{document}
\renewcommand\bibname{References}
\begin{titlepage}
\input{TitlePage}
\end{titlepage}
\pagenumbering{gobble}
\newpage
\pagenumbering{roman}
%\tableofcontents
\chapter*{
\begin{center}
{Abstract}
\end{center}
}
\begin{quotation}
\paragraph{}
Bank are providing mobile application to their customer. We are developing
banking application using Location Based Encryption. As compare to current
banking application which are location independent,
\\
\textbf{Keywords:}
Enter Keyword here.......
\end{quotation}
\newpage
\pagenumbering{arabic}
\pagestyle{fancy}
\fancyhead{} % clear all fields
\fancyhead[RO,LE]{}
\renewcommand\headrule{}
\rhead{PROJECT NAME}
\renewcommand{\footrulewidth}{0.4pt}
\fancyfoot[RE,LO]{P.E.O COLLEGE}
\input{intro}
%\input{Literature_Survey}
\input{table}
%\input{problmstmt}
\input{scope}
%\input{future}
\input{conclusion}
\input{ref}
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
I have this latex code. But when I try to compile it it gives me an error saying :
! LaTeX Error: Something's wrong--perhaps a missing \item.See the
LaTeX manual or LaTeX Companion for explanation.Type H for
immediate help....
This error is on line:
\end{quotation}
Why am I getting this error? I haven't added any \item on the line where I'm getting the error.
The \paragraph and \\ instructions in the quotation do not make much sense. I guess that you meant something like this:
\begin{quotation}
\noindent
Banks are providing mobile applications to their customer. We are developing a
banking application using \emph{Location Based Encryption}. Compared to current
banking applications, which are location independent, \ldots
\paragraph{Keywords:} bank, application, encryption, location, mobile.
\end{quotation}

\sbox from inside an environment

I'm trying to save some text inside an environment for later use. The smallest test case I could come up with is this. The saved text in the sbox isn't available after the environment is closed. How can I work around that? Thanks.
\documentclass{article}
\begin{document}
\newsavebox{\somebox}
\begin{itemize}
\item hello1
\item hello1 \sbox{\somebox}{Some text}
\end{itemize}
This should show something, but does not: "\usebox{\somebox}"
\end{document}
What you're running into here is a scoping issue. In (La)TeX, you can introduce scopes with { ... }, \bgroup ... \egroup, or \begingroup ... \endgroup. The former two are roughly the same, as \bgroup and \egroup are defined by \let\bgroup{ and \let\egroup}; the last one is slightly different. But the scoping property is the same: any commands, boxen, etc., created or modified within those scopes are not visible outside. And in LaTeX, all environments \begin{env} ... \end{env} implicitly wrap their contents in \begingroup ... \endgroup. This means that your\sbox{\somebox}{Some text} modification is only visible until the \end{itemize}; after that, the modification is undone. To get around this, prepend any command like \newcommand, \def, \newsavebox, \sbox, etc., with \global, which forces the definition to take place at the global scope and be visible everywhere.
Also, to use quotes in (La)TeX, write ``double quoted'', ``double quoted", or `single quoted'; the " character is only for closing quotes, not opening quotes. Putting this all together gives you the revised snippet
\documentclass{article}
\begin{document}
\newsavebox{\somebox}
\begin{itemize}
\item hello1
\item hello1 \global\sbox{\somebox}{Some text}
\end{itemize}
This should show something, and in fact does: ``\usebox{\somebox}''
\end{document}
I think I can work around this by using \def. like so:
\documentclass{article}
\begin{document}
\begin{itemize}
\item hello1
\item hello1
\global \def \somebox {Some text}
\end{itemize}
This should show something: \somebox
\end{document}

Resources