2
\documentclass[12pt]{article}
\usepackage{verbatimbox,stackengine,xcolor,hyperref}
\usepackage[left=2cm,right=2cm]{geometry}

\begin{document}

\title{}
\author{}

\maketitle

\section{Overview}
There are two major file types you need to know about when writing tests in Robot Framework and they are the Resource file and the Test Suite. Each test suite can contain multiple test cases, which are comprised of individual test scripts. You must designate the resource file for each test suite, to do so you must define your \textit{\textbf{Resource}} in the \textit{Settings} section eg.\\[1\baselineskip]

\begin{verbbox}
*** Settings ***
Documentation     A resource file with reusable keywords and variables.

Library           Selenium2Library
Library           FakerLibrary    WITH NAME    faker
Library           DateTime    WITH NAME    DateTime
\end{verbbox}
{\centering\stackon[12pt]{\footnotesize\parbox{\textwidth}{ The \textit{Library} keyword tells Robot that it needs to make sure that this is installed and available to use, otherwise it will tell you that importing the library failed. Selenium is needed in \textbf{all} of our resource files.}}{\theverbbox}\\[1\baselineskip]

In the above example I have imported two optional libraries (faker and DateTime). faker creates random data that can be used to populate fields, DateTime allows me to get the current date among other helpful functions. I have also used the \textit{WITH NAME} argument, I have done so because it will make it more obvious to anyone new to Robot Framework tests which functions are being called from these libraries. I did \textbf{not} do this for Selenium because Selenium is the base of most Robot Framework functionality and would not serve to clarify the function of our tests.\\[1\baselineskip]

Example of library keywords:\\[1\baselineskip]

\begin{verbbox}
${DATE}=    | DateTime.Get Current Date | result_format=%Y-%m-%d
\end{verbbox}

{\centering\stackon[12pt]{\footnotesize\parbox{\textwidth}{ This variable uses the function \textit{Get Current Date} from the \textbf{DateTime} library, you can tell because it uses the prefix that I defined in my earlier example before calling the function.}}{\theverbbox}%
  \par}\bigskip

\bigskip

To define a variable you must first define the \textbf{\textit{Variables}} section of the resource file
\begin{verbatim}
*** Variables ***
${variable name}    variable definition
${variable name} | variable definition
\end{verbatim}

\end{document}

In my code above the centering of text has leaked through to everything after this, I thought I had closed the "centering" and it wouldn't affect anything outside of it's tags?

Why is the styling leaking through and how can I stop it?

Thanks in advance.

4
  • Please edit your example so that it contains a complete example code that reproduces the problem. Without this it may be difficult for anyone to help you. Jul 30, 2014 at 15:08
  • @IanThompson Edited
    – Stormie
    Jul 30, 2014 at 15:12
  • Do you know that inserting inter-paragraph spacing with \\[1\baselineskip] is wrong? In fact \` should *never* be necessary outside a tabular` (and other alignment environments)!
    – cgnieder
    Jul 30, 2014 at 16:42
  • You must get warnings from latex complaining about \\[1\baselineskip] never end a paragraph with \\ Jul 30, 2014 at 16:50

1 Answer 1

3

In your example, you start a group with a { immediately before \centering, but this group is never terminated with a }. Thus \centering stays in effect for the remainder of the document, and you get some complaints (but not errors) from TeX in the log:

(\end occurred inside a group at level 1)

### simple group (level 1) entered at line 60 ({)
### bottom level

This can be fixed by adding a closing brace at the point in your document where \centering should end.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .