# Package changes horizontal pipe to horizontal for chapter formatting

I need to change the style of my chapters to a different one. I found a package which would do that, and it works nicely.

However, my code before the edit was like this:

\usepackage[latin2]{inputenc}
\usepackage[T1, IL2]{fontenc}
\usepackage{url}
\DeclareUrlCommand\url{\def\UrlLeft{<}\def\UrlRight{>} \urlstyle{tt}}


After the edit, I made it into this:

\usepackage[latin2]{inputenc}
\usepackage[T1, IL2]{fontenc}
\usepackage{url}
\DeclareUrlCommand\url{\def\UrlLeft{<}\def\UrlRight{>} \urlstyle{tt}}
\usepackage[T1]{fontenc}
\usepackage{titlesec, blindtext, color}
\definecolor{gray75}{gray}{0.75}
\newcommand{\hsp}{\hspace{20pt}}
\titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter\hsp\textcolor{gray75}{|}\hsp}{0pt}{\Huge\bfseries}


Thank worked nicely, however the text wasn't in the straight lines, looks like on the picture below.

However, I am aware of double fontenc package, so I removed that one, code looking like this:

\usepackage[latin2]{inputenc}
\usepackage[T1, IL2]{fontenc}
\usepackage{url}
\DeclareUrlCommand\url{\def\UrlLeft{<}\def\UrlRight{>} \urlstyle{tt}}
\usepackage{titlesec, blindtext, color}
\definecolor{gray75}{gray}{0.75}
\newcommand{\hsp}{\hspace{20pt}}
\titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter\hsp\textcolor{gray75}{|}\hsp}{0pt}{\Huge\bfseries}


Howver that make a strange thing. Although my text lines were straight, the pipe in the chapter name it made horizontal, looks like this:

Anyone would know how to solve this issue? Thank you

EDIT: Adding more of the code

\documentclass[cover]{fitthesis} % odevzdani do wisu
%      \documentclass[english]{fitthesis}

% zde zvolime kodovani, ve kterem je napsan text prace
% "latin2" pro iso8859-2 nebo "cp1250" pro windows-1250, "utf8" pro "utf-8"
%\usepackage{ucs}
\usepackage[latin2]{inputenc}
\usepackage[T1, IL2]{fontenc}
\usepackage{url}
\DeclareUrlCommand\url{\def\UrlLeft{<}\def\UrlRight{>} \urlstyle{tt}}
\usepackage{titlesec, blindtext, color}
\definecolor{gray75}{gray}{0.75}
\newcommand{\hsp}{\hspace{20pt}}
\titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter\hsp\textcolor{gray75}{|}\hsp}{0pt}{\Huge\bfseries}

\ifWis
\ifx\pdfoutput\undefined % nejedeme pod pdflatexem
\else
\usepackage{color}
\usepackage[all]{nowidow}
\definecolor{anchors}{rgb}{1,0,0}
\def\AnchorColor{anchors}
\def\pdfBorderAttrs{/Border [0 0 0] }  % bez okrajů kolem odkazů
\pdfcompresslevel=9
\fi
\fi

\clubpenalty = 10000
\widowpenalty = 10000
\displaywidowpenalty = 10000

\begin{document}
\maketitle
\tableofcontents

\listoffigures
% \listoftables
\input{obsah} % viz. obsah.tex

\ifczech
\bibliographystyle{czechiso}
\else
\bibliographystyle{plain}
%  \bibliographystyle{alpha}
\fi
\begin{flushleft}
\bibliography{literatura} % viz. literatura.bib
\end{flushleft}
\appendix

\input{prilohy} % viz. prilohy.tex
\end{document}

• can you add a complete minimale cod – touhami Apr 25 '15 at 8:06
• the option IL2 of fontenc is it necessary – touhami Apr 25 '15 at 8:11
• without IL2 option I get those not straight lines. And I'll add the code – Asheara Apr 25 '15 at 8:14
• you can repalce | in chapter style by \rule[-.2em]{1pt}{1em} and you can adjust it by changing 1em to .9em or .8em – touhami Apr 25 '15 at 8:20
• the option IL2 of fontenc will cause this every time you type | soo be careful, (you shoud find a solution) – touhami Apr 25 '15 at 8:26

The solution is to use \textbar for the “pipe” in text mode (| is good in math mode).

You seem to be using a very old template and I don't think you should be loading the IL2 package. The test \ifx\pdfoutput\undefined is a clear sign of this; note that on current TeX distributions (less than five year old or so), the test will always return false.

Here's a dirty workaround. Let me know if you run into trouble using this (I hope not).

\documentclass[cover]{fitthesis} % odevzdani do wisu
%      \documentclass[english]{fitthesis}

% zde zvolime kodovani, ve kterem je napsan text prace
% "latin2" pro iso8859-2 nebo "cp1250" pro windows-1250, "utf8" pro "utf-8"
%\usepackage{ucs}
\usepackage[latin2]{inputenc}

\usepackage{url}
\DeclareUrlCommand\url{\def\UrlLeft{<}\def\UrlRight{>} \urlstyle{tt}}
\usepackage{titlesec, blindtext, color}
\definecolor{gray75}{gray}{0.75}
\newcommand{\hsp}{\hspace{20pt}}
\usepackage[T1, IL2]{fontenc}

\titleformat{\chapter}[hang]{\Huge\bfseries}{\thechapter\hsp\textcolor{gray75}{$|$}\hsp}{0pt}{\Huge\bfseries}

\ifWis
\ifx\pdfoutput\undefined % nejedeme pod pdflatexem
\else
\usepackage{color}
\usepackage[all]{nowidow}
\definecolor{anchors}{rgb}{1,0,0}
\def\AnchorColor{anchors}
\def\pdfBorderAttrs{/Border [0 0 0] }  % bez okrajů kolem odkazů
\pdfcompresslevel=9
\fi
\fi

\clubpenalty = 10000
\widowpenalty = 10000
\displaywidowpenalty = 10000

\begin{document}

\chapter{\'Uvod}
\end{document}