0

got a listing where the code include a very long sequence of characters (letters, numbers & other). With linebreak=true, the sequence gets broken at non-letter characters. However I still got a very long sequence of letters, that's not getting breaking down. With all other options, see code, the result is still the same.

\lstinputlisting[language=XML, breaklines=true, breakindent=0pt, breakautoindent=true, linewidth=\textwidth, breakatwhitespace=false,  caption=Respons.]{outlook/Vinden_kalender_item_antwoord.xml}

Working in writelatex.com.

vinden_kal ..., the problem is the t:ItemId tag At the + and /, the line gets broken down.

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%       This syntax file is intended for students of the        %
%       FIIW writing their master thesis.               %
%       We hope they can use it as a helping hand in writing        %
%       their thesis.                           %
%                                       %
%       Syntax originally written by Filip Van Rysselberghe     %
%       Adapted for KaHo St. Lieven by Bart Blanckaert          %
%                                       %
%       Modified by Koen Vangheluwe based on PhD stylefile of RUG   %
%                                       %
%       Adapted for FIIW by Jannes Verstichel               %
%       Last modified: 12/11/2013 v1.0                  %
%                                       %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 

%%%%fiiw_gent
\makeatletter

\usepackage{color}
\usepackage{parallel}
\usepackage{textpos}

% \usepackage[scaled]{uarial}
\renewcommand*\familydefault{\sfdefault} %% Only if the base font of the document is to be sans serif


