{environments} is for general questions related to (La)TeX environments. For questions about environment subcategories like {lists}, {quoting} environments, or {floats} use the appropriate tag instead.

learn more… | top users | synonyms (3)

1
vote
1answer
26 views

For programming a command: emit \newline iff we are within a paragraph

Short version: I am defining an environment: \newenvironment{myenv}{\begin{trivlist}\item}{HERE something\end{trivlist}} Now at the point marked with "HERE", I need a "conditional newline" doing ...
1
vote
1answer
30 views

Disabling automatic dissimilarity coding in texshade

The package texshade provides an environment to typeset nucleotide and aminoacid alignments. This otherwise great package has a default setting, which I would like to turn off: By default, texshade ...
2
votes
1answer
35 views

Use \(end)comment instead of \begin/\end{comment}

In my document, the comment environment works fine, but \comment and \endcomment stop processing of what comes next in the document: \documentclass{article} \usepackage{verbatim} \begin{document} X \...
1
vote
1answer
28 views

simple formatting issue, 2 interfering environments

I am using the Frankensteins dialogue environment as well as the mdframed environment in order to highlight interesting parts of the dialogue. I would like that these two environments don't interfere ...
0
votes
0answers
11 views

Using arguments in \newenviroment together with \caption [duplicate]

I created \newenviroment for "professional tables": \newenvironment{tabpo}[1]{% \begin{table}[!ht] \centering \begin{tabular}{lllllll} \toprule } {% \bottomrule \end{tabular} \caption{Arg:...
4
votes
2answers
365 views

How can I write like this example and boxs in latex

How can I write like this example and boxs in latex thanks very much
2
votes
1answer
28 views

How to align the left hand skill type?

Within the following piece of code I wish to align the skill type with the top of the text written on the right hand side. Otherwise the text becomes difficult to separate. This is from a template CV ...
5
votes
1answer
64 views

How to “shallow” \renewenvironment of \itemize?

I want to patch exactly the outer level of \itemize, whereas the following MWE (expectedly) patches all of them: \documentclass{article} \begin{document} \setlength{\fboxsep}{0pt} \let\saveditemize=...
0
votes
0answers
35 views

How to make post processing changes?

I'm not a Latex expert so I might be using the wrong terminology. I would like to create a package that make some post processing calculation and write the result to the document. More specifically, I ...
0
votes
0answers
15 views

Change the behaviour of emph per environment

Is there redefine the way emph behaves in the definition environment? Right now, since definition is in italics, emph just makes the text non-italic which is not enough to make it stand out. Is there ...
1
vote
0answers
41 views

Using enumerate within theorem environment [duplicate]

I defined myself a \newtheoremstyle a \newtheorem + \newenvironment as in the following %Theoremstyle with \newline \newtheoremstyle{break} {\topsep}{\topsep}% {\normalfont}{}% {\bfseries}{}% {\...
4
votes
2answers
56 views

reformat section headings to include text

I'm sure that there's a easy answer, but I've reached the point of frustration trying different things with the \renew command. I want to reformat all section headings to include the text "Question" ...
2
votes
2answers
64 views

Defining alternative environment for code listing for tex4ht without code duplication

I am using tcolorbox with listings for code formating, which works well in pdf, but this package does not work with tex4ht (it produces invalid output). I am having hard time figuring the latex magic ...
0
votes
1answer
21 views

“widetext” not recognized in TeXstudio

I use "revtex4-1" document class in TeXstudio. But I find that the environment "widetext" is labeled "command not recognized" even after I check the box before the term "revtex4-1.cwl" in the "...
3
votes
2answers
72 views

help in finding error using \newenvironment

I am learning \newenvironment and I need help in finding where my error is in making \newenvironment. I get a Latex error and I do not see what I am doing wrong. I am trying to reduce code ...
0
votes
1answer
24 views

Changing the top margin of the proof environment

In my opinion the proof environment has too big of a top margin. I'd like to have it visually closer to the proposition or theorem it refers to. I have verified that adding \vspace{-3ex} before a ...
1
vote
1answer
23 views

longtable and filecontents inside a newenvironment

I'm trying to create a new environment for longtable enclosed by a filecontents environment. But I'm stuck and don't know exactly how to solve my problem. \documentclass[a4paper,parskip]{scrartcl} \...
3
votes
1answer
40 views

“Something's wrong--perhaps a missing \item” error in \newenvironment using a \vtop box

In attempting an answer to "How to label a list / make a line before list stick with the list?" I answered using a \vtop box to contain the entire list including the label. I then, trying to improve ...
3
votes
1answer
27 views

Error: "Something's wrong--perhaps a missing \item.'' using multicol in a \newenvironment, can it be fixed?

The below works, but produces an error message Something's wrong--perhaps a missing \item. Does anybody know why it throws an error, and how to correct my code? \documentclass{article} \usepackage{...
7
votes
3answers
261 views

Environment to replace \vbox{\hbox{…}\hbox{…}\hbox{…}\hbox{…}…}

I am using LaTeX (LuaLaTeX,actually) and lately I found myself doing this a lot: \vbox{% \hbox{\strut foo}% \hbox{\strut bar}% \hbox{\strut baz}% } I use it inside tabular environments, ...
3
votes
1answer
26 views

Using/Forcing upright text within theorem environment

I would like to write an equation within a theorem that involves an integrand and the upright symbol $ \textrm{d} $ which I have abbreviated in my preamble with \newcommand{\dmath}{\textrm{d}} (...
1
vote
1answer
25 views

Create custom tabular environment

In the process of creating a beamer template from a PowerPoint template, I am trying to create a tabular environment with colored rows, lines between the rows and specific header and footer styles. ...
0
votes
0answers
16 views

Prevent gather* from creating new line [duplicate]

I've been trying to use the gather* environment for non-aligned centered equations within enumerate but I would like to prevent the new line that gather* inserts at the beginning of each item. Is ...
4
votes
1answer
41 views

How to edit proof environment or minipage

Im actually working at my faculty as assistant teacher, and I like to write in latex everything we do in classes, so I use the following format: \fcolorbox{white}{light-gray}{\begin{minipage}{18cm} ...
3
votes
2answers
26 views

Partial center in environment

I'm writing a lab manual with step by step directions. Some directions include screenshots. To keep the screenshot with the line of direction, I use samepage. I am exploring an environment I can use ...
1
vote
1answer
15 views

Implementing a new environment for Log Entry Journal

I am trying to define a new environment to create a log journal. In the left margin I wish the display the entry date. Each entry should be separated from the entry above via blank line and have a ...
2
votes
1answer
20 views

Parameter numbering doesn't work in a \newenvironment footer. How to make it work? [duplicate]

I try to create a new environment for a monotonously repeating tabular, which has one parameter. This must be at the end of the tabular. I tried this way: \documentclass[12pt]{article} \usepackage[T1]...
1
vote
2answers
48 views

Environment behaves different inside \cslet{}

Please scroll down for the EDIT and most recent version This is not a good title, but I didn't come up with a better one. I've got an environment which should be used like this (The way this looks ...
6
votes
2answers
136 views

What happens if you use a command form of an environment?

Despite the fact that tex.SX is warning me that this seems to be a subjective question, it isn't. (I don't think it's a dup either, this was the closest I found.) I want to know precisely what ...
2
votes
1answer
28 views

Forcing qed symbol to stay on same page

I've made this enviroment: \newenvironment{rjesenje}{ \emph{\textbf{Rješenje:}}}{\vspace{0.1cm} \begin{flushright} $\clubsuit $ \end{flushright} } And in my work I've got this output. How do I ...
3
votes
1answer
37 views

How can I begin a new page inside the environment codebox?

If I write all codes inside one codebox, it will overfill the page. And if I write it in two boxes, then the line counter will restart from 1. How can I save the line counter?
0
votes
1answer
29 views

Vertical Spacing After NewEnvironment Definition

How can I modify this, \newenvironment{definition}[1][Definition]{\begin{mdframed}\begin{trivlist} \item[\hskip \labelsep {\bfseries #1}]}{\end{trivlist}\end{mdframed}} so that a newline (vertical ...
3
votes
2answers
34 views

Modifying the end of the section environment, without changing its name

I would like to add certain behavior to the end of an environment (vspace). I would like to do so without changing the name of the environment. I found the following code in a different Stackexchange ...
0
votes
1answer
66 views

SAS to LaTeX: Environment longtable undefined

My general problem is that, after oh so many hours, I cannot find a way to bring SAS output into LaTeX. I have one way where SAS spits out a table using the sas package, where it gives you tables in ...
2
votes
1answer
96 views

\chaptermark undefined error in classicthesis.sty when I (attempt to) redefine \spacedlowsmallcaps

My MWE does not compile and the error is: ! LaTeX Error: \chaptermark undefined. I have debugged to the extent that I know the error is the interaction between classicthesis and my \SC command ...
6
votes
2answers
259 views

How to create very customized “numbered” environments

I want to have an environment alike or identical to the itemize or enumerate environments in such a way that I be able to fully customize each item. For example, I want to use my very own defined "...
2
votes
1answer
30 views

\linebreak \\ causes error inside \BODY of \NewEnviron

I've got some code, which is mainly based on the solution of this: Other question I asked The code looks like this and it works so far, except for the \\-stuff: \documentclass[12pt,a4paper]{article} \...
3
votes
1answer
87 views

How to create a fully customized and compatible LaTeX environment

I want to create a simple environment in LaTaX that's alike the following figure. If, for example, this environment has some spare comments like references or so, to be added above the environment (...
3
votes
1answer
42 views

Using a command for a property within an environment

I want to use a command within an environment to set an environment's property. I could do this using a parameter, but if I had more properties, parameters might be mixed up. \newenvironment{...
2
votes
1answer
41 views

New environment with parameter

This is my first question on this forum, so don't hesitate to correct me. I want to create a new environment who I can pass a parameter "color". This environment call a new command named \...
1
vote
0answers
46 views

What is a good environment for writing problems and solutions? [closed]

I'm writing a book where I record interesting problems and their solutions. However, there does not seem to be an organized list, or other reference to these types of latex packages and tex macros. ...
1
vote
2answers
71 views

Abstract page of babel[magyar] undefined

I am working on a document that uses a custom class. I want to change the class so that it would use the babel[magyar] instead of the english version. However, when I try to do so, I get the ...
8
votes
1answer
86 views

Irregular spacing around a user-defined environment

I have defined an environment for consistently typesetting a pair of alternative assumptions being made. The idea is that wherever I make an assumption, the assumptions are indented and on the left ...
5
votes
2answers
49 views

Checking if a subenvironment is unique inside an enviroment

I would like to define a environment inside another environment, but I need to make sure the new environment is unique, so there can only be of them. The unique environment should also be able to be ...
2
votes
2answers
48 views

Compatibility issue with \renewenvironment{figure} and [H] placement

This is related to Shift all floats on page horizontally. While trying to redefine the standard figure environment I've run into compatibility issues with the [H] placement specifier from the float ...
4
votes
1answer
55 views

Defining a null environment

I am writing a mathematical document and I want to make a overview document, in which I only present the theorems and definitions and not the proofs, so I thought that I can change the environment ...
0
votes
0answers
34 views

Insert portion of code before every line break in gather environment

This is a follow-up question to Redefine equation environment: auto labeling. I want to have something like \AtEndEnvironment{gather}{\label{equ:\theequation}}(at the end) plus \label{equ:\...
4
votes
1answer
17 views

Reference to \lstnewenvironment

\documentclass{scrreprt} \usepackage{regexpatch}% http://ctan.org/pkg/regexpatch \usepackage{color} \definecolor{codecolor}{rgb}{0.8,0.9,0.9} \definecolor{chatcolor}{rgb}{0.9,0.9,0.8} \usepackage{...
2
votes
1answer
64 views

How to delete the contents of the current paragraph and “re-start” from the beginning?

I want to use an environment defined in a 3rd-party package which I cannot modify. Stripped down, the definition looks like this: \newenvironment{myenv}[1]{ % some stuff here \textbf{#1} }{% some ...