The problem when I export the document to PDF there is some text at the end of the lines does not appear to the print page. How can I fix this?

//Add staff.php
<link href="../style.css" media="screen" rel="stylesheet" type="text/css" />
<form action="savestaff.php" method="post">
<center><h4><i class="icon-plus-sign icon-large"></i> Register Staffs</h4></center>
<div id="ac">
<span>Staff Id : </span><input type="text" style="width:265px; height:30px;" 
placeholder="Staff Id" 
<span>First Name : </span><input type="text" style="width:265px; height:30px;" name="Fname" placeholder="Fname" Required/><br>
<span>Last Name : </span><input type="text" style="width:265px; height:30px;" name="Lname" placeholder="Lname" Required/><br>
<span>Gender : </span><input type="text" style="width:265px; height:60px;" name="Gender" placeholder="Gender" Required/><br>
<span>Date of birth : </span><input type="text" style="width:265px; height:30px;" name="DateOfBirth" placeholder="DateOfBirth" Required/><br>
<span>Phone Number : </span><input type="text" style="height:60px; width:265px;" name="PhNo" placeholder="PhNo" Required/><br>
<span>Email: </span><input type="date" style="width:265px; height:30px;" name="Email" placeholder="Email" Required/><br>
<span>Home Address : </span><input type="date" style="width:265px; height:30px;" name="HomeAddress" placeholder="HomeAddress" Required/><br>
<span>Staff Position : </span><input type="date" style="width:265px; height:30px;" name="position" placeholder="position" Required/><br>
<span>Staff Password : </span><input type="date" style="width:265px; height:30px;" name="password" placeholder="password" Required/><br>
<div style="float:right; margin-right:10px;">
<button class="btn btn-success btn-block btn-large" style="width:267px;"><i class="icon icon-save icon-large"></i> Save</button>
  • Welcome to the site. The verbatim macro takes its line-feed from the input text, not the document margin (that is why it is verbatim). You could break up the long lines manually, or you could shrink the size of the verbatim listing easily enough. There may be some other similar environments (listings comes to mind) that may be able to automate the newline. Nov 10, 2015 at 1:29

1 Answer 1


I'd recommend using the listings package for this; it's considerably more flexible. For example, you can specify \lstset{breaklines=true} in the preamble to prevent lines from overrunning the margins.

Here's a basic way to do it.

    % specifies that lines shouldn't overrun the margin
    % specified that, if possible, lines should be broken at whitespace
//Add staff.php
<link href="../style.css" media="screen" rel="stylesheet" type="text/css" />
<form action="savestaff.php" method="post">

... rest of HTML snippet ... 


Here's what it will look like.

enter image description here

You can also make listings syntax-highlight this code for you, which might be useful. For example, suppose we change the preamble to this:

\documentclass[preview, margin=3cm]{standalone}

Then, you get colored ouput: enter image description here

There's lots more to explore; I found Wikibooks' article on listings to be a good introductory guide.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.