Linked Questions

309
votes
4answers
26k views

What is the use of percent signs (%) at the end of lines?

I see that the code in many packages and examples contains percent signs % at the end of (many) lines. What are they used for? Do they affect the parsing of those lines?
68
votes
3answers
3k views

When is it harmful to add percent character at end of lines in a \newcommand, or similar

Since egreg has graciously agreed to not comment at least for a day to When not to use \ensuremath for math macro? :-), I thought I would take advantage of that and post a question about another (non-...
26
votes
2answers
10k views

Defining a newcommand, with variable name, inside another newcommand

I wish to use \newcommand inside \newcommand. I can do a basic version of that, but the bit that I can't figure out is how to construct a nontrivial name for the inner \newcommand (i.e. by prepending ...
12
votes
5answers
3k views

\newenvironment issues with environment comment

I am trying to setup the formatting for a LaTeX document (it's got the class memoir), so that it would be fairly simple to add to it in the future. Two of the features I'd like are: Be able to mark ...
11
votes
2answers
4k views

Remove space before colorbox

I've made the command \newcommand{\pink}[1]{\colorbox{red!20}{#1}} to highlight in pink. It works fine for words and sentences, but if I want to highlight a subpart of a word, e.g. laugh\pink{ing} ...
8
votes
1answer
9k views

Including all files within a directory [duplicate]

Possible Duplicate: How to iterate through the name of files in a folder Using \input{filename}, I can input a file canned "filename.tex". I have a directory containing all of the files I want to ...
11
votes
1answer
964 views

How can I avoid whitespace after a macro which takes arguments?

I have a macro that (simplified) is defined like this: \newcommand{\mymacro}[1]{ %use #1 \par\noindent% } I'd like to be able to use it like \mymacro{Arg 1} Beginning of paragraph ...
2
votes
3answers
2k views

hfill alignment doesn´t work

I used the code below to format some information but the last line before the red line is not right aligned. I can`t find the problem in the code. Any suggestion? Thanks. \documentclass[11pt,a4paper]{...
22
votes
1answer
510 views

Summary of TeX Capacity Limits

I seem to often run into capacity issues and have been upping the limits each time. There are several question on this site pertaining to these. However, there seems to be some conflicting information ...
6
votes
2answers
486 views

macro for custom indexing with conditionals and text recognition

I was unable to solve this by myself and by searching this wonderful site. The problem is with indexing. I still consider myself as a LaTeX newbie :) The situation: - I'm working on an english book ...
3
votes
1answer
2k views

Line Arrows for Tabular Integration Table

I've recently reviewed this question to try to make a table for Integration by parts: Tabular integration by parts I tried using the code sample from it but LaTeX gives me a rendering error with ...
2
votes
1answer
2k views

Unwanted spaces

The code given just after produces extra unwanted spaces indicated in the following picture. How can I fix it ? Sorry for the colors, this choices will be changed later when technical issues will be ...
2
votes
3answers
507 views

Macro to insert formatted text: def, let or what?

I want to insert formatting text with a single command (I know the text beforehand): {\addfontfeature{LetterSpace=20.0}Решение}\ How do I "bind" it to a macro? I tried: \def\sol#0 {{\...
3
votes
2answers
277 views

Defining command containing pagebreak, and boxes

I am trying to make a new function, to make my life simpler. The code is supposed to make a pagebreak and ouput a colored box at the next page. Aswell as puting something in the TOC The code works, ...
4
votes
1answer
360 views

If.. then else and flipping a variable

I am trying to write a template to automatically load files inside directories formatted in a certain way, and I want to print something every time a new file is found in a directory previously empty. ...

15 30 50 per page