2022 Developer Survey is open! Take survey.

New answers tagged

1 vote
Accepted

How can I define this new math mode environment with comma-separated keyval options?

For this to work we have to somehow get the \noalign at a position where TeX finds it (inside of the \begin{myalignedat} definition seems too late for this). Therefore the following uses the env/...
user avatar
  • 48.7k
0 votes

misalignment problem about newenvironment

I like to add a simple explanation. A line break is interpreted as a space. If you add a %, you comment out the line break, hence the space. You can see that with A B C vs. A% B% C So, if you ...
user avatar
  • 2,119
2 votes

misalignment problem about newenvironment

The second example shows where the problem is: the endline after \begin{mypro}. Add \ignorespaces at the end of the “begin” part. But I suggest two further changes: to add an optional argument and ...
user avatar
  • 985k
0 votes

Why is a box seemingly emptied after closing an environment

I'm a fan of the environ package, so I will add my version based on Steven's one. \documentclass{article} \usepackage{environ} \begin{document} \newsavebox{\somebox} \NewEnviron{myenv}{ \begin{...
user avatar
  • 2,119
2 votes

Why is a box seemingly emptied after closing an environment

The reason of the problem (LaTeX environment creates a group) was mentioned in another answers. You can use only TeX primitives, it gives you much more control what is done: \newbox\somebox \def\...
user avatar
  • 52.3k
2 votes

Why is a box seemingly emptied after closing an environment

Boxes are assigned locally by LaTeX, so after the end of myenv the assignment is lost. \newsavebox{\somebox}% for global assignment \newsavebox{\someboxinternal}% for local assignment \newenvironment{...
user avatar
  • 985k
1 vote
Accepted

Why is a box seemingly emptied after closing an environment

The whole idea of environments is that their work occurs in their own group (as if the code were surrounded by {...}. Thus, by design, what happens in the environment is inaccessible to the outside ...
user avatar
1 vote
Accepted

How can I define an environment similar to alignat, but calculates the number of columns automatically like align?

A simple approach is to make a new environment that forwards 99 to alignat: (remark, this is the "standard" method to redefine environment; nevertheless it will not work for some particular ...
user avatar
  • 1,471
1 vote

How to adjust vertical space before and after center environment

I added a \vspace{} command inside the center environment at the top and buttom, which seems to have worked. You can make the space smaller by using negative values and make the space larger by using ...
user avatar
  • 908
5 votes

How can LaTeX form an environment of Bionic-Reading style?

My solution uses only TeX primitives and common macro \newcount. We need nothing more. \newcount\tmpnum \def\bionic{\futurelet\next\bionicA} \def\bionicA{\ifx\next[\afterfi\bionicB \else \afterfi{\...
user avatar
  • 52.3k
4 votes

How can LaTeX form an environment of Bionic-Reading style?

As the question was so interesting I tried it (in LaTeX2e) even though It was already answered. I'm not an expert and I think it will fail if you have accentuation marks or some other weird stuff. \...
user avatar
  • 365
4 votes

How can LaTeX form an environment of Bionic-Reading style?

Approach with the xstring package for string manipulation and xfp for calculating the substring length: \documentclass{article} \usepackage{xstring} \usepackage{xfp} \newcommand{\bionic}[2][0.5]{% % ...
user avatar
  • 29.6k
10 votes
Accepted

How can LaTeX form an environment of Bionic-Reading style?

This is a solution using expl3 (LaTeX3, if you like 😉) --- I'm a novice with it, so probably it can be made better. It uses percentages instead of fractions so that I can use integer arithmetic only. ...
user avatar
  • 29k
1 vote

Hide Algorithm environment

You do not need the tabular environment to specify an algorithm in LaTex. Use some packages like algorithm and algpseudocode. Here is an example of the algorithm in your picture, where the definition ...
user avatar
  • 347
2 votes

Help with newenvironment for unnumbered theorems

Define the label to be variable. You just need one theorem environment. \documentclass{article} \usepackage{amsthm} \newcommand{\axiomname}{} \newtheorem*{axiominner}{\axiomname} \newenvironment{...
user avatar
  • 985k
1 vote
Accepted

`widetext` doesn't play nicely with the `osa-article` documentclass; are there alternatives?

Maybe using cuted package instead of widetext would help. You can add rules manually if you like. \documentclass{osa-article} \journal{osajournal} \usepackage{cuted} \usepackage{lipsum} \begin{...
user avatar
0 votes
Accepted

Create side-by-side environments in Latex

You weren't entirely clear about what the problem was, but I'm assuming you want the email address and phone number to use the same kind of aligning as the lines above them, so the first set is ...
user avatar
  • 35.7k
1 vote

Synctex: make it work with environment accessing its content (e.g. environ or xparse +b option)

I don't see how that would be possible in a macro expansion language. The content of a macro is not processed so you can only get error messages or synctex markers where it is used and that may be ...
user avatar
0 votes
Accepted

How to change alignment of \uplevel in exam class?

Please check if this layout fits your requirements. Your code was very close. (marked with <<<<< the lines changed or added) \documentclass[a4paper,12pt, addpoints]{exam} %\...
user avatar
  • 24.5k
2 votes
Accepted

How to define a custom description environment?

Just % definition \NewDocumentEnvironment{my desp}{ m m }{% \begin{description}[align=right, itemindent=0cm, leftmargin=\labelsep+#1, font=#2] }{ \end{description}% } % usage \begin{my desp}{3cm}{...
user avatar
  • 20.6k
3 votes
Accepted

Create environment whose contents are passed to tikz-matrix

Do you know the nicematrix package and have you tried it to achieve your goal? Here is a short example: \documentclass[multi=mymatrix]{standalone} \usepackage{tikz} \usepackage{nicematrix} \...
user avatar
2 votes
Accepted

How to change an environment in its body

I'm not sure I understand the problem. I suggest this. \documentclass{article} %https://tex.stackexchange.com/questions/641994/how-to-change-an-environment-in-its-body \usepackage{lipsum} \...
user avatar
  • 543
2 votes
Accepted

Example with clubsuit (no ntheorem)

The problem is with \pushQED{\hfill$\clubsuit$}. You really need \pushQED{\qed} or to define something else along the line of \qed. The easiest way is to add an optional argument for the symbol to use....
user avatar
  • 985k

Top 50 recent answers are included