Skip to main content

Questions tagged [environments]

{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.

4 votes
3 answers
116 views

usepackage comment: conditional output inside environment

I'm using package comment in my projects with great success. Recently I tried to define conditional output inside a tabularx environment, to no avail. MWE: \documentclass{article} \usepackage{tabularx}...
Andreas Deininger's user avatar
1 vote
1 answer
16 views

Separate listing counter and name for "Run Output" type of listing

I want to define a new listing environment for a “program output” kind of listing via \lstnewenvironment. I also want a new counter for program output listings that's separate from regular listings, ...
Paul J. Lucas's user avatar
3 votes
2 answers
53 views

Problem with Renewenvironment `marginfigure` provided by sidenotes package

I tried to renew the environment marginfigure provided by sidenotes package, however it failed to compile. marginfigure is used to put a figure in the margin. The MWE example is to set/reset the value ...
X Leo's user avatar
  • 267
4 votes
4 answers
91 views

Boxed environment with several rows in its title

I'm a math teacher. I use MS Office to generate handouts like these one : I need to display several informations in the header for referencing. I tried to replicate something similar in latex using ...
Froum's user avatar
  • 43
3 votes
0 answers
35 views

How to determine reliably whether code is called in a table or figure environment?

Section 8.17 of the APA style requires In tables and figures, use an ampersand between names in both parenthetical and narrative citations. The apa style for biblatex currently does not provide this ...
Markus Kurtz's user avatar
3 votes
2 answers
96 views

Including code inside custom environment

For making homework assignments I define a custom environment (see \soln{} below) to show/hide solutions. I would like to be able to include code in the solutions somehow, which I ordinarily do with ...
Dedekind Cuts's user avatar
0 votes
1 answer
55 views

Environment for customized table

I would like to create a LaTeX environment called "myenv" to generate customized tables with the following specifications: The environment should create a 2x2 table, with the first row ...
fspa's user avatar
  • 103
1 vote
1 answer
35 views

Putting if-else in environment

I made a tcolorbox based environment that I want to toggle on and off depending upon whether I want to show the solutions or not. The following code works fine when \boxtoggle is set to 1, but not ...
R Walser's user avatar
  • 299
1 vote
1 answer
62 views

Closing a macro with other possible macros

I have an interface to build songs. It works (simplified for this case) like this: \begin{canto}{<name>} \estrofa contenido de la estrofa\f \estrofa contenido de la estrofa\f \...
gxono's user avatar
  • 538
0 votes
0 answers
28 views

Why are the column dividers in the first line disappearing, and is there a way to refer to count the number of lines in a table before it's completed?

I'm trying to define a new environment that wraps tabularx to set up some rowcolors and automatically numbers rows in the table. However I can't figure out why the first two dividing lines are ...
Epithet's user avatar
  • 45
2 votes
2 answers
38 views

Given that a section header is inside a tcolorbox, how can I make it such that the color of the box cycles through 4 colors?

Using xpatch and tcolorbox. I got my section headers to appear inside a tcolorbox, however, I want said headers to cycle through 4 different colours, without loosing the properties of the section ...
Mateo Indigo Stivalet's user avatar
4 votes
3 answers
205 views

Create environment for figures

I would like to create an environment to add figures with the following requirements: Top and bottom horizontal lines with the same width of the figure Title at top of figure, source and legend at ...
Brasil's user avatar
  • 1,420
0 votes
0 answers
19 views

Environment samepage breaks multicols

When making problem sets for a class, I often want to save a little space so I will use multicols for problems that have many parts. I also often want to keep an entire problem, with all of its parts, ...
TrivialCase's user avatar
0 votes
1 answer
36 views

How to get rid of the additional space that I get in an environment that ends with displaymath?

I need to get rid of the additional space that I get in an environment that ends with displaymath. Consider the following MWE: \documentclass{article} % PACKAGES LOADING \usepackage[]{mathtools,...
EoDmnFOr3q's user avatar
  • 2,363
1 vote
2 answers
59 views

Non-locality of itemize fumbling with \par

For reasons, I have code that puts a hook in cmd/par/after (for this MWE, this will be the stupid \vskip 2cm). I know that many parts of LaTeX interact and redefine \par and this can break hooks, as I ...
ysalmon's user avatar
  • 1,264

15 30 50 per page
1
2 3 4 5
220