Hi.
I am new to LaTeX.
I need a tool which makes one word be set always at the end of an existing line i.e. always at the right, but not in a column right next to the lines, but underneath them, just as a part of the line. Currently I am using \hfill. But each time the line gets near to its maximum length or to a linebreak the last word (actually it is the marks display in math exams) breaks into the new line and stays in the left corner. Someone told me about \hfill* which still won't work the way I want it to (in fact it doesn't work at all in the compiler I use at monkeytex).
I am thinking about writing a makro using \ifthenelse and evaluating the number of left space in the line resp. the number of characters in the line and the maximum number which might result from the page settings.
Does anyone know how to count the characters after the compiler has already worked the line up to the last word before the current command?
Or to help me out in some other way?
Thanks.
Yours, littlemathteacher.
Text Formatting ⇒ character count
-
- Posts: 9
- Joined: Mon Nov 09, 2009 6:14 pm
character count
Last edited by littlemathteacher on Thu Nov 26, 2009 10:11 am, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.
Re: character count
If I understand your question correctly, it might be easiest to use the
basic tabular environment, and right justify the text in the rightmost
column. Most introductory articles about LaTex should contain enough
information to get you started.
basic tabular environment, and right justify the text in the rightmost
column. Most introductory articles about LaTex should contain enough
information to get you started.
-
- Posts: 9
- Joined: Mon Nov 09, 2009 6:14 pm
Re: character count
Thanks to adrian.
Isn't your proposal, i.e. using a separate column, the one that puts the word (i.e. the marks counter) right next to the text? I don't want it to appear in a separate column, for I don't want to use so much space on the page for it. Furthermore the page without a separate column for the marks looks much more relaxed to me - more like an article than like math exam.
If I'm not right please put me right. Otherwise: anyone to help me?
Thanks
Isn't your proposal, i.e. using a separate column, the one that puts the word (i.e. the marks counter) right next to the text? I don't want it to appear in a separate column, for I don't want to use so much space on the page for it. Furthermore the page without a separate column for the marks looks much more relaxed to me - more like an article than like math exam.
If I'm not right please put me right. Otherwise: anyone to help me?
Thanks
-
- Posts: 9
- Joined: Mon Nov 09, 2009 6:14 pm
character count
This is the tool I was looking for:
Found it more or less accidentially.
Code: Select all
\hspace*{\fill} \mbox{5 P.}\\
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
character count
Code: Select all
\documentclass[english]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{lmodern}
\usepackage{blindtext}
\newcommand*{\signed}[1]{%
\unskip\hspace*{1em plus 1fill}%
\nolinebreak[3]\hspace*{\fill}\mbox{#1}
}
\begin{document}
\blindtext
\signed{5 P.}
\end{document}
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10