# Latex Listing Source shift right side?

I am using Latex listings package to add the source code in my document, but the problem is on the left side some character is missing as showing in the picture.

\usepackage{listings}


Source Code

\begin{adjustwidth}{6em}{3em}
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the string.
}
}

\end{lstlisting}


Is there any command to shift the source code ? Any suggestion will be greatly appreciate ?

MainFile

\documentclass[letter,14pt,landscape,a4paper]{book} %{article}
\input{inc/page_style}
\input{foo}
\end{document}


page_style

%\documentclass[11pt,letter,landscape] {article}%{amsart}
%\usepackage{inc/weekly_calendar}
\usepackage{inc/monthly_calendar}%Comment week_calender
\let\proof\relax
\let\endproof\relax
\usepackage{amsmath,amssymb}
%\usepackage{inc/xymtex}
\usepackage{units}
%\usepackage{inc/chemstr}
\usepackage{scrextend}
\usepackage{graphicx}
\usepackage{inc/example}
\changefontsizes{14pt}
\usepackage{longtable}
\usepackage{lipsum}

\usepackage[normalem]{ulem} % either use this (simple) or
\usepackage{soul} % use this (many fancier options)
\usepackage{pdfcomment}

\usepackage[inline]{inc/trackchanges}

\usepackage{cancel}
\usepackage[normalem]{ulem}

\usepackage{paralist}
\usepackage{soul}
\usepackage{hyperref}

\usepackage{chngpage}

\usepackage{listings}
\usepackage[inline]{enumitem}
\usepackage{color}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\lstset{
basicstyle=\ttfamily\scriptsize{150pt},%basicstyle=\ttfamily\scriptsize,
keywordstyle=\color{blue}\ttfamily,
stringstyle=\color{red}\ttfamily,
language=c,
gobble=4,
basicstyle=\scriptsize,
upquote=true,
aboveskip={2.5\baselineskip},
columns=fullflexible,
showstringspaces=false,
extendedchars=true,
breaklines=true,
showtabs=false,
showspaces=false,
showstringspaces=false,
identifierstyle=\ttfamily,
keywordstyle=\color[rgb]{0,0,1},
{0.133,0.545,0.133},stringstyle=\color[rgb]{0.627,0.126,0.941},
}
\hypersetup{
bookmarks=true,         % show bookmarks bar?
unicode=false,          % non-Latin characters in Acrobat’s bookmarks
pdftoolbar=true,        % show Acrobat’s toolbar?
pdffitwindow=false,     % window fit to page when opened
pdfstartview={FitH},    % fits the width of the page window
pdftitle={My title},    % title
pdfauthor={Author},     % author
pdfsubject={Subject},   % subject of the document
pdfcreator={Creator},   % creator of the document
pdfproducer={Producer}, % producer of the document
pdfkeywords={keyword1} {key2} {key3}, % list of keywords
pdfnewwindow=true,      % links in new window
citecolor=green,        % color of links to bibliography
filecolor=blue,      % color of file links
urlcolor=blue           % color of external links %cyan
}
\usepackage{color, colortbl}
\definecolor{Gray}{gray}{0.9}
%\definecolor{LightCyan}{rgb}{0.88,1,1}
\definecolor{Gray}{gray}{0.9}
\definecolor{LightCyan}{rgb}{0,1,1}
\usepackage[first=0,last=9]{lcg}
\newcommand{\ra}{\rand0.\arabic{rand}}

\usepackage{fancybox}
\usepackage{datetime}
\usepackage{enumitem}
\setlist{nolistsep}
\usepackage{listings}
\usepackage[inline]{inc/trackchanges}
\usepackage{bbding}
\usepackage{longtable}
\usepackage[landscape,margin=0.4in]{geometry}
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{hyperref} %bookmarks
\usepackage{verbatim}
%\usepackage[T1]{fontenc}
\usepackage{fourier}  %setting font
%\pagecolor{lightgray} %page background
\usepackage{scrextend}
\changefontsizes{11pt}
\usepackage{lipsum}
\definecolor{bookColor}{cmyk}{90,0,0,1.90}%0.90\%black
\definecolor{oddcolumnscolor}{rgb}{0.93,0.93,0.93} %long table
\usepackage{color}
\usepackage{enumitem}
\usepackage{tikz}
\usetikzlibrary{matrix,shapes,arrows,positioning,chains, calc}
\usepackage[T1]{fontenc}
\usepackage{titlesec}
\usepackage{xcolor}
\newcommand{\chapnumfont}{%     % define font for chapter number
\usefont{T1}{pnc}{b}{n}%      % choose New Chancery, bold, normal shape
\fontsize{70}{70}%          % font size 100pt, baselineskip 100pt
\selectfont%                  % activate font
}
\colorlet{chapnumcol}{gray!75}  % color for chapter number
\titleformat{\chapter}[display]
{\filleft\bfseries}
{\filleft\chapnumfont\textcolor{chapnumcol}{\thechapter}}
{-15pt}
{\Huge}
%--------------------------------------------
\pagenumbering{arabic}%comment if you to start from index from the TOC
\setcounter{page}{1}%comment if you to start from index from the TOC

%--------------------------------------------Remove the empty pages between chapter
\let\cleardoublepage\clearpage

%--------------------------------------------
\begin{document}
%--------------------------------------------
\pagestyle{empty}
\noindent
\StartingDayNumber=2 % Calendar start:1=Sunday, 2=Monday
\begin{center}
\vspace{-8mm}
\textsc{\large {\color{blue}\textbf{Schedule Roy \ArrowBoldDownRight }}}
\rule[10mm]{12.0cm}{1mm}
\vspace{-1.5mm} %ruller {}{long}{width}
%\line(3,0){250}
\end{center}
%\tableofcontents
%\usepackage[table]{xcolor}
%\definecolor{lightgray}{gray}{0.9}


foo.tex

\begin{adjustwidth}{6em}{3em}
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the string.
}
}

\end{lstlisting}

• Could you provide an MWE? – alexwlchan May 5 '14 at 16:47
• @alexwlchan added the source code. – J4cK May 5 '14 at 17:10
• Your snippet doesn't give me the output seen in your image, can you turn it into a complete example demonstrating the problem? – Torbjørn T. May 5 '14 at 17:14
• As for this particular case, I think you might have a gobble=4 set somewhere in your preamble, but without a complete example I can’t be sure. – alexwlchan May 5 '14 at 17:15
• So @alexwlchan is right, you've added gobble=4 to the \lstset in the preamble. Also note that the M in MWE means 'minimal', and the code you posted isn't really that. You can read more about creating minimal working examples (MWE) at meta.tex.stackexchange.com/q/228 – Torbjørn T. May 5 '14 at 17:27

Your problem comes in this line from page_style:
gobble=4,

Quoting from the documentation for the listings package:
gobble=⟨number⟩
gobbles ⟨number⟩ characters at the beginning of each environment code line. This key has no effect on \lstinline or \lstinputlisting.