1
vote
0answers
28 views

using macro to identify “line breaks” as properties separator, “:” colon as properties name separator, and “-” hyphen as description

Here I have created document as per requirement. But I need to use macro in specific way. Here is my document : ...
3
votes
0answers
77 views

Identifying and adding macros [closed]

I added two macros: \newcommand{\tblkeyword}[1]{\textcolor{red}{#1}} \newcommand{\tblkeyword}[2]{\textcolor{blue}{#2}} and tried to use at like: \tblkeyword{ObjectId} // which shows red color. ...
0
votes
0answers
61 views

using macro to simplify the code

I got my code working with net and SO help. But now I want to simplify it using macro. I dont know macro, but people says it makes code more simplified. can some one guide me to have macro for this. ...
5
votes
1answer
151 views

\pdfoutline, German sharp-s character

I use the following code to produce bookmarks in a pdf document: \pdfdest num 1 fit \pdfoutline goto num 1 count 0 {äöüÄÖÜß} äöüÄÖÜß ... more text ... The text prints fine. The pdf bookmark shows ...
4
votes
3answers
130 views

How do I split large numbers into groups of five digits? [duplicate]

I need to split a number of 27 digits into groups of 5 digits. I already had a look at siunitx, telprint and numprint. But these just allow me to generate groups of two or three digits. Is there any ...
5
votes
1answer
41 views

Using \newcommand to format numbers/strings according to a pattern [duplicate]

I'm an aspiring LaTeX user and have so far managed the first steps and created my first few documents. Coming from a programming background I've been wondering how you could use \newcommand to create ...
2
votes
1answer
39 views

How to add another \cc tag in a letter class?

I need to create a legal document similar to a letter for a bussiness. I use the stardar class letter for be the best that fit at my needs. In fact I need to create a formal document but I need to ...
3
votes
1answer
153 views

Macro to apply tabcolsep to a table from external file

I am using R to produce my tables via xtable, but I am not using Sweave to write my document. Instead I am using TexStudio and if possible would like to stick with it. Therefore I am using \input to ...
9
votes
3answers
204 views

How to customize enumeration to implement Brazilian law texts?

This is a standard model of a Brazilian contract: http://www.consultta.com/modelos_contratos/modelos_contrato/0215.htm It more or less follow the way Brazilian laws are written: as you can see, the ...
3
votes
1answer
119 views

Editing cleveref's format for multiple label references

I am using the cleveref package to refer to theorems, equations, etc, in an article (LaTeX). I wish to have the format of reference as: Thm. (1) for single theorem (or equation, figure, etc) and Thms. ...
8
votes
1answer
93 views

Compare the height of arguments

I'm trying to define a \newcommand with three arguments. I'd like to: compare the height of these arguments choose the largest height to create frames (with that height) around the arguments. ...
6
votes
5answers
1k views

Hiding part of text leaving blank space

I am quite new to LaTeX so my question may be trivial, but I haven't found a good solution so far. I am preparing some lecture notes and I would like to have 2 different versions: one for myself, ...
1
vote
1answer
113 views

Script dialogues

I'm trying to write a script, and I have defined the following commands: \newcommand{\SpeechText}[1]{ \vbox{\ignorespaces{\quotation{#1}}\par\duplines} } \newcommand{\ParagraphText}[1]{ ...
2
votes
1answer
3k views

Format section's title with \renewcommand

I have tried to make my sections appear as "Section I : My section's title" or "Section I My section's title" with the \renewcommand\thesection... command but in the table of contents the word ...
4
votes
1answer
867 views

Questions about algpseudocode

I'm using the following packages: \usepackage{algpseudocode} \usepackage{algorithm} but I don't understand what package is algpseudocode, since I can't find the documentation. I have followed this ...
14
votes
4answers
583 views

Create fill-in-the-blank version of a document with ability to toggle blanks on and off

I am preparing some lecture notes/slides and would like to efficiently create two versions of the output: a complete version for myself, and a version for my students with certain text replaced with ...
5
votes
1answer
192 views

Including .tex files that need a different style file than the main text

EDIT: Substantial edit of the original version has been done to clarify the question. Background I've written two small python package manuals with sphinx (http://sphinx-doc.org/) a program that ...
0
votes
1answer
101 views

No space after the word when I defined a macro, bug? [duplicate]

I defined a macro but I found the word spacing is gone. Am I missing something? \documentclass[11pt, oneside]{article} \newcommand{\abc}{$abc$} \newcommand{\abcSpace}{$abc$ } \begin{document} Word ...
5
votes
1answer
103 views

Formatting a comma separated list of values

I'm creating a set of mathematics worksheets, and I'd like to have an upside down "answer key" below a set of enumerated questions. Here is what I have at the moment: \usepackage{graphicx} Answers: ...
13
votes
2answers
586 views

Why are these commands considered as bad practice?

I was reading LaTeX: Do not use these commands, but the author didn't explain why they are bad. Could anyone help me understand. \\ (except inside a special environment like tabular, array, or ...
13
votes
3answers
708 views

Examples of list macros in plain TeX

I'm writing macros to typeset lists in plain TeX. Please can you suggest some examples of macros for numbered lists? I'd prefer examples from "living code", from CTAN packages and so on. But any kind ...
3
votes
2answers
120 views

How can I customize this code for signature line to fit a specific format?

Found a nice piece of code here dynamic signature/date line and modified it to this: \newcommand*{\DateAndSignature}[1]{% ..\newline \par\noindent\makebox[2.25in]{Musterstadt, den}{\hrulefill} ...
8
votes
1answer
270 views

\newcommand defined for declarative formatting works for \it but not \textit or \emph

I defined this \newcommand for binomial genus/species names, which should be in italics: \newcommand{\taxon}[1]{{\it #1}} For whatever reason, it only renders the relevant text in italics if I use ...
11
votes
3answers
838 views

Reusing LaTeX code to achieve a consistent layout

What is the best approach to reusing the same layout for numerous tables, paragraphs etc. which share the same structure but different content? Is the best method to use custom commands/macros?
7
votes
1answer
89 views

Detect markers in macro arguments

I'd like to find a way to define a command which would work like this \mycommand{This +is+ a +simple example+.} and give This is a simple example. i.e a command which looks for words ...
13
votes
3answers
556 views

Remove formatting

I currently use latex newcommand to store (and format) "variables", like so: \newcommand{\someVariable}{\emph{value}} I do this for key words that I want to be formatted a certain way every time ...
4
votes
1answer
532 views

textbf+UpperCase title

I would like to make a section title UpperCase+textbf, however, while trying to define it like this \makeatletter \renewcommand{\section}{ \@startsection {section}{1}{0mm} ...
10
votes
2answers
651 views

Replacing all dots in a document

I want to replace all dots in a LaTeX document with a call to a macro. Just doing a search and replace on '.' won't help as this will not replace the dots generated by LaTeX, e.g. in section numbers, ...
11
votes
5answers
207 views

Best way to have two kinds of formattings for my documents?

I would like to produce two kinds of formattings for my documents. The 1st formatting will use colors. This is typically for reading on a screen. The 2nd formatting will use gray colors for ...
5
votes
1answer
220 views

Changing the font for a custom environment

I can't figure out how to embed a command like \textbf or something in a newly created environment, I have: \newenvironment{definition} {\begin{quote}} {\end{quote}} I want to customize my ...
8
votes
2answers
624 views

Change the behavior of carriage return

Define an enhance verse environment, where stroke Carriage return key once make a \\, twice make a \par, three times make a \medskip, four times and more make a \bigskip. An example would be: ...
1
vote
1answer
217 views

What is the best way to setup this statblock as a macro?

I'd like to get a macro setup for this statblock format. Basically, I will be converting an XML document containing the data for the instances within the document. This is a sample of the format I am ...
5
votes
2answers
2k views

Grey box code and lists

I've got that code from a website to make grey areas in my LaTeX document. % http://www.alfredklomp.com/programming/tex/macros/ \long\def\greybox#1{% \newbox\contentbox% \newbox\bkgdbox% ...
13
votes
2answers
2k views

Define an “escape underscore” environment

I am writing a text document in LaTeX where I need a lot a words with underscores: foo_bar_1, more_bar_2_long_expression_3. I know about the underscore package, but for some reason the [strings] ...
28
votes
6answers
1k views

How do I typeset morse code with LaTeX

I am writing an article regarding the history of the Morse code and I am having difficulties printing the dots and dashed (they get combined when the document is printed). Is it also possible to ...
34
votes
3answers
3k views

Will two-letter font style commands (\bf , \it , …) ever be resurrected in LaTeX?

I understand that \bf and \it are now obsolete in LaTeX and that \textbf and \textit are proper, as they produce more sophisticated (in particular, cumulative and properly kerned) changes to font ...
4
votes
1answer
76 views

Command for formatting a special term

How can write a new command which formats a certain 2-word-term always in a special font, all uppercase, with the line-height of the uppercase characters being the same as the line-height of down-case ...
4
votes
2answers
330 views

Position line in a resume

I am new to LaTeX, and I want to create a command that will display my previous positions formatted appropriately in a resume. The format I am looking for is this: 02.07.2009 - 02.07.2010 ...
12
votes
4answers
1k views

Replace . (period) by , (comma) in numbers

I pass a bunch of numbers into a custom command defined via \newcommand{\mycmd}[1]{...}: \mycmd{1.12} \mycmd{5.32} \mycmd uses the number to draw a certain figure. On top of that, I would like to ...
28
votes
1answer
2k views

Why Different Commands for Seemingly Similar Tasks?

Take a look at the following list: \textit, \it, \emph, \itshape, \mathit \textbf, \bf, \bfseries, \mathbf ... One might say, for instance, that: \mathbf and \mathit are for math mode, while the ...