Skip to main content
edited tags
Link
Phelype Oleinik
  • 72.6k
  • 20
  • 165
  • 241
Fixing a site bug of disappearing double backslashes: https://tex.meta.stackexchange.com/questions/7168/double-backslashes-disappear-from-code
Source Link
David Carlisle
  • 828.7k
  • 74
  • 1.7k
  • 2.6k
\documentclass[twocolumn]{article} \usepackage[hyphens]{url} \usepackage[letterpaper,margin=1in]{geometry} \begin{document} \urlstyle{same} \begin{thebibliography}{10} \let\oldurl\url \makeatletter \renewcommand*\url{% \begingroup \let\do\@makeother \dospecials \catcode`{1 \catcode`}2 \catcode`\ 10 \url@aux } \newcommand*\url@aux[1]{% \setbox0\hbox{\oldurl{#1}}% \ifdim\wd0>\linewidth \strut \ \\  \vbox{% \parindent=0pt \kern-\lineskip \raggedright \strut\oldurl{#1}% }% \else \hskip0pt plus\linewidth \penalty0 \box0 \fi \endgroup } \makeatother \bibitem{thinkermade08focus} ThinkerMade. (2008) {How to Tell if a User is Signed in to Facebook and Other Services}. Blog entry. \url{http://replay.waybackmachine.org/20081020072934/http://www.thinkermade.com/blog/2008/07/how-to-tell-if-a-user-is-signed-in-to-facebook-and-other-services/} \end{thebibliography} \end{document} 
\documentclass[twocolumn]{article} \usepackage[hyphens]{url} \usepackage[letterpaper,margin=1in]{geometry} \begin{document} \urlstyle{same} \begin{thebibliography}{10} \let\oldurl\url \makeatletter \renewcommand*\url{% \begingroup \let\do\@makeother \dospecials \catcode`{1 \catcode`}2 \catcode`\ 10 \url@aux } \newcommand*\url@aux[1]{% \setbox0\hbox{\oldurl{#1}}% \ifdim\wd0>\linewidth \strut \  \vbox{% \parindent=0pt \kern-\lineskip \raggedright \strut\oldurl{#1}% }% \else \hskip0pt plus\linewidth \penalty0 \box0 \fi \endgroup } \makeatother \bibitem{thinkermade08focus} ThinkerMade. (2008) {How to Tell if a User is Signed in to Facebook and Other Services}. Blog entry. \url{http://replay.waybackmachine.org/20081020072934/http://www.thinkermade.com/blog/2008/07/how-to-tell-if-a-user-is-signed-in-to-facebook-and-other-services/} \end{thebibliography} \end{document} 
\documentclass[twocolumn]{article} \usepackage[hyphens]{url} \usepackage[letterpaper,margin=1in]{geometry} \begin{document} \urlstyle{same} \begin{thebibliography}{10} \let\oldurl\url \makeatletter \renewcommand*\url{% \begingroup \let\do\@makeother \dospecials \catcode`{1 \catcode`}2 \catcode`\ 10 \url@aux } \newcommand*\url@aux[1]{% \setbox0\hbox{\oldurl{#1}}% \ifdim\wd0>\linewidth \strut \\  \vbox{% \parindent=0pt \kern-\lineskip \raggedright \strut\oldurl{#1}% }% \else \hskip0pt plus\linewidth \penalty0 \box0 \fi \endgroup } \makeatother \bibitem{thinkermade08focus} ThinkerMade. (2008) {How to Tell if a User is Signed in to Facebook and Other Services}. Blog entry. \url{http://replay.waybackmachine.org/20081020072934/http://www.thinkermade.com/blog/2008/07/how-to-tell-if-a-user-is-signed-in-to-facebook-and-other-services/} \end{thebibliography} \end{document} 
added 2359 characters in body
Source Link
zwol
  • 3k
  • 1
  • 25
  • 36

EDIT: Minimal-ish example of overfull hboxes with TH's currently suggested code:

\documentclass[twocolumn]{article} \usepackage[hyphens]{url} \usepackage[letterpaper,margin=1in]{geometry} \begin{document} \urlstyle{same} \begin{thebibliography}{10} \let\oldurl\url \makeatletter \renewcommand*\url{% \begingroup \let\do\@makeother \dospecials \catcode`{1 \catcode`}2 \catcode`\ 10 \url@aux } \newcommand*\url@aux[1]{% \setbox0\hbox{\oldurl{#1}}% \ifdim\wd0>\linewidth \strut \ \vbox{% \parindent=0pt \kern-\lineskip \raggedright \strut\oldurl{#1}% }% \else \hskip0pt plus\linewidth \penalty0 \box0 \fi \endgroup } \makeatother \bibitem{thinkermade08focus} ThinkerMade. (2008) {How to Tell if a User is Signed in to Facebook and Other Services}. Blog entry. \url{http://replay.waybackmachine.org/20081020072934/http://www.thinkermade.com/blog/2008/07/how-to-tell-if-a-user-is-signed-in-to-facebook-and-other-services/} \end{thebibliography} \end{document} 

Complaint:

(./argh.tex (/usr/share/texmf-texlive/tex/latex/base/article.cls Document Class: article 2007/10/19 v1.4h Standard LaTeX document class (/usr/share/texmf-texlive/tex/latex/base/size10.clo)) (/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty) (/usr/share/texmf-texlive/tex/latex/geometry/geometry.sty (/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty) (/usr/share/texmf-texlive/tex/generic/oberdiek/ifpdf.sty) (/usr/share/texmf-texlive/tex/generic/oberdiek/ifvtex.sty)) (./argh.aux) *geometry auto-detecting driver* *geometry detected driver: pdftex* Overfull \hbox (20.5556pt too wide) in paragraph at lines 40--43 [] [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./argh.aux) ) 

This is not just a cosmetic problem; the URL extends into the right margin.

EDIT: Minimal-ish example of overfull hboxes with TH's currently suggested code:

\documentclass[twocolumn]{article} \usepackage[hyphens]{url} \usepackage[letterpaper,margin=1in]{geometry} \begin{document} \urlstyle{same} \begin{thebibliography}{10} \let\oldurl\url \makeatletter \renewcommand*\url{% \begingroup \let\do\@makeother \dospecials \catcode`{1 \catcode`}2 \catcode`\ 10 \url@aux } \newcommand*\url@aux[1]{% \setbox0\hbox{\oldurl{#1}}% \ifdim\wd0>\linewidth \strut \ \vbox{% \parindent=0pt \kern-\lineskip \raggedright \strut\oldurl{#1}% }% \else \hskip0pt plus\linewidth \penalty0 \box0 \fi \endgroup } \makeatother \bibitem{thinkermade08focus} ThinkerMade. (2008) {How to Tell if a User is Signed in to Facebook and Other Services}. Blog entry. \url{http://replay.waybackmachine.org/20081020072934/http://www.thinkermade.com/blog/2008/07/how-to-tell-if-a-user-is-signed-in-to-facebook-and-other-services/} \end{thebibliography} \end{document} 

Complaint:

(./argh.tex (/usr/share/texmf-texlive/tex/latex/base/article.cls Document Class: article 2007/10/19 v1.4h Standard LaTeX document class (/usr/share/texmf-texlive/tex/latex/base/size10.clo)) (/usr/share/texmf-texlive/tex/latex/ltxmisc/url.sty) (/usr/share/texmf-texlive/tex/latex/geometry/geometry.sty (/usr/share/texmf-texlive/tex/latex/graphics/keyval.sty) (/usr/share/texmf-texlive/tex/generic/oberdiek/ifpdf.sty) (/usr/share/texmf-texlive/tex/generic/oberdiek/ifvtex.sty)) (./argh.aux) *geometry auto-detecting driver* *geometry detected driver: pdftex* Overfull \hbox (20.5556pt too wide) in paragraph at lines 40--43 [] [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./argh.aux) ) 

This is not just a cosmetic problem; the URL extends into the right margin.

Tweeted twitter.com/#!/StackTeX/status/42772026817118208
added 390 characters in body
Source Link
zwol
  • 3k
  • 1
  • 25
  • 36
Loading
Source Link
zwol
  • 3k
  • 1
  • 25
  • 36
Loading