列表换行不起作用

列表换行不起作用

得到一个列表,其中的代码包含一个非常长的字符序列(字母、数字和其他)。使用linebreak=true,序列在非字母字符处被打断。但是我仍然得到了一个非常长的字母序列,这并没有被打断。使用所有其他选项,查看代码,结果仍然相同。

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

在 writelatex.com 工作。

vinden_kal ...,问题在于 t:ItemId 标签在 + 和 / 处,行被打破了。

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%       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 [email protected]. \\\\
    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>

答案1

有一个解决方案可以与您提供的示例文件一起使用https://tex.stackexchange.com/a/65839/60451

代码

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

将使列表在字母字符处断行。

相关内容