Comments (4)
You're doing two different things. The label you specify in [Chapter_introduction]
is converted to a valid anchor label (stripping out illegal characters), and is converted to lower case. This is normal MMD behavior.
When you manually specify a URL, MMD doesn't alter it (why would it?) --- [foo](bar)
or [foo](#bar)
.
If you want to reference a MMD label, simply use that syntax --- [Chapter_Introduction]
.
from multimarkdown-4.
I am aware of the difference. But that behaviour is not always the desired one. Maybe the above example does not illustrate what I mean correctly.
Consider this:
Introduction [Chapter_Introduction]
-----------------------------------
...
In [Chapter_Introduction] we introduce a mathematical model for unwelcome opinions.
Currently, multimarkdown will translate that into:
\chapter{Introduction}
\label{chapter_introduction}
{\ldots}
In Chapter\_Introduction (\autoref{chapter_introduction}) we introduce a mathematical model for unwelcome opinions.
Which, once processed with latex, keeps the Chapter_Introduction
label.
Chapter 1. Introduction
...
In Chapter_Introduction (Chapter 1) we introduce a mathematical model for unwelcome opinions.
In MultiMarkdown 3 and up to MultiMarkdown 4.2, but excluding the current HEAD, the original label is not capitalised. Which allows for the desired behaviour. So this:
Introduction [Chapter_Introduction]
-----------------------------------
...
In [](#Chapter_Introduction) we introduce a mathematical model for unwelcome opinions.
will be transformed into this:
\chapter{Introduction}
\label{Chapter_Introduction}
{\ldots}
In \autoref{Chapter_Introduction} we introduce a mathematical model for unwelcome opinions.
which, once processed with latex, becomes:
Chapter 1. Introduction
...
In Chapter 1 we introduce a mathematical model for unwelcome opinions.
This is a change in behaviour from previous versions, which could deal with this case.
from multimarkdown-4.
Yes -- so this is a different question. Key is to think about what each structure is:
[foo][bar]
uses foo
in the text body, and looks for a label named bar
. MMD will look for a label that matches the proper case, but in the setting of headers the actual "anchor" text (HTML term, but LaTeX is analogous) will be lower case.
[foo][foo]
[foo]
are the same as [foo][bar]
, but it just so happens that the text you want and the label you are using are the same. So the second version is just a shortcut of the first version.
[foo](http://bar.com/)
[foo](#bar)
is different. The second version says make a URL/link using foo
as the text, but #bar
as the target URL. This structure assumes you know what you are linking to, and does what you say.
What you want is:
[][bar]
or
[][Chapter_Introduction]
This says "link to the thing labelled Chapter_Introduction
, but don't add any additional text."
from multimarkdown-4.
Right. Thank you.
I guess in the previous versions it worked because the heading label wasn't changed into lowercase.
The confusion might also be because the [](#label)
form is the only way to reference figures, as the [][label]
form includes a footnote with the name of the image file, not a reference to the figure, as if it was a regular link to a url.
![this is a figure instead][Figure]
[][Figure] is a diagram of the model.
[Figure]: fig.png "" width="100%"
is transformed into:
\begin{figure}[htbp]
\centering
\includegraphics[keepaspectratio,width=1.0000\textwidth,height=0.75\textheight]{fig.png}
\caption{this is a figure instead}
\label{figure}
\end{figure}
\href{fig.png}{}\footnote{\href{fig.png}{fig.png}} is a diagram of the model.
which results into
[inserted figure]
^1 is a diagram of the model.
--------------
1. ought.png
Whereas
![this is a figure instead][Figure]
[](#Figure) is a diagram of the model.
[Figure]: fig.png "" width="100%"
used to output:
\begin{figure}[htbp]
\centering
\includegraphics[keepaspectratio,width=$.4f\textwidth,height=0.75\textheight]{fig.png}
\caption{this is a figure instead}
\label{Figure}
\end{figure}
\autoref{Figure} is a diagram of the model.
and then:
[inserted figure]
Figure 1 is a diagram of the model.
but in the current HEAD, \label{Figure}
is lowercase (\label{figure}
), which means that autoref
won't pick up the reference correctly.
P.S. I just realised that I made a mistake in the previous post. Where it says:
In MultiMarkdown 3 and up to MultiMarkdown 4.2, but excluding the current HEAD, the original label is not capitalised.
It should say:
In MultiMarkdown 3 and up to MultiMarkdown 4.2, but excluding the current HEAD, the original label is left untouched. The current head, changes the label to lowercase.
from multimarkdown-4.
Related Issues (20)
- MMD header key and value left in HTML head after conversion HOT 2
- Request: Include Paths to CLI HOT 8
- {{TOC}} Error with variables in a heading HOT 1
- Empty double quotes inside a table cell breaks layout HOT 1
- fancy lists (letters instead of numbers) HOT 1
- Removing comments HOT 3
- Special characters in metadata values/variables HOT 1
- Well formed HTML/XML with missing figure definition HOT 2
- Invalid XML/HTML with Markdown inside nested block element tags HOT 1
- ![Alt text](/path/to/img.jpg "Optional title") syntax currently broken HOT 1
- Reference labels should be case-insensitive HOT 1
- Support for rST-style Admonitions HOT 2
- Can I get line/column information from a node? HOT 5
- Incorrect works code blocks? HOT 3
- Can you add support strikethrough text? HOT 1
- Support for indexes HOT 3
- Custom Block Syntax HOT 3
- Ampersand in bibliographical references is not converted to &. HOT 1
- Problems with spaces after footnotes in .FODT output HOT 3
- Crashes while freeing a g_string HOT 12
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from multimarkdown-4.