Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #LyX 1.6.7 created this file. For more info see http://www.lyx.org/
- \lyxformat 345
- \begin_document
- \begin_header
- \textclass scrbook
- \begin_preamble
- \usepackage{algorithm}
- \usepackage{booktabs}
- \usepackage{caption}
- \usepackage{float}
- \usepackage{graphicx}
- \usepackage[T1]{fontenc}
- \usepackage[automark,nouppercase]{scrpage2}
- \usepackage[dvipsnames,svgnames,x11names,table]{xcolor}
- \usepackage{tikz}
- \usetikzlibrary{backgrounds,shadows,shapes,snakes}
- \usepackage{pst-grad}
- \usepackage{hyperref}
- \definecolor{sourcecolour}{HTML}{A6BFF2}
- % Use a hyphen for captions, and make links give a bit of space.
- \DeclareCaptionFormat{algorithm}{\vspace{-1ex}\colorbox[HTML]{A6BFF2}{%
- \parbox[c][1.75em][c]{\textwidth}{\hspace{0.25em}#1#2#3}}}
- \captionsetup{hypcapspace=0.5\baselineskip}
- \captionsetup{labelfont=bf,labelsep=endash}
- \captionsetup[ruled]{labelfont=bf,labelsep=endash}
- \captionsetup[algorithm]{format=algorithm}
- % Change algorithm to "Listing".
- \floatname{algorithm}{Listing}
- \newcommand{\algorithmname}{Listing}
- % Remove extra whitespace so that colour fills the table header.
- \renewcommand{\toprule}{\specialrule{\heavyrulewidth}{\abovetopsep}{0pt}}
- \renewcommand{\midrule}{\specialrule{\lightrulewidth}{0pt}{\belowrulesep}}
- \renewcommand{\bottomrule}{\specialrule{\lightrulewidth}{0pt}{\belowrulesep}}
- % Allow figures to be placed near the top of the page.
- \renewcommand{\topfraction}{0.85}
- \renewcommand{\textfraction}{0.1}
- \renewcommand{\floatpagefraction}{0.75}
- % Determine if the image is too wide for the page.
- \makeatletter
- \def\ScaleIfNeeded{%
- \ifdim\Gin@nat@width>\linewidth
- \linewidth
- \else
- \Gin@nat@width
- \fi
- }
- \makeatother
- % Resize figures that are too wide for the page.
- \let\oldincludegraphics\includegraphics
- \renewcommand\includegraphics[2][]{%
- \graphicsformat{%
- \oldincludegraphics[width=\ScaleIfNeeded]{#2}%
- }%
- }
- % Centre graphics within non-Algorithm floats.
- \let\graphicsformat\centering
- % Change the background colour of algorithm boxes.
- \let\oldalgorithm\algorithm
- \let\endoldalgorithm\endalgorithm
- \renewenvironment{algorithm}[1][htbp]{
- \let\graphicsformat\justifiedandcolored
- \oldalgorithm[#1]
- }%
- {\endoldalgorithm}
- % Change the background colour of the algorithm floats.
- \def\justifiedandcolored#1{%
- \setlength\fboxrule{0pt}%
- \setlength\fboxsep{0pt}%
- \kern-1.45pt
- \tikz[background rectangle/.style={%
- top color=sourcecolour!60,bottom color=white},
- tight background,
- show background rectangle]
- \node [inner sep=0pt] (0,0) {#1};%
- \par
- \kern-1.5pt
- }
- % Allow plenty of room at the bottom (this will prevent large vertical
- % gaps between enumerated items and bulleted lists).
- \raggedbottom
- % Required by LyX...
- \makeatletter
- \end_preamble
- \options twoside,pointlessnumbers,obeyspaces,plainpages=false,pdfpagelabels
- \use_default_options false
- \language english
- \inputencoding utf8
- \font_roman lmodern
- \font_sans helvet
- \font_typewriter courier
- \font_default_family default
- \font_sc false
- \font_osf false
- \font_sf_scale 100
- \font_tt_scale 100
- \graphics default
- \float_placement H
- \paperfontsize default
- \spacing single
- \use_hyperref true
- \pdf_bookmarks true
- \pdf_bookmarksnumbered false
- \pdf_bookmarksopen false
- \pdf_bookmarksopenlevel 1
- \pdf_breaklinks false
- \pdf_pdfborder false
- \pdf_colorlinks false
- \pdf_backref false
- \pdf_pdfusetitle true
- \papersize letterpaper
- \use_geometry false
- \use_amsmath 2
- \use_esint 1
- \cite_engine basic
- \use_bibtopic false
- \paperorientation portrait
- \secnumdepth 3
- \tocdepth 3
- \paragraph_separation indent
- \defskip medskip
- \quotes_language english
- \papercolumns 1
- \papersides 1
- \paperpagestyle default
- \bullet 0 5 11 -1
- \bullet 1 5 24 -1
- \bullet 2 0 0 -1
- \tracking_changes false
- \output_changes false
- \author ""
- \author ""
- \end_header
- \begin_body
- \begin_layout Chapter
- Chapter
- \end_layout
- \begin_layout Standard
- \begin_inset Float algorithm
- wide false
- sideways false
- status collapsed
- \begin_layout Plain Layout
- \begin_inset Graphics
- filename source/sql/query-formatted.pgsql.png
- display false
- \end_inset
- \end_layout
- \begin_layout Plain Layout
- \begin_inset Caption
- \begin_layout Plain Layout
- \begin_inset CommandInset label
- LatexCommand label
- name "alg:Query-with-Formatting"
- \end_inset
- Query with Formatting (Bad)
- \end_layout
- \end_inset
- \end_layout
- \end_inset
- \end_layout
- \end_body
- \end_document
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement