Text FormattingWrong wrap URL in bibitem - LATEX

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
basfot
Posts: 8
Joined: Tue Dec 02, 2014 7:53 pm

Wrong wrap URL in bibitem - LATEX

Post by basfot »

I need fix wrong wrapped url. I tried a lot of examples but not helped me. Thanks.

Image

I have this code and template:

Code: Select all

\documentclass [ing,male,java,dept460]{diploma}
\usepackage [czech]{babel}

\begin{document}

\begin{thebibliography}{99}

\bibitem{radius}
 s Odmítl prodat Googlu svůj nápad za tři čtvrtě miliardy. Teď na něm sám vydělává. \textit {First Class: Svět a myšlení úspěšných} [online]. 20.3.2014 [cit. 2015-01-12]. Dostupné z:  \url {http://www.firstclass.cz/2014/03/odmitl-prodat-googlu-svuj-napad-za-tri-ctvrte-miliardy-ted-na-nem-sam-vydelava/#sthash.JkwV1KGY.nzfkNxcQ.dpbs}

\end{thebibliography}

\end{document}

Code: Select all

\def\fileversion{3.1}
\def\filedate{2013/04/26}
\def\docdate{26. dubna 2013}

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{diploma}[\filedate\space v\fileversion\space diploma LaTeX document class]
\RequirePackage[utf8]{inputenc}
\RequirePackage[IL2]{fontenc}
\RequirePackage{ifthen}
\newtoks\Dipl@DiplomaTypeName
\Dipl@DiplomaTypeName={Chybí textová reprezentace typu práce}
\newtoks\Dipl@Department
\Dipl@Department={Katedra informatiky}
\newtoks\Dipl@Author
\Dipl@Author={Chybí autor}
\newtoks\Dipl@Title
\Dipl@Title={Chybí název práce}
\newtoks\Dipl@EnglishTitle
\Dipl@EnglishTitle={Chybí anglický název práce}
\newtoks\Dipl@SubmissionDate
\Dipl@SubmissionDate={Chybí datum odevzdání práce}
\newtoks\Dipl@AccessRestriction
\Dipl@AccessRestriction={}
\newtoks\Dipl@ThesisAssignmentImagePath
\Dipl@ThesisAssignmentImagePath={}
\newtoks\Dipl@DeclarationImageFile
\Dipl@DeclarationImageFile={}
\newtoks\Dipl@Thanks
\Dipl@Thanks={}
\newtoks\Dipl@CzechAbstract
\Dipl@CzechAbstract={Chybí český abstrakt}
\newtoks\Dipl@CzechKeywords
\Dipl@CzechKeywords={Chybí česká klíčová slova}
\newtoks\Dipl@EnglishAbstract
\Dipl@EnglishAbstract={Chybí anglický abstrakt}
\newtoks\Dipl@EnglishKeywords
\Dipl@EnglishKeywords={Chybí anglická klíčová slova}
\newtoks\Dipl@Acronyms
\Dipl@Acronyms={}
\newtoks\Dipl@DefaultLanguage
\Dipl@DefaultLanguage={java}
\newboolean{Dipl@AuthorIsMale}
\setboolean{Dipl@AuthorIsMale}{true}
\newboolean{Dipl@IsMasterThesis}
\setboolean{Dipl@IsMasterThesis}{true}
\newboolean{Dipl@IsBachelorPractice}
\setboolean{Dipl@IsBachelorPractice}{false}
\newboolean{Dipl@PrintPublAgreement}
\setboolean{Dipl@PrintPublAgreement}{false}
\newcounter{Dipl@ThesisAssignmentImageCounter}
\DeclareOption{bc}{\Dipl@DiplomaTypeName={Bakalářská práce}\setboolean{Dipl@IsMasterThesis}{false}\setboolean{Dipl@IsBachelorPractice}{false}}
\DeclareOption{bcpraxe}{\Dipl@DiplomaTypeName={Bakalářská práce}\setboolean{Dipl@IsMasterThesis}{false}\setboolean{Dipl@IsBachelorPractice}{true}}
\DeclareOption{ing}{\Dipl@DiplomaTypeName={Diplomová práce}\setboolean{Dipl@IsMasterThesis}{true}\setboolean{Dipl@IsBachelorPractice}{false}}
\DeclareOption{dept410}{\Dipl@Department={Katedra elektroenergetiky}}
\DeclareOption{dept420}{\Dipl@Department={Katedra elektrotechniky}}
\DeclareOption{dept430}{\Dipl@Department={Katedra elektroniky}}
\DeclareOption{dept440}{\Dipl@Department={Katedra telekomunikační techniky}}
\DeclareOption{dept450}{\Dipl@Department={Katedra kybernetiky a biomedicínského inženýrství}}
\DeclareOption{dept460}{\Dipl@Department={Katedra informatiky}}
\DeclareOption{dept470}{\Dipl@Department={Katedra aplikované matematiky}}
\DeclareOption{male}{\setboolean{Dipl@AuthorIsMale}{true}}
\DeclareOption{female}{\setboolean{Dipl@AuthorIsMale}{false}}
\DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}}
\ProcessOptions
\LoadClass[11pt]{article}
\RequirePackage{fancyhdr}
\RequirePackage{geometry}
\RequirePackage{graphicx}
\RequirePackage{palatino}
\RequirePackage[final]{listings}
\RequirePackage{rotating}
\RequirePackage{supertabular}
\RequirePackage{theorem}
%\RequirePackage{hyperref}
\RequirePackage[notindex,nottoc,notlot,notlof,section,numbib]{tocbibind}
\RequirePackage[a-1b]{pdfx}
\geometry{a4paper,includeheadfoot,marginparwidth=0mm,marginparsep=0mm,left=28mm,right=32mm,top=25mm,bottom=38mm,headheight=16pt}
\fancyhf{}
\fancyhead[RO,LE]{\sffamily\bfseries\thepage}
\newcommand{\ThesisAuthor}[1]{\Dipl@Author={#1}}
\newcommand{\ThesisTitle}[1]{\ifthenelse{\boolean{Dipl@IsBachelorPractice}}{\relax}{\Dipl@Title={#1}}}
\newcommand{\EnglishThesisTitle}[1]{\ifthenelse{\boolean{Dipl@IsBachelorPractice}}{\relax}{\Dipl@EnglishTitle={#1}}}
\newcommand{\SubmissionDate}[1]{\Dipl@SubmissionDate={#1}}
\newcommand{\PrintPublicationAgreement}[1]{\setboolean{Dipl@PrintPublAgreement}{#1}}
\newcommand{\AccessRestriction}[1]{\Dipl@AccessRestriction={#1}}
\newcommand{\ThesisAssignmentImagePath}[1]{\Dipl@ThesisAssignmentImagePath={#1}}
\newcommand{\DeclarationImageFile}[1]{\Dipl@DeclarationImageFile={#1}}
\newcommand{\Thanks}[1]{\Dipl@Thanks={#1}}
\newcommand{\CzechAbstract}[1]{\Dipl@CzechAbstract={#1}}
\newcommand{\CzechKeywords}[1]{\Dipl@CzechKeywords={#1}}
\newcommand{\EnglishAbstract}[1]{\Dipl@EnglishAbstract={#1}}
\newcommand{\EnglishKeywords}[1]{\Dipl@EnglishKeywords={#1}}
\newcommand{\MakeTitlePages}%
{%
  \pagestyle{empty}
  \Dipl@WriteAcronyms
  \setcounter{page}{1}
  \pagestyle{fancy}
}

\newcommand{\Dipl@AddTokens}[2]{\expandafter \global#1\expandafter{\the#1#2}}
\newcommand{\AddAcronym}[2]{\Dipl@AddTokens{\Dipl@Acronyms}{#1&--&#2\\}}

\endinput

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Wrong wrap URL in bibitem - LATEX

Post by Johannes_B »

This question has also been asked on TeX.stackexchange where it already got an answer.

Urls can be broken at hyphens by passing the option hyphens to package url.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10335
Joined: Mon Mar 10, 2008 9:44 pm

Wrong wrap URL in bibitem - LATEX

Post by Stefan Kottwitz »

Great to see that it's solved. Thanks Johannes for the link and the answer.

Another approach is explicitly allowing at hyphens:

Code: Select all

\makeatletter
\g@addto@macro{\UrlBreaks}{\do\-}
\makeatother
This can be extended to other characters.

Stefan
LaTeX.org admin
basfot
Posts: 8
Joined: Tue Dec 02, 2014 7:53 pm

Re: Wrong wrap URL in bibitem - LATEX

Post by basfot »

Yes, I found solution and Stefan solution also works. Thanks a lot boys.
Post Reply