Text FormattingRight Justification of Box Content

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
noelrich
Posts: 5
Joined: Tue Apr 10, 2012 9:48 pm

Right Justification of Box Content

Post by noelrich »

I am trying to finish the last edits to my dissertation, and the university doesn't have a LaTeX template. I have made all the necessary changes, but can't seem to get the last bit done. The second bit here needs a right justification for the committee members (which are generated with the #1, #2 ...)

Code: Select all

\centerline{\parbox[t]{0.2\textwidth}{\setstretch{2} Committee Chair:\\Committee:}
\hspace{1cm} \parbox[t]{0.3\textwidth}{\setstretch{2}        {#1}\\\ifthenelse{\equal{#2}{}}{}{{ #2}\\}{#3}\\{#4}\\{#5}\\{#6}
Any one know how to do this?

Thanks!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Right Justification of Box Content

Post by Stefan Kottwitz »

Hi,

welcome to the board!

The code snippet is pretty incomplete, it looks like a part of a macro definition. Nothing we just could run and see.

Nevertheless, if you mean right justification, you could use the {flushright} environment or \raggedleft, or a {tabular} environment.

Stefan
LaTeX.org admin
noelrich
Posts: 5
Joined: Tue Apr 10, 2012 9:48 pm

Re: Right Justification of Box Content

Post by noelrich »

I have tried the flushright and raggedleft without any luck, I'll attach the whole class file (line 514 was the start of the last post.).

Thanks!
Attachments
gsudiss.cls
(26.09 KiB) Downloaded 214 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Right Justification of Box Content

Post by Stefan Kottwitz »

And how did you use it? A Infominimal working example would show it. Such as

Code: Select all

\documentclass{gsudiss}
\begin{document}
\committee{One}{Two}{Three}{Four}{Five}{Six}{Seven}{Eight}
\end{document}
but this shows just
committee.png
committee.png (2.28 KiB) Viewed 4576 times
Stefan
LaTeX.org admin
noelrich
Posts: 5
Joined: Tue Apr 10, 2012 9:48 pm

Right Justification of Box Content

Post by noelrich »

Code: Select all

\documentclass[12pt,gsu,online,double]{gsudiss}

\usepackage{natbib}                % To format bibliographies.
\setlength{\bibsep}{0pt}           % Necessary for bib entries to have
                                   % correct line spacing.
\usepackage{tocloft}
\renewcommand{\cftfigfont}{Figure\ }
\renewcommand{\cfttabfont}{Table\ }
%\usepackage{lscape}
\usepackage{pdflscape,array}
%\usepackage{deluxetable}
\usepackage{aas}                   % Some abbreviations for AAS references.
\citestyle{aa}                     % Astronomy & Astrophysics cite style.
\usepackage{eucal}                 % Euler fonts for equations.
\usepackage{verbatim}              % Allows quoting source with commands.
\usepackage{graphicx}              % For powerful manipulation of figures.
\usepackage{amsmath,amsthm,amsfonts,amsopn,amssymb} % Some nice math packages.
\usepackage{longtable}                % My preference table package.
\usepackage[overlay]{textpos}      % Put stuff anywhere, I mean anywhere ...
\usepackage{pstricks}              % Draw stuff especially on top figures etc...
\usepackage{afterpage}             % Useful for absolute placement of figures and tables.
\usepackage{rotating}
%\input{figures}                    % My defined figures, see the file "figures.tex".
\input{usercommands}               % User defined commands go in this
                                   % file called "usercommands.tex".
                                   % Of course you can rename it.

\usepackage{atbeginend}            % Modify space before and after
                                   % equations. These are my preferences.
\AfterBegin{equation}{\addtolength{\abovedisplayskip}{-0.5\baselineskip}}
\BeforeEnd{equation}{\addtolength{\belowdisplayskip}{-0.5\baselineskip}}
\AfterBegin{equation*}{\addtolength{\abovedisplayskip}{-0.5\baselineskip}}
\BeforeEnd{equation*}{\addtolength{\belowdisplayskip}{-0.5\baselineskip}}

\renewcommand{\topfraction}{0.85}        % These modify figure placement on
\renewcommand{\bottomfraction}{0.85}     % the page and various other space
\renewcommand{\textfraction}{0.10}       % requirements for figures.
\renewcommand{\floatpagefraction}{0.80}  % These 5 lines are not
\renewcommand{\arraystretch}{0.5}        % necessary but I think its better
                                         % than latex default.

\clubpenalty=9999                  % Make Latex try hard to fix
\widowpenalty=9999                 % "stray lines" in paragraphs,
                                   % i.e. paragraph that begin at the
                                   % last line of a page, or end with
                                   % the last line on the following
                                   % page. This looks silly.

\settocname{Table of Contents}              % Set the "Table of Contents"
                                   % name. This is the default. You
                                   % can use "Table of Contents" for example.

\setlofname{List of Figures}               % Change the name from 'List of
                                   % Figures'. Use whatever you wish.

\setlotname{List of Tables}                % Change the name from 'List of
                                   % Tables'. Use whatever suit your
                                   % fancy.

\settocbibname{References}         % Change the name from
                                   % 'Bibliography'. Change it back if
                                   % you feel like it.

\setloaname{List of Abbreviations}
                                   % I Changed the name from 'List of
                                   % Abbreviations'. Use any name that
                                   % makes sense here. If you don't
                                   % have an "abbreviations.tex" file,
                                   % this command will do nothing.

\setfigname{Figure\ }               % Set the caption labels for figures.

\settabname{Table\ }                % Set the caption labels for tables.

\setcapfont{pnc}                   % Set the caption font for
                                   % both tables and figures.

\chapternumsize{\normalsize}            % You can use any standard latex sizes here.
\chapterheadsize{\normalsize}           % You can use any standard latex sizes here.
\chaptertitlesize{\normalsize}           % You can use any standard latex sizes here.
                                   % These defaults look good to me.

\beforechapterheadname{}         % Optional text to put in front of
                                   % the chapter number.
\afterchapterheadname{}          % Optional text to put after the
                                   % chapter number. The default
                                   % looks like this: --1--. Of course
                                   % you can change this to any
                                   % format, for e.g. $\sim$

\chapterheadpos{center}            % You can use 'right', 'left',
                                   % 'center'.

\chaptertitlepos{center}           % You can use 'right', 'left',
                                   % 'center'

\chapterheadverticalspace{6em}     % The space between the Chapter head
                                   % and the top of page. This distance
                                   % is not absolute, but relative to
                                   % the parameters set by the
                                   % geometry package. Play around
                                   % with this number to suit your needs.

\chapterbetweentitlespace{-1.em}   % The space between the chapter head
                                   % and the title head.

\titleheadverticalspace{2em}       % The space between the title head
                                   % and the text.

\sectiontitlesize{\normalsize}          % This is obvious.
\sectiontitlepos{left}             % Obvious.

\sectiontitleverticalspace{1em}    % The space between the section head
                                   % and the text.

\subsectiontitlesize{\normalsize}       % Obvious.
\subsectiontitlepos{left}          % Obvious.

\subsectiontitleverticalspace{0.5em} % You get the idea...

\sepabbrev{7em}                    % The space between the abbreviation
                                   % lists, that is, if you have
                                   % one. Has to be >= 5em.

\prettify{pzc}

\printdraft{\textcolor{gray}\small DRAFT}    % In order to use this
                                   % command, you have to enable "drafts"
                                   % in the option of the gsudiss
                                   % class, otherwise it does
                                   % nothing. This prints the word
                                   % "DRAFT" in gray color in the header of your
                                   % dissertation. You can go wild
                                   % here if you want. Just make sure
                                   % you disable the draft option
                                   % before final printing.

\author(name)              % Name required.

\title(blah)    % Title of dissertation Required.

\titlesize(12)(12)                               % This is for changing
                                             % the default font size
                                             % for your title. The
                                             % first argument is the
                                             % font size, the second
                                             % is the line spacing for
                                             % long tiles that wrap to
                                             % more than one line.
                                             % Default is equivalent
                                             % to the \LARGE command,
                                             % which is roughly (22)(22).

% \committee: The first parenthesis must contain your supervisor name.
%         You can have two supervisors (for strange reasons), in which case, the
%         second supervisor goes into the square brackets, next to the
%         first. If you have one like me, then leave the second entry blank, like below. The
%         rest of the parentheses contains the rest of your committee members. You
%         can have up to six entries, NOT including your supervisor(s). My
%         school requires five or four. I have five (5) members
%         below. Finally, the last square brackets contains the
%         chairman of your department. In my case, the chairman is
%         also a committee member, so he is listed twice. Note that
%         there is no need to put the "Dr." title in front of any of the names.

\committee(Douglas R. Gies)[]
          (Harold A. McAlister)
          (Todd J. Henry)
          (Misty C. Bentz)
          (Brian D. Thoms)
          (Nancy D. Morrison)
          [H. Richard Miller]

\department(Department of Physics and Astronomy)
                                   % Your Department name.
                                   % Other departments you can
                                   % use include
                                   % \department(School of Arts \& Design)
                                   % or \department(School of Music), etc...

\departmenttitle(Chair)            % For Arts and Music school
                                   % students use
                                   % \departmenttitle{Director}

\graduationyear(2012)              % Defaults to the same year
                                   % you are writing this
                                   % Dissertation. Do
                                   % \graduationyear(200x) if
                                   % you ever need to change it.

\graduationmonth(May)      % This is the date of the
                                   % official graduation ceremony.
                                   % Do \graduationmonth{January}
                                   % for example. Defaults to "August"

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%               The dissertation starts here.                        %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Right Justification of Box Content

Post by Stefan Kottwitz »

Even if I add some text and add \end{document} to make it compilable, it doesn't show a committee but just errors. I gave a link above explaining what a minimal example means. Did you see it? I mean, I take time to deal with your question, you could take the time to follow the link and read it. You write a dissertation, so I'm sure you would understand it and just missed to follow the link.

I spent some time here, soon my laptop battery runs out of energy, so no guarantee that I will answer later again.

Stefan
LaTeX.org admin
noelrich
Posts: 5
Joined: Tue Apr 10, 2012 9:48 pm

Re: Right Justification of Box Content

Post by noelrich »

Sorry, I put together a minimal sample set of files now... the 'package' is a hodgepodge of files (as the university refuses to provide a template). The support files are there, and there is a bash script called 'create'. The Professors on the committee will need to be right aligned and I don't know how to get that to work. Thanks for the help.
Attachments
sample.zip
(67.61 KiB) Downloaded 119 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Right Justification of Box Content

Post by Stefan Kottwitz »

So as I said above, just insert a \raggedleft command, such as

Code: Select all

  \def\committeemembers{\hspace{1.12in}
Professor:\\Committee:}
    \centerline{\parbox[t]{0.2\textwidth}{\setstretch{2} Committee Chair:\\Committee:}
      \hspace{1cm} \parbox[t]{0.3\textwidth}{\raggedleft\setstretch{2}        { #1}\\\ifthenelse{\equal{#2}{}}{}{{ #2}\\}{#3}\\{#4}\\{#5}\\{#6}
        \ifthenelse{\equal{#7}{}}{}{\\{#7}}\ifthenelse{\equal{#8}{}}{}{\\{#8}}}}\vspace{1cm}}
Stefan
LaTeX.org admin
noelrich
Posts: 5
Joined: Tue Apr 10, 2012 9:48 pm

Re: Right Justification of Box Content

Post by noelrich »

Thank you so much! I think I had just put it in the wrong spot before.
Post Reply