% fancyheadings
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\chaptermark}[1]{\markboth{\thechapter\ #1}{}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
\fancyhf{}
\fancyhead[R]{\scriptsize\bfseries\sffamily\thepage}
\fancyhead[L]{\scriptsize\bfseries\sffamily\leftmark}
\fancypagestyle{plain}{
    \fancyhf{}
    \fancyfoot[C]{\scriptsize\bfseries\sffamily\thepage}
    \renewcommand{\headrulewidth}{0pt}
    \renewcommand{\footrulewidth}{0pt}
}

% Koen Vangheluwe 29/05/2009: toegevoegd om "\headheight is too small" warning te voorkomen
\setlength{\headheight}{14pt}

% Koen Vangheluwe 16/03/2010: toegevoegd wegens voor witte pagina's met empty style bij het gebruik van twoside en report
\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
  \hbox{}
  \thispagestyle{empty}
  \newpage
  \if@twocolumn\hbox{}\newpage\fi\fi\fi}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% We'll head off with the definitions of the new commands %
%   as promotor, copromotor, etc              %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\subtitle#1{\gdef\@subtitle{#1}}
\def\promotorA[#1]#2{\gdef\@promotorAtype{#1}\gdef\@promotorAname{#2}}
\def\promotorB[#1]#2{\gdef\@promotorBtype{#1}\gdef\@promotorBname{#2}}
\def\promotorC[#1]#2{\gdef\@promotorCtype{#1}\gdef\@promotorCname{#2}}
\def\opleiding#1{\gdef\@opleiding{#1}}
\def\afdeling#1{\gdef\@afdeling{#1}}
\def\academicyear#1{\gdef\@academicyear{#1}}
\def\forename#1{\gdef\@forename{#1}}
\def\surname#1{\gdef\@surname{#1}}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   Secondly we declare and fill in the newly created variables %
% Sometimes we use standard definitions as is the case for      %
%   the titles.                         %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\@title{Titel Masterproef}
\def\@subtitle{Ondertitel (factultatief)}
\def\@forename{Voornaam}
\def\@surname{Achternaam}
\def\@opleiding{naam van de opleiding}
\def\@afdeling{afstudeerrichting}
\def\@promotorAname{} 
\def\@promotorBname{}
\def\@promotorCname{}
\def\@promotorAtype{} 
\def\@promotorBtype{}
\def\@promotorCtype{}
\def\@academicyear{}

% We also define some new if-structures to check whether you
% want to add a specific page in your thesis\bfseries\sffamily\rightmark
\newif\iflistoffigurespage
\newif\iflistoftablespage
\newif\iflistofsymbolspage
\newif\ifacknowledgementspage
\newif\ifabstractpage

\listoffigurespagefalse
\listoftablespagefalse

\listofsymbolspagefalse
\def\listofsymbols#1{\gdef\@listofsymbolsfile{\input{#1}}}

\acknowledgementspagefalse
\def\acknowledgements#1{\gdef\@acknowledgementsfile{\input{#1}}}

\abstractpagefalse
\def\abstracts#1{\gdef\@abstractfile{\input{#1}}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%   This function formats the titlepage using the   %
%   variables set before.                       %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Define the color of the title
\definecolor{titlegreen}{RGB}{39,142,116}
\def\titlep{%
    \thispagestyle{empty}
    \setlength{\unitlength}{1cm}
    \begin{picture}(0,0)(0,26)
    \hspace{-10em}\includegraphics[width=\paperwidth]{cover_fiiw_gent.pdf}
    \end{picture}
    \vskip1in
    \vfill
    \begingroup
      \fontsize{40pt}{12pt}\selectfont
        \textcolor{titlegreen}{{\textsf{\@title}}} \\\\
    \endgroup
    {\LARGE\textsf{\@subtitle}}
    \vfill
    \begin{flushright}
        \textsf{\LARGE\textbf{\@forename~\MakeUppercase{\@surname}}}
    \end{flushright}
    \vspace{10em}
    \begin{Parallel}{0.48\textwidth}{0.48\textwidth}
        \ParallelLText{\noindent
            \begin{list}{label}{\setlength{\leftmargin}{10em}\setlength{\labelsep}{0.5em}\setlength{\labelwidth}{9.5em}\setlength{\itemsep}{-.5ex}}
                \ifx \@promotorAname \@empty
                \else
                    \item[\@promotorAtype:\hfill] \@promotorAname
                \fi
                \ifx \@promotorBname \@empty
                \else
                    \item[\@promotorBtype:\hfill] \@promotorBname
                \fi
                \ifx \@promotorCname \@empty
                \else 
                    \item[\@promotorCtype:\hfill] \@promotorCname
                \fi
            \end{list}
        }
        \ParallelRText{\noindent \vspace{1em}
            \begin{flushright}
                Masterproef ingediend tot het behalen van \\
                de graad van master in de industri\"ele \\
                wetenschappen: \@opleiding \\
                \@afdeling
            \end{flushright}
        }
    \end{Parallel}
%   \vspace{3em}
    \setlength{\TPHorizModule}{1cm}
    \setlength{\TPVertModule}{1cm}
    \begin{textblock}{5}(5.5,1.5)
            Academiejaar \@academicyear
    \end{textblock}
    \cleardoublepage
    \thispagestyle{empty}
    \null
    \vfill
    %{\LARGE{Opgelet! Het copyright moet nog aangepast worden!}}\\\\
    \copyright Copyright KU Leuven \\\\
    Zonder voorafgaande schriftelijke toestemming van zowel de promotor(en) als de auteur(s) is overnemen, kopi\"eren, gebruiken of realiseren van deze uitgave of gedeelten ervan verboden. Voor aanvragen tot of informatie i.v.m.~het overnemen en/of gebruik en/of realisatie van gedeelten uit deze publicatie, wend u tot KU Leuven campus Gent, Gebroeders De Smetstraat 1, B-9000 Gent, +32-9-2658610 of via e-mail iiw.kaho.gent@kuleuven.be. \\\\
    Voorafgaande schriftelijke toestemming van de promotor(en) is eveneens vereist voor het aanwenden van de in deze masterproef beschreven (originele) methoden, producten, schakelingen en programma's voor industrieel of commercieel nut en voor de inzending van deze publicatie ter deelname aan wetenschappelijke prijzen of wedstrijden.
    \cleardoublepage
}

% Indentation
\setlength{\parindent}{0pt}
\setlength{\parskip}{1ex plus 0.5ex minus 0.25ex}
\setlength{\abovedisplayskip}{12pt plus 3pt}
\setlength{\belowdisplayskip}{12pt plus 3pt}
\setlength{\abovedisplayshortskip}{12pt plus 3pt}
\setlength{\belowdisplayshortskip}{12pt plus 3pt}

\parskip 1mm

%%%%%%%%%%%%%%%%%%%%%%%%&&&&&&&&&&&%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% BeforePreface adds the titlepage and when you                  %
% turned on the acknowledgements page, it will be generated too  %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\preface{
    \pagenumbering{roman}
    \titlep        

    \ifacknowledgementspage 
        \chapter*{Dankwoord} \@acknowledgementsfile
    \fi

    \ifabstractpage 
        \chapter*{Abstract} \@abstractfile
    \fi

    \tableofcontents

    \iflistoffigurespage
        \listoffigures
    \fi

    \iflistoftablespage
        \listoftables
    \fi

    \iflistofsymbolspage
        %\chapter*{Lijst van symbolen}
        \@listofsymbolsfile
    \fi

    \cleardoublepage
    \pagenumbering{arabic}
}

% Start with pagestyle{headings} in case front matter isn't processed
\pagenumbering{arabic}
\makeatother

%%%%%%% doc itself

\documentclass[11pt,a4paper]{report}
% Indien je je thesis recto-verso wil afdrukken gebruik je onderstaande opties i.p.v. bovenstaande
%\documentclass[11pt,a4paper,twoside,openright]{report}

\usepackage[a4paper,left=3.5cm, right=2.5cm, top=3.5cm, bottom=3.5cm]{geometry}
\usepackage[dutch]{babel}
\usepackage{graphicx}
\usepackage[margins]{trackchanges}
\addeditor{Eline}
%\usepackage[latin1]{inputenc} 
% om niet ascii karakters rechtstreeks te kunnen inputten
\usepackage[utf8]{inputenc}            % commentarieer deze regel uit als je utf8 encoded files gebruikt in plaats van latin1
\usepackage{listings}
\usepackage{verbatim}
\usepackage{hyperref}
\usepackage{url}                        % URL's invoegen in tekst met behulp van \url{http://}
\usepackage[small,bf,hang]{caption}
\usepackage[final]{pdfpages}
\usepackage{pslatex}
\usepackage{sectsty}
\allsectionsfont{\sffamily}
\chapterfont{\raggedleft\sffamily}

\usepackage{float}                      % De optie H voor de plaatsing van figuren op de plaats waar je ze invoegt. bvb. \begin{figure}[H]
%\usepackage{longtable}                 % tabellen die over meerdere pagina's gespreid worden
%\usepackage[times]{quotchap}           % indien je fancy hoofdstuktitels wil
%\usepackage[none]{hyphenat}
%\usepackage{latexsym}
%\usepackage{amsmath}
%\usepackage{amssymb}

\usepackage{fiiw_gent}
\usepackage{rotating}

%door onderstaande regels in commentaar te zetten, of op false, kan je pagina's weglaten
%bijvoorbeeld het weglaten van een voorwoord, lijst met symbolen, ...
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%voorwoord toevoegen?
\acknowledgementspagetrue
\acknowledgements{voorwoord}            %.tex file met daarin het voorwoord
%abstract toevoegen?
\abstractpagetrue
\abstracts{abstract}                    %.tex file met daarin het abstract
%lijst van figuren toevoegen?
\listoffigurespagetrue
%lijst van tabellen toevoegen?
%\listoftablespagetrue
%lijst van symbolen toevoegen?
%\listofsymbolspagetrue
%\listofsymbols{symbolen}               %.tex file met daarin de lijst van symbolen



\begin{document}

\lstinputlisting[language=XML, breaklines=true, breakindent=0pt, breakautoindent=true, linewidth=\textwidth, breakatwhitespace=false,  caption=Respons van het gevonden kalender item.]{outlook/Vinden_kalender_item_antwoord.xml}

\end{document}


%%%%%%% Vinden_kalender_item_antwoord.xml
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Header>
      <h:ServerVersionInfo MajorVersion="14" MinorVersion="2" MajorBuildNumber="387" MinorBuildNumber="0" Version="Exchange2010_SP2" xmlns:h="http://schemas.microsoft.com/exchange/services/2006/types" xmlns="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"/>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <m:FindItemResponse xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
         <m:ResponseMessages>
            <m:FindItemResponseMessage ResponseClass="Success">
               <m:ResponseCode>NoError</m:ResponseCode>
               <m:RootFolder TotalItemsInView="1" IncludesLastItemInRange="true">
                  <t:Items>
                     <t:CalendarItem>
                        <t:ItemId Id="AAMkAGQ4ZWQ5ZDAyLTMzNmMtNGEwZC1iZWQ4LTEyMzVkNDhhOTgzMwBGAAAAAAClRU98ditGSbuQMxW+bNQEBwD3K7SN9dTDQr6wC4Bve/iXAAAAj+XHAAD3K7SN9dTDQr6wC4Bve/iXAAAAkoSvAAA=" ChangeKey="DwAAABYAAAD3K7SN9dTDQr6wC4Bve/iXAAAAkqS3"/>
                     </t:CalendarItem>
                  </t:Items>
               </m:RootFolder>
            </m:FindItemResponseMessage>
         </m:ResponseMessages>
      </m:FindItemResponse>
   </s:Body>
</s:Envelope>
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – jub0bs Aug 10 '14 at 12:46
  • We don't know what's in outlook/Vinden_kalender_item_antwoord.xml so there is little we can do. – jub0bs Aug 10 '14 at 12:56
  • Does that mather? – ContradictionOfPro Aug 10 '14 at 13:00
  • 1
    @ContradictionOfPro --- No, it isn't anyone's job to create answers. Users of this site provide help voluntarily. Your problems are most likely to be solved if you help the community to help you, by providing a MWE. – Ian Thompson Aug 10 '14 at 21:15
  • 1
    Then you read the explanation in the link provided by @Jubobs. A MWE contains enough code to allow others to reproduce the problem and nothing more. It's really quite straightforward. – Ian Thompson Aug 11 '14 at 10:40
0

There is a solution which works with the example files you provided at https://tex.stackexchange.com/a/65839/60451

The code

\makeatletter
\def\lst@lettertrue{\let\lst@ifletter\iffalse}
\makeatother

will make listings break lines at letter characters.

  • Thanks, but where do I have to set this? – ContradictionOfPro Aug 10 '14 at 16:11
  • Just somewhere; problem now is that my other lines (who were previously breaked nicely), now got broken somewhere . Example: <tag>a</tag> got <tag>a</ ENTER tag> now are <tag>a</ta ENTER g> – ContradictionOfPro Aug 10 '14 at 16:15
  • Ok. As a quick fix you could declare only "h" as other (breaking) character \lstinputlisting[... alsoother={h}]{outlook/Vinden_kalender_item_antwoord.xml}. This will affect other lines, though. – cmz Aug 10 '14 at 17:21
  • with only `alsoother={h}', the lines are broken down, but they are ugly as hell, but whatever, it worked TY :D – ContradictionOfPro Aug 11 '14 at 7:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.