Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am using mdframed as footer and want page number as footer but in mdframed. If i use mdframed it overwrites on page number. How can i write page number in footer within mdframed?

enter image description here

EDIT: Code of the comment

\pagestyle{fancy} 
\fancyhf{} % sets both header and footer to nothing \renewcommand{\headrulewidth}{0pt} 
\fancyfoot{} 
\fancyfoot[C]{\begin{mdframed}[roundcorner=4pt,leftmargin=1, rightmargin=1, linecolor=blue,outerlinewidth=.5, innerleftmargin=5,innertopmargin=5,innerbottommargin=5,everyline = true, splittopskip=.6cm, splitbottomskip=.3cm] 
\parbox[t]{0.333\textwidth}{\raggedright{ID} \parbox[t]{0.333\textwidth}{\centering{footertext} \parbox[t]{0.333\textwidth}{\raggedleft{Date} \end{mdframed}} 

\documentclass{article} 

\usepackage[framemethod=tikz]{mdframed} 
\usepackage{fancyhdr} \usepackage{lipsum} 
\pagestyle{fancy} 
\fancyhead{} 
\fancyfoot{} 
\fancyfoot[C]{% 
\begin{mdframed}[linecolor=blue!60,roundcorner=3pt] 
\parbox[t]{0.333\textwidth}{\raggedright XXXXXXXX}% 
\parbox[t]{0.333\textwidth}{\centering Page}% 
\parbox[t]{0.333\textwidth}{\raggedleft 31 July 2012} 
\end{mdframed}% 
} 
\begin{document} 
\lipsum[1-2] 
\end{document} 
share|improve this question
    
Please always provide a complete working document in your question, for example the one that generated that image, so people answering know what to start from. –  David Carlisle Aug 2 '12 at 9:32
    
I m using code below. \pagestyle{fancy} \fancyhf{} % sets both header and footer to nothing \renewcommand{\headrulewidth}{0pt} \fancyfoot{} \fancyfoot[C]{\begin{mdframed}[roundcorner=4pt,leftmargin=1, rightmargin=1, linecolor=blue,outerlinewidth=.5, innerleftmargin=5,innertopmargin=5,innerbottommargin=5,everyline = true, splittopskip=.6cm, splitbottomskip=.3cm] \parbox[t]{0.333\textwidth}{\raggedright{ID} \parbox[t]{0.333\textwidth}{\centering{footertext} \parbox[t]{0.333\textwidth}{\raggedleft{Date} \end{mdframed}} –  manish Aug 3 '12 at 1:31
    
I get unrelated tex errors trying to do anything with that fragment. Please edit the question to have a complete example starting with \documentclass and ending \end{document} –  David Carlisle Aug 3 '12 at 13:20
    
\documentclass{article} \usepackage[framemethod=tikz]{mdframed} \usepackage{fancyhdr} \usepackage{lipsum} \pagestyle{fancy} \fancyhead{} \fancyfoot{} \fancyfoot[C]{% \begin{mdframed}[linecolor=blue!60,roundcorner=3pt] \parbox[t]{0.333\textwidth}{\raggedright XXXXXXXX}% \parbox[t]{0.333\textwidth}{\centering Page}% \parbox[t]{0.333\textwidth}{\raggedleft 31 July 2012} \end{mdframed}% } \begin{document} \lipsum[1-2] \end{document} Above code is for generating footer text but i need page number. How can i implement it? –  manish Aug 6 '12 at 3:10
    
Use the more exact \dimexpr\textwidth/3\relax instead of 0.333\textwidth. –  stalking is prohibited Aug 6 '12 at 8:45

1 Answer 1

up vote 1 down vote accepted

You just need to add \thepage

\parbox[t]{0.333\textwidth}{\centering Page \thepage}% 

Please in future always put complete documents in the question (as I edited your question this time) it makes answering the question so much easier.

share|improve this answer
    
My first page is title page so i don't need numbering on first page. For that i am using \thispagestyle{empty}. But I need counter should start from next page which means nextpage will be having page 1 and so on. How can i implement it? –  manish Aug 8 '12 at 1:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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