Page LayoutFixing space between objects?

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
kroneckerdelta
Posts: 2
Joined: Thu Apr 08, 2010 8:56 pm

Fixing space between objects?

Post by kroneckerdelta »

So I want to have a small line of squares which relate to a line in a picture I've done in TpX. My rather lengthy and rubbish code to do this is (note I'm not LaTeX savy, but I do use it a lot)

\newcommand{\dottedline}{\protect{\tiny{\raisebox{0.03in}{$\centerdot$} \hspace*{-0.061in} \raisebox{0.03in}{$\centerdot$} \hspace*{-0.061in} \raisebox{0.03in}{$\centerdot$} \hspace*{-0.061in} \raisebox{0.03in}{$\centerdot$} \hspace*{-0.061in} \raisebox{0.03in}{$\centerdot$}}}}

However, when I use this in two different locations the spacing between the dots is different, no doubt due to LaTeX spacing on a line with more or less words. Is there anything I can do about this? Can I force latex to treat this as an object that it cannot alter?

edit: Sorry about not putting everything...

Below is a fragment of my latex code which you can copy/paste, as you can see I want them all to appear in the captions how it appears on the first line.

\documentclass[11pt,a4paper,twoside]{article}

\usepackage{color}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsmath, amsthm, amssymb}
\usepackage{amsfonts}
\usepackage[english]{babel}

\usepackage{graphicx}
\usepackage{rotating,graphics,psfrag}
\usepackage[dvips]{epsfig}

\usepackage{pifont}

\usepackage{subfigure}

% Margins are set
\setlength{\textheight}{24cm} \setlength{\textwidth}{15cm}
\setlength{\topmargin}{-1cm} \setlength{\oddsidemargin}{0cm}
\evensidemargin = \oddsidemargin

\newcommand{\smallcircleslines}{\textbf{-}\hspace*{-0.06in}{\tiny{\protect\raisebox{0.009in}{
\ding{108}}}}\hspace*{-0.02in}\textbf{-}\hspace*{-0.02in}{\tiny{\protect\raisebox{0.009in}{\ding{108}}}}\hspace*{-0.07in} \textbf{-}}

\newcommand{\bdashline}{{\textbf{{-\hspace*{-0.045in} -\hspace*{-0.045in} -}}}}

\newcommand{\dashline}{-\hspace*{-0.03in} -\hspace*{-0.03in} -}
\newcommand{\dottedline}{\protect{\tiny{\protect\raisebox{0.03in}{$\centerdot$} \hspace*{-0.05in} \protect\raisebox{0.03in}{$\centerdot$} \hspace*{-0.05in} \protect\raisebox{0.03in}{$\centerdot$} \hspace*{-0.05in} \protect\raisebox{0.03in}{$\centerdot$} \hspace*{-0.05in} \protect\raisebox{0.03in}{$\centerdot$}}}}

\begin{document}

(\dottedline) \newline
Figure 1: General representation of the domain $D$ and boundary $\Gamma=\Gamma_U\cup\Gamma_S$, with \newline unspecified boundary condition (\dottedline) on $\Gamma_U$, and source points (\textcolor{red}{\bdashline}) placed on $\Gamma_E=\Gamma_{E}^{(1)}\cup\Gamma_{E}^{(2)}$ external to the domain $D$. \newline
Figure 2: General representation of the domain $D$ and boundary $\Gamma$, with unknown boundary condition (\dottedline), collocation points (\smallcircleslines) and source points (\textcolor{red}{\bdashline}) placed external to the domain and symmetrically.

\end{document}
Last edited by kroneckerdelta on Thu Apr 08, 2010 9:47 pm, edited 2 times in total.

Recommended reading 2024:

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

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

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

gmedina
Posts: 2313
Joined: Wed Jul 11, 2007 11:45 pm

Re: Fixing space between objects?

Post by gmedina »

Hi,

please post minimal, complete and compilable code and not just code snippets.
1,1,2,3,5,8,13,21,34,55,89,144,233,...
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Fixing space between objects?

Post by frabjous »

Lots of ways to do this, but the least change would just be to remove the space between the dots, and adjust the hspace* command accordingly.

Here's a first stab:

Code: Select all

\newlength{\dottedlinegap}
\setlength{\dottedlinegap}{0.13em}
\newcommand{\dottedline}{\protect{\tiny{\protect\raisebox{0.03in}{$\centerdot$}\hspace*{\dottedlinegap}\protect\raisebox{0.03in}{$\centerdot$}\hspace*{\dottedlinegap}\protect\raisebox{0.03in}{$\centerdot$}\hspace*{\dottedlinegap}\protect\raisebox{0.03in}{$\centerdot$}\hspace*{\dottedlinegap}\protect\raisebox{0.03in}{$\centerdot$}}}}
Change the value of \dottedlinegap until you're pleased.
kroneckerdelta
Posts: 2
Joined: Thu Apr 08, 2010 8:56 pm

Re: Fixing space between objects?

Post by kroneckerdelta »

Thanks frabjous, that's perfect.

Statement: There's so many options in latex and I find it hard to find things useful most of the time for latex using google.
Post Reply