General ⇒ Report Layout
Re: Report Layout
Thanks gmedina... It works well.
Solved this, I had two more questions (I hope not to be annoying):
1. How can I edit the apparence of floats (figures, table) to get something like the first image? I only want to customize, not create a new one.
2. If I want to create a cls file with this apparence, How can I put the preable in a modified version of report cls file?
Bests
Solved this, I had two more questions (I hope not to be annoying):
1. How can I edit the apparence of floats (figures, table) to get something like the first image? I only want to customize, not create a new one.
2. If I want to create a cls file with this apparence, How can I put the preable in a modified version of report cls file?
Bests
"Show me your .emacs and I'll tell you who you are." -- modified proverb
NEW: TikZ book now 40% off at Amazon.com for a short time.

Report Layout
Hi,
1- You can use some of the features provided by the float package to change the format of floats (please refer to the package documentation for further information). The following sample code can give you some ideas:
The idea was to redefine the \fs@ruled command (as defined in float.sty) to include the centered box with the colored box containing "GRÁFICO <number>", and erasing the midlle rule. The above code also redefines the \floatc@ruled that formats the caption for the new ruled floats.
2- I do not completely understand your question. Do you want to know how to create a class file?
1- You can use some of the features provided by the float package to change the format of floats (please refer to the package documentation for further information). The following sample code can give you some ideas:
Code: Select all
\documentclass{report}
\usepackage[svgnames]{xcolor}
\usepackage{float}
\makeatletter
\renewcommand\floatc@ruled[2]%
{\setbox\@tempboxa\hbox{#2}%
\ifdim\wd\@tempboxa>\hsize #2\par%
\else\hbox to\hsize{\hfil\box\@tempboxa\hfil}\fi}
\renewcommand\fs@ruled{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@ruled%
\def\@fs@pre{\vspace*{-20pt}\hrulefill\lower.8ex
\hbox{\colorbox{MidnightBlue}{%
\textcolor{white}{\scriptsize GR\'AFICO\ \thefigure}}}%
\hrulefill\vspace{10pt}}%
\def\@fs@post{\vspace{3pt}\kern2pt\hrule\relax}%
\def\@fs@mid{\addvspace{10pt}}
\let\@fs@iftopcapt\iftrue}
\makeatother
\floatstyle{ruled}
\restylefloat{figure}
\begin{document}
\begin{figure}[!ht]
\centering
\rule{4cm}{2cm}
\caption{A test figure}
\label{fig:test}
\end{figure}
\end{document}
2- I do not completely understand your question. Do you want to know how to create a class file?
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Report Layout
That works great. I only had should to define a diferent \vspace* value because the float overrides the text before it.
Yes, I want to create a class file with the options that I defined at the preamble of this tex file.gmedina wrote: 2- I do not completely understand your question. Do you want to know how to create a class file?
"Show me your .emacs and I'll tell you who you are." -- modified proverb
Re: Report Layout
One more question: I don't decide yet if the document are going to be in one or two columns, but to use this float, I need one column. I can define in the modified environment a chage before on columns before and after float?
"Show me your .emacs and I'll tell you who you are." -- modified proverb
Report Layout
Hi,
The clsguide document contains useful information for writting classes.
In order to make the figure span both columns, you can use the figure* environment instead of the un-starred figure environment.cbustaam wrote:One more question: I don't decide yet if the document are going to be in one or two columns, but to use this float, I need one column. I can define in the modified environment a chage before on columns before and after float?
The clsguide document contains useful information for writting classes.
Last edited by gmedina on Mon Aug 03, 2009 5:27 am, edited 1 time in total.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Report Layout
Thanks a lot for your help... After I do a good preamble, I'm going to check out the clsguide to make it a document class.
I have one more question: If I want to set as default the following table style, how can I do it? I put this line
To get an environment similar to figure, but in the title appears "GRAFICO". So, I need to appears "GRAFICO" for figure envirnment, and "CUADRO" for the table one. Also, I need to set up the colored rows and table headers.
Regards
I have one more question: If I want to set as default the following table style, how can I do it? I put this line
Code: Select all
\restylefloat{table}
Regards
"Show me your .emacs and I'll tell you who you are." -- modified proverb
Report Layout
Hi,
the following code contains the new redefinitions for tables and a sample table like the one you need:
For further information, please refer to the documentation of the used packages. Of course, feel free to modify my example according to your needs.
the following code contains the new redefinitions for tables and a sample table like the one you need:
Code: Select all
\documentclass{report}
\usepackage[margin=2cm]{geometry}
\usepackage{array}
\usepackage[table,svgnames]{xcolor}
\usepackage{float}
\makeatletter
\renewcommand\floatc@ruled[2]%
{\setbox\@tempboxa\hbox{#2}%
\ifdim\wd\@tempboxa>\hsize #2\par%
\else\hbox to\hsize{\hfil\box\@tempboxa\hfil}\fi}
\renewcommand\fs@ruled{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@ruled%
\def\@fs@pre{\vspace*{0pt}\hrulefill\lower.8ex
\hbox{\colorbox{MidnightBlue}{%
\textcolor{white}{\scriptsize GR\'AFICO\ \thefigure}}}%
\hrulefill\vspace{10pt}}%
\def\@fs@post{\vspace{3pt}\kern2pt\hrule\relax}%
\def\@fs@mid{\addvspace{10pt}}
\let\@fs@iftopcapt\iftrue}
\renewcommand\floatc@plain[2]%
{\setbox\@tempboxa\hbox{#2}%
\ifdim\wd\@tempboxa>\hsize #2\par%
\else\hbox to\hsize{\hfil\box\@tempboxa\hfil}\fi}
\renewcommand\fs@plain{\def\@fs@cfont{\bfseries}\let\@fs@capt\floatc@plain%
\def\@fs@pre{\vspace*{0pt}\hrulefill\lower.8ex
\hbox{\colorbox{MidnightBlue}{%
\textcolor{white}{\scriptsize CUADRO\ \thetable}}}%
\hrulefill\vspace{10pt}}%
\def\@fs@post{\vspace{3pt}\kern2pt\hrule\relax}%
\def\@fs@mid{\addvspace{10pt}}
\let\@fs@iftopcapt\iftrue}
\makeatother
\floatstyle{ruled}
\restylefloat{figure}
\floatstyle{plain}
\restylefloat{table}
\newcommand\myc[1]{%
\multicolumn{1}{c!{\color{white}\vline width 1pt}}{\cellcolor{MidnightBlue}\color{white} #1}}
\newcommand\mycf[1]{%
\multicolumn{1}{c}{\cellcolor{MidnightBlue}\color{white} #1}}
\begin{document}
\begin{table}[!ht]
\centering\footnotesize
\setlength\arraycolsep{0pt}
\setlength\extrarowheight{2pt}
\rowcolors{2}{MidnightBlue!25}{MidnightBlue!5}
\begin{tabular}{>{\raggedright\arraybackslash}m{4.8cm}*{7}{!{\color{white}%
\vline width 1pt}>{\centering\arraybackslash}m{1.3cm}}}
\rowcolor{MidnightBlue}\myc{\rule[-7pt]{0pt}{19pt}Medida} & \myc{Argentina} & \myc{Bolivia} &%
\myc{Brasil} & \myc{Chile} & \myc{Colombia} & \myc{M\'exico} & \mycf{Per\'u}\\
Ajuste excepcional a las operaciones de mercado (frecuencia y opciones) &&&&& X &&\\
Disminuci\'on en el encaje sobre dep\'ositos & X & X & X & & X & & X\\
Mecanismos de liquidez en moneda extranjera &&& X & X && X & X\\
Intervenci\'on en el mercado de divisas y/o ajustes en los mecanismos & X &&&& X & X & X\\
Cambios en las facilidades de cr\'edito & X &&& X &&&\\
Reducci\'on de las tasas de intervenci\'on &&&&&&&
\end{tabular}
\caption{MEDIDAS DE POL\'ITICA MONETARIA EN LA SEGUNDA PARTE DEL A\~NO}
\label{tab:test}
\hspace*{-12.5cm}Fuente: Bancos centrales de cada pa\'is.
\end{table}
\end{document}
1,1,2,3,5,8,13,21,34,55,89,144,233,...
Report Layout
Hi gmedina
Again, thanks for your reply. I have a problem when I try to compile the code with 12pt or 11pt font size. I got something like What can I do?
Again, thanks for your reply. I have a problem when I try to compile the code with 12pt or 11pt font size. I got something like What can I do?
"Show me your .emacs and I'll tell you who you are." -- modified proverb
Re: Report Layout
Doh, Obvious... silly question.
Thanks for your help.
Thanks for your help.
"Show me your .emacs and I'll tell you who you are." -- modified proverb