General ⇒ Report Layout
Re: Report Layout
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
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Report Layout
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?
Report Layout
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?
Re: Report Layout
Report Layout
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.
Report Layout
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
Report Layout
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}
Report Layout
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?
Re: Report Layout
Thanks for your help